magic-mcp
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 6b5299e8a83c
- Files read
- 19
This project connects AI coding agents to the 21st.dev remote MCP service, either directly over HTTPS as an agent plugin with a UI skill or through a thin local stdio compatibility proxy, to search, retrieve, and generate React and Tailwind UI components. The biggest risk is that its bundled UI skill tells the coding agent to install third-party marketplace components the way the fetched result instructs, which could lead the agent to install untrusted packages or follow prompt-injected commands from a malicious listing.
What it can reach
- Network
- Sends MCP requests over HTTPS to https://21st.dev/api/mcp (or a custom URL if MCP_URL_21ST is set for the stdio proxy) to search catalogs, fetch component code, and run hosted UI generation.
- Secrets
- Reads the 21st.dev API key from API_KEY_21ST, TWENTY_FIRST_API_KEY, generic API_KEY, or command-line arguments and sends it to the 21st.dev MCP endpoint in the x-api-key header.
- Other
- Includes an agent skill (21st-ui) that directs the host coding agent to write retrieved component code into the project, run registry install commands, and open preview URLs using the agent's own tools.
Findings
-
MediumSkill tells the agent to follow install instructions from marketplace components
21st.dev is a marketplace where third-party authors publish UI components. When a user asks for a UI element, this skill instructs the coding agent to fetch a matching component and install it the way the result instructs, including running registry CLI commands or writing returned files, without telling the agent to verify dependencies, external URLs, or shell commands first. A malicious or compromised marketplace listing could embed harmful package dependencies, untrusted registry URLs, or prompt-injected commands in its result that the agent attempts to execute.
Fix: Update SKILL.md to treat marketplace component results as untrusted input: write source files only inside the project's UI folder, verify registry URLs and npm packages before installing, and ask the user before running shell install commands.
-
LowCompatibility proxy falls back to generic API_KEY environment variable
When the stdio compatibility proxy runs without TWENTY_FIRST_API_KEY or API_KEY_21ST configured, it silently falls back to reading the generic API_KEY environment variable and sends that value to https://21st.dev/api/mcp in the x-api-key header. If a user has a generic API_KEY exported in their shell environment for an unrelated service and has not set their 21st key yet, that secret is unexpectedly sent to 21st.dev on the first MCP message.
Fix: Remove the undocumented fallback to process.env.API_KEY and read only namespaced environment variables such as API_KEY_21ST and TWENTY_FIRST_API_KEY.
-
LowAPI key passed via command-line arguments is visible to local processes
For legacy compatibility, the stdio proxy accepts the API key as a command-line argument and suggests passing API_KEY="..." first when no key is found. Because an MCP stdio process stays running for the whole coding session, supplying a secret in command-line arguments exposes it in the operating system process list to any other user or unprivileged process on the computer.
Fix: Update the startup message and documentation to recommend only environment variables (API_KEY_21ST) or HTTP config headers, and warn when a key is passed on the command line.
