If you are trying to connect 21st.dev components to an AI coding editor, use the new 21st MCP, not a new standalone Magic MCP setup. Create a fresh API key at 21st.dev/mcp, install the server for your editor, and confirm that the editor lists the current 21st tools before using it on a client project.
Free accounts can search the library and retrieve two components per day across the web, MCP, and CLI. Paid Builder plans remove that retrieval limit, while hosted AI generation requires an AI-enabled plan with credits.
Key takeaways
- Use the unified 21st MCP and the 21st CLI for new installations.
- Create a new API key at
21st.dev/mcp; retired Magic keys no longer work. - Claude Code and Cursor have dedicated setup flows. Windsurf and VS Code can use the streamable HTTP endpoint.
- Free accounts receive two component-code retrievals per day across web, MCP, and CLI.
- AI generation uses credits, and the price hint plus usage record show what each generation costs.
- Treat 21st MCP as a hosted UI service, not as web hosting, email hosting, security software, or an SEO platform.
What does 21st MCP do, and who needs it?
If you are building a website in React, Tailwind, or another supported front-end setup, 21st MCP connects your AI coding editor to the 21st.dev component library. You can ask the editor to search for a component or theme, retrieve component code, find a logo, read design inspiration, or generate UI through hosted 21st AI when your account has AI access.

The practical benefit is that you can keep the request inside Claude Code, Cursor, Windsurf, or VS Code. For example, you might ask the editor to search for a responsive pricing table that follows your existing Tailwind tokens, then retrieve the code and adapt it to your project. The current preferred tool names include search, get_component, generate, get_inspiration, and search_logo.
The name can cause confusion because Magic MCP was the earlier name and package. 21st.dev now describes the service as the unified 21st MCP. Existing @21st-dev/magic configurations remain supported through a compatibility proxy, but new installations should use the 21st CLI.
This is useful for a freelancer, small-business owner, or developer who wants component code available in an AI editor. It does not replace a web host such as Hostinger, a WordPress installation, a domain registrar, email hosting, security software, or an SEO tool. It helps produce or retrieve interface code, while your separate hosting, domain, email, backup, and search setup still manages the live website.
For a wider assessment of the component library and its limits, use the 21st.dev review. If your immediate decision is whether the free limit justifies payment, continue to the pricing section and then the 21st.dev pricing comparison.
How do you move from Magic MCP to the current 21st MCP?
If you already have Magic MCP configured, first record the current server name, configuration file, editor, and project that uses it. Do not cancel a paid plan or remove a working configuration before the new server has connected and returned the tools you need.
The main change is authentication. Retired Magic API keys were reset and no longer work. Create a fresh key at 21st.dev/mcp, copy it into the new configuration, and keep it private. An API key is the credential the hosted server uses to identify your account, so do not commit it to a repository or paste it into client-visible code.
New installations use the 21st CLI:
npx @21st-dev/cli@latest init --client claude
npx @21st-dev/cli@latest init --client cursor
npx @21st-dev/cli@latest init --client windsurf
npx @21st-dev/cli@latest init --client vscode
Choose the client that matches the editor you use. The CLI writes the relevant setup for that editor. After it finishes, restart or refresh the editor and check whether the 21st server appears in its MCP list. A successful connection should expose tools such as search and get_component. The generate tool may be absent when your account has component access but no hosted 21st AI access.
If the new setup works, run a small search and retrieve one component in a non-critical project. Check that the returned code matches the expected library and that your editor can use it. Keep the old configuration until this check passes. Then you can stop using the old Magic entry, while keeping a copy of its settings in case another project still depends on it.
The old package remains available for clients that only support standard input and output, known as stdio:
{
"mcpServers": {
"21st": {
"command": "npx",
"args": ["-y", "@21st-dev/magic@latest"],
"env": {
"API_KEY_21ST": "YOUR_21ST_API_KEY"
}
}
}
}
Use this compatibility route only when the editor cannot connect to the hosted HTTP server. The unified server is the preferred path for a fresh setup, and it reduces the chance that an older client displays retired tool names or malformed responses.
How do you connect Claude Code, Cursor, Windsurf, and VS Code?
Choose one editor first, create the fresh key, and add one named 21st server. After saving the configuration, verify the server before adding it to a client project. The setup differs slightly because each editor stores MCP connections in its own place.

