Data as of
21st.dev Magic AI Agent for VS Code: Setup & Config
VS Code: 21st.dev Magic AI Agent turns natural-language requests into customizable UI components inside supported coding tools.
What you can do with 21st.dev Magic AI Agent in VS Code
Generate customizable UI components in your editor with previews and 21st.dev design inspiration.
- Generate a UI component from a description in an editor chat.
- Preview a component while iterating on its design.
Before you start: 21st.dev Magic AI Agent in VS Code
- Node.js, with the latest LTS recommended
- A supported IDE or MCP client
- An API key from the Magic console
This follows the README's manual VS Code server configuration. Other supported clients also have installation instructions. Named MCP tools are not stated in the README.
21st.dev Magic AI Agent VS Code configuration
Choose VS Code configuration scope
For 21st.dev Magic AI Agent, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.
Add 21st.dev Magic AI Agent to VS Code
Use the magic-mcp entry below in servers. Keep 21st.dev Magic AI Agent's documented stdio connection fields and your other VS Code entries.
Check 21st.dev Magic AI Agent in VS Code
21st.dev Magic AI Agent: Start in VS Code’s MCP controls; inspect output and trust prompts.
Config file · Workspace: .vscode/mcp.json
{
"servers": {
"magic-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@21st-dev/magic@latest"
],
"env": {
"API_KEY": "<your 21st.dev Magic API key>"
}
}
}
}Troubleshooting 21st.dev Magic AI Agent in VS Code
- Make npx @21st-dev/magic@latest (Node.js/npm) available in the workspace, container, or remote environment hosting 21st.dev Magic AI Agent. Start through VS Code's MCP controls; inspect output and trust prompts.
- For 21st.dev Magic AI Agent, keep API_KEY out of version control; VS Code documents input variables and secret handling.
- 21st.dev Magic AI Agent uses stdio here: VS Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Requires an API key and a supported development environment.
- Known limitation: The README labels the product beta and some enhancement features as coming soon.
- Known limitation: Generation limits are mentioned without exact allowances.
- General VS Code troubleshooting lives in the /clients/vscode guide.
21st.dev Magic AI Agent — details. VS Code guide