Connect 21st.dev to VS Code
Community marketplace of React components, templates, shadcn themes and shaders, with a hosted MCP server for agents. Browsing is free; copying more than a few components a day needs a membership.
MCP serverOfficialChecked 2026-11-16
Before you start
- VS Code installed (see its MCP documentation (opens in a new tab)).
- 21st.dev is available on macOS, Windows, Linux and the web.
- Get an API key at 21st.dev/mcp and set it as
API_KEY_21STin your environment. Keys from the old Magic console no longer work. AI generation tools only appear when your account has AI access. Each component page also shows its own shadcn CLI command.
Step 1: Add 21st.dev to VS Code
Add it to the workspace
Add this to
.vscode/mcp.json. It holds no token, so you can commit it to share it with your team..vscode/mcp.json { "inputs": [ { "type": "promptString", "id": "21st-dev-token", "description": "Token for 21st-dev", "password": true } ], "servers": { "21st-dev": { "type": "http", "url": "https://21st.dev/api/mcp", "headers": { "x-api-key": "${input:21st-dev-token}" } } } }Good to know- VS Code asks for the token the first time the server starts and stores it for you, so the file holds no secret.
Step 2: Check it's connected
Run MCP: List Servers from the Command Palette, then open Copilot Chat in Agent mode and check the tools picker.
Step 3: Try a first request
Ask VS Code something that only works with 21st.dev connected:
Say to VS Code Search 21st.dev for a pricing section that fits this page and show me how to adapt it.
If it doesn't work
- VS Code asks you to trust a server the first time it starts. Accept it, or the tools stay hidden.
code --add-mcpwrites to your user profile, so the server works in every workspace.- Use MCP: List Servers → Show Output to see startup errors.