Claude Code
Claude Code has a direct terminal command for the hosted HTTP server:
claude mcp add --transport http 21st https://21st.dev/api/mcp \
--header "x-api-key: YOUR_21ST_API_KEY"
The endpoint is the hosted 21st MCP server. The key belongs in the header, not in a prompt or source file.
Check the connection from the terminal:
claude mcp list
claude mcp get 21st
Inside Claude Code, /mcp opens server management. A working entry should show the 21st server as connected and should make the current tools available. Ask Claude Code to search for a component before asking it to generate one. That separates connection problems from account-access problems.
If Claude Code skips the server, confirm that the remote entry is marked with "type": "http" in its JSON configuration. A remote URL without the HTTP type can be treated as an invalid or incomplete server entry. If you need to roll back, preserve the working file, disable only the new 21st entry, and restore the prior configuration after recording the error.
Cursor
Cursor supports one-click installation from Customize, then MCPs. It also accepts a manual mcp.json entry:
{
"mcpServers": {
"21st": {
"type": "http",
"url": "https://21st.dev/api/mcp",
"headers": {
"x-api-key": "YOUR_21ST_API_KEY"
}
}
}
}
Cursor makes enabled MCP tools available in chat and asks for approval by default. After saving, refresh the MCP panel and confirm that the 21st server is enabled. Ask for a component search, then retrieve a small component. If search works but generation is missing, check the account’s AI access instead of repeatedly reconnecting.
Cursor’s MCP logs can help separate an invalid key from a server or network problem. Keep the key outside project files that are shared with a client. If the entry fails, copy the configuration to a safe local note, disable the failed entry, and retry with a newly generated key.
Windsurf
Windsurf uses Cascade’s MCP controls or its global configuration file:
~/.codeium/windsurf/mcp_config.json
Use the same mcpServers structure and the hosted HTTP endpoint. Save the file, then refresh the MCP toolbar in Windsurf. The server should appear as available, and Cascade should be able to call search or get_component.
If the server appears but does not connect, inspect the MCP toolbar and logs. Confirm the header name is exactly x-api-key, the key is fresh, and the URL has not been copied with extra quotation marks or spaces. A successful search is the first useful check. Component retrieval is the next check, followed by hosted generation only if your account permits it.
VS Code
In VS Code, open Chat, then Open Customizations, MCP Servers, and Add Server. Select HTTP, enter the hosted endpoint, and provide the x-api-key authentication header. VS Code also supports a native .mcp.json file using the mcpServers format.
After saving, reopen the MCP server controls and confirm that 21st is connected. Ask VS Code to search the 21st library and identify the returned tool by name. If it shows older names such as 21st_magic_component_builder or logo_search, the compatibility layer may be translating legacy names. The current names are preferred, but the older names remain translated for compatibility.
For any editor, the working sequence is the same, and it keeps connection problems separate from account problems. If a configuration fails, roll back by disabling that single server entry and preserving the previous file. Do not remove a working editor setup until the replacement has passed a small project test.
What is free, what uses credits, and what does one credit buy?
If you only need to find components or retrieve occasional code, test the free account before paying. Search is free on every plan. Free accounts receive two component-code retrievals per day across the 21st website, MCP, and CLI, so using the same account in several places does not create a separate daily allowance for each one.
Paid Builder plans remove the component retrieval limit. Hosted AI generation is separate from retrieval and requires an AI-enabled plan. A successful MCP connection therefore does not prove that generation is available.
Prices checked November 18, 2026. The displayed annual amounts are the current recurring prices, but 21st’s terms say future prices and allowances can differ by plan and are shown before purchase. Plans renew at the then-current rate, so confirm the amount on your billing screen before each new term starts.
Builder + AI adds monthly credits, multi-model generation, premium models, and Design Bug Bot. The account balance is shared across the web, MCP, and CLI. Additional packs provide 100 credits for $5 and roll over after the monthly allowance has been used. Monthly plan credits expire at the applicable reset, while separately purchased packs roll over until used.
A credit is not a fixed number of generations. 21st says credit use depends on the model’s actual cost, so a shorter draft costs less than a longer one. Check the generation price hint before starting, then check the usage record afterward. A prompt that generates three dashboard-header variants may use a different amount from a short single-component request.
Before checkout, confirm the selected tier, the full annual charge, the credit allowance, and the current Billing terms. Paid plans and credit packs are non-refundable except where applicable law or written approval provides otherwise. Cancellation stops future renewals and preserves paid access through the current billing period, subject to suspension or termination terms.
What are the limits before you use 21st MCP on a client project?
If you are deciding whether this belongs in a client workflow, separate the useful connection from the responsibility for the final site. 21st MCP can search, retrieve, and sometimes generate UI code, but it is not a hosting or deployment service.

