Endpoint
- URL:
https://21st.dev/api/mcp(HTTP, JSON-RPC 2.0) - Auth: header
x-api-keywith a 21st API key from 21st.dev/settings/api-keys
Set it up
The fastest way is the CLI:cursor, claude, codex, vscode, devin. This merges a 21st server into your client config without touching other MCP servers you already have. Windsurf became Devin Desktop in June 2026, and --client windsurf still works as an alias.
- Cursor
- VS Code
- Devin Desktop
- Claude
- Codex
Writes
.cursor/mcp.json:API_KEY_21ST in your environment to the key from your settings. VS Code is
the exception: it prompts for the key instead of reading the environment.
What the tools do
Search & browse (free)search— find components, themes, and templates with filters, as plain datasearch_picker— same assearch, but renders an inline picker in hosts that support it (use when you want to browse and pick a result visually)search_logo— find brand and UI SVG logos by name (returns the SVG urls)get_component— fetch a component’s code and its demo (on the free tier the result also says how many retrievals are left today)get_theme— fetch a theme’s CSS (free and unmetered, no quota attached)
generate— start a sketch or code generation (shown when AI is enabled)get_generation— list a generation’s drafts (free)iterate_generation— refine a draft (shown when AI is enabled)get_generation_job— poll an accepted refinement by its job ID (free)get_take— fetch the exact saved take/version, code, copy-prompt, agent prompt and structure (free, with the existing Remix trial take-out wall)get_notes,update_note— read sent editor notes and report progress on their existing IDs (free)get_changes— read saved edits and a change plan since a version or the last pull (free)edit_take— apply deterministic Sketch edits using stable target IDs and an exact current version (free)record_take_outcome— report landed, adapted or abandoned after taking out that exact version (free)send_feedback— forward the user’s requested feedback with server-derived take context (free)
list_bookmarks,bookmark,create_bookmark_list,add_to_listlist_teams,list_team_libraries,list_team_components
edit_component/delete_component,edit_theme/delete_theme,edit_template/delete_templateget_profile/edit_profile/upload_profile_media
get_usage— account tier,aiGenerationEnabled, free daily component-code retrieval quota, and AI credits balance, reset time and personal/team scope
Search and metadata tools are free. Generation and iteration require AI
enabled on the account and available credits. Builder and Team start with AI
off; a base Builder subscription covers component retrieval, not 21st AI
generation. Code retrieval is free on paid plans and metered on the free tier.
See credits.
generate and iterate_generation only when AI is enabled for
your account. Without AI, your agent can use search → get_component and adapt
the code itself. Reading existing drafts with get_generation and get_take
remains available.
After enabling AI, refresh your client’s tool list or reconnect the MCP server.
If an older cached tool returns ai_subscription_required, the agent should
stop generation attempts and use search and component retrieval instead.
Draft and hand off
Use the full project UUID in every call. Take numbers and saved versions are one-based; a short label such asab12cd34/2@v3 is for display only.
Sketch starts server-side. Poll get_generation until each take is ready,
failed or stopped. A timeout keeps the existing project addressable; polling
must never start another generate. Code returns needsBrowser:true until the
user opens the existing preview. Sketch and Code refinements return durable job
IDs and use the same production producers as the web editor: poll
get_generation_job, then retrieve the new saved version with get_take.
Code starts from the exact saved source snapshot and applies file scopes and
locks; an unavailable historical source is rejected instead of substituted.
get_take {projectId, take, version} fetches that exact version. Sketch returns
HTML and an integration spec; Code returns a private source snapshot and
dependencies when available. An exact Code version without a snapshot returns
snapshot_unavailable; opening preview does not recover its historical source.
Latest legacy Code can use the current web preview. get_take {latest:true} only suggests a recent
handoff for confirmation and does not fetch its source.
Editor notes are available with get_notes; the default is the take whose
notes the user last sent. Report in_progress, done or wont_do with
update_note {ids, status}. wont_do requires a one-line summary. Free
edit_take requires a current version and stable target IDs from get_take;
it saves a new version and rejects stale or locked edits.
{type:"duplicate", target:"card"} inserts a fresh-addressed clone after the
original. {type:"move", target:"card", anchor:"main", position:"into"} moves
it into an existing saved container. Code accepts only static JSX within one
tree, protecting source and destination locks. Dynamic expressions, handlers
and imported components require an explicit note; there is no paid fallback.
Save and fetch again before addressing the new clone.
get_changes {projectId, take, since:"pulled"} uses your latest successful
agent or CLI retrieval, including a historical version, and includes notes
changed since that retrieval on the same version. Web copy does not move this
cursor. If there was no pull, fetch get_take first.
After integration, record_take_outcome records the actual result for the
retrieved version with separate agent or user attribution. Include the
observed typecheck/build result, using not_run when appropriate. Abandoned
takes require a reason. send_feedback is for the user’s original words at
their explicit request; never send repository code, paths or secrets.
Hosts that support MCP Apps can display ui://21st/ai-takes-v1 for Generate,
generation status and take retrieval. Select a saved take to preview it and use
free text or hide controls on unlocked targets. Each edit requires the exact
current version; stale edits prompt a fresh pull. Opening the resource never
starts a paid generation. Other hosts receive the normal text and JSON results.
takeState reports the persisted lifecycle. Historical model and accounting
values stay null when unknown. Access denials include generationBlock;
signed-out agents should sign in or reconnect instead of retrying generation.