It does not provide site storage, bandwidth quotas, inode allowances, domains, email hosting, backups, a hosting service-level agreement, or an uptime guarantee. You still need a host, a domain, an email provider, security controls, and an SEO process. A separate provider such as WordPress.org may define the application, but it does not turn the MCP into a live website platform.
Generated code is not guaranteed to be production-ready, accessible, responsive, secure, or compatible with your project. Review the component against the client’s design system, dependencies, licensing needs, forms, analytics, and responsive behavior before merging it.
MCP servers can access external services and execute code on your behalf. Review the repository, endpoint, requested permissions, and API-key scope before enabling the server. For a client project, keep the key in the approved secret-management process, record which account owns the subscription, and confirm who will pay for editor usage separately.
The cleanest test is a small non-production project. Search for a component, retrieve its code, check the generated files, and run the project’s normal checks. Keep a known-good branch or copy so you can remove the new component without removing the rest of the client’s work.
How do you fix missing tools, invalid keys, and failed connections?
If the server is missing, start with the key and the client configuration. A retired Magic key will not authenticate. Create a new key at 21st.dev/mcp, update the x-api-key header or environment variable, refresh the editor, and reconnect.
If Claude Code skips the server, confirm that the remote entry uses "type": "http". Check claude mcp list and claude mcp get 21st. In Cursor, inspect MCP Logs. In Windsurf, use the MCP toolbar and logs. In VS Code, reopen the MCP server controls and confirm the HTTP entry is enabled.
If the server connects but does not show generate, component access may be active without hosted 21st AI access. Check whether get_usage.aiGenerationEnabled is true. If it is false, enable an AI plan if that fits your use, then refresh the editor’s tool list or reconnect the server.
An ai_subscription_required response means the account is not permitted to make that generation call. Stop retrying the same request until AI access is enabled. Search and component retrieval can still work without hosted generation, subject to the free retrieval limit or the plan’s allowance.
If you see malformed responses or outdated tool names, move to the unified 21st MCP with a fresh key. Clients that only support stdio can use the compatibility package. Preserve the old configuration before changing it, then disable the failed entry only after the replacement has passed a search and retrieval check.
Which next step fits your pricing or product decision?
If you only need occasional component code, stay on Free and track the two daily retrievals across all 21st access points. Check the usage record after each retrieval so you know whether the shared limit fits your normal work.

If you need regular retrieval but do not need hosted AI, Builder is the clearer fit at the displayed $72 upfront per year, billed yearly at $6 per month. Confirm the current renewal amount and allowances at checkout because future pricing is not fixed by today’s displayed figure. Prices checked November 18, 2026.
If you need hosted generation, compare Builder + AI’s displayed annual commitment and credit tier with your expected prompts. Check the price hint before each generation, then compare it with the usage record. A credit pack may help after the monthly allowance, but its $5 price covers 100 credits and does not make generation unlimited.
If several people need access, review Team’s seat pricing and optional AI credits. Confirm the number of seats, the total annual charge, and each editor’s separate plan and usage charges before subscribing. The 21st subscription does not pay for Claude Code, Cursor, Windsurf, or VS Code usage.
Before paying or connecting 21st to a client workflow, review the checkout terms and current Billing settings. Treat paid plans and credit packs as non-refundable unless applicable law or written approval says otherwise. If availability matters for a deadline, check current 21st status and support channels because MCP is a dependent hosted service.
For a broader product decision after setup, compare the 21st.dev review. If the main question is cost, credits, and the annual commitment, use the 21st.dev pricing guide.
Frequently asked questions
The answers below cover the next setup and billing questions that commonly follow a first connection.
Is 21st.dev Magic MCP still available?
Magic MCP is now called 21st MCP, and new installations should use the unified 21st CLI. Existing @21st-dev/magic setups remain supported through a compatibility proxy for clients that need stdio.
Where do you create a 21st MCP API key?
Create a fresh key at 21st.dev/mcp. Retired Magic keys were reset, so an older key will not authenticate the current server.
Can you use 21st MCP for free?
Yes. Free accounts can search the component library and retrieve two components per day across the web, MCP, and CLI. Hosted AI generation requires an AI-enabled plan.
Does searching use an AI credit?
Search and component retrieval are separate from hosted AI generation. Not every MCP call consumes an AI credit, but retrieval still counts toward the free account’s daily component limit.
Why does the editor connect but show no generation tool?
The account may have component access without hosted 21st AI access. Check whether get_usage.aiGenerationEnabled is true, then enable an AI plan and refresh the editor’s MCP tools.
Can Cursor install 21st MCP without a terminal command?
Yes. Cursor supports one-click installation from Customize, then MCPs. It also supports a manual mcp.json entry with the hosted HTTP endpoint and the x-api-key header.
Which editor needs the compatibility proxy?
Clients that only support stdio can use the older @21st-dev/magic package as a compatibility route. Claude Code, Cursor, Windsurf, and VS Code have setup paths for the current hosted HTTP server.
Do 21st credits roll over?
Monthly plan credits expire at the applicable reset. Separately purchased credit packs roll over until used, have no cash value, cannot be transferred, and are non-refundable except where required by law.
Does cancelling a paid plan remove access immediately?
Cancellation stops future renewals and normally preserves paid access through the current billing period. The terms allow access to be suspended or terminated in some circumstances, so review the current Billing settings before cancelling.
Is 21st MCP a web host?
No. It connects an editor to UI components and hosted AI features. It does not provide website storage, domains, email hosting, backups, deployment, or an uptime guarantee.
The practical next step is to create the fresh key, install the server for one editor, and confirm search and get_component on a small project. Once that works, compare the free limit with your actual usage before choosing an annual plan or credit pack.
Glossary
Find more reviews and guides on Even Reviews. Spotted something to correct? Contact us and include the page title.




