shadcn-ui-mcp-server
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 30efb8a0bf8d
- Files read
- 102
This MCP server gives AI coding assistants access to shadcn/ui component source code, demos, blocks, and TweakCN color themes across React, Svelte, Vue, and React Native. Its biggest risk is that its theme tools download an unpinned file from a third-party GitHub repository at runtime and execute it as live JavaScript on your computer, while optional GitHub tokens and HTTP mode can expose private GitHub data or leave an unauthenticated server open to websites and your local network.
What it can reach
- Network
- Makes outbound HTTPS requests to api.github.com and raw.githubusercontent.com to fetch component files, blocks, metadata, and third-party TweakCN theme presets; when started in HTTP or dual mode, listens on port 7423 (bound to 0.0.0.0 by default).
- Files
- Reads local package and theme metadata files, reads a fallback tweakcn/theme-presets.ts file from the current working directory if the network fetch fails, and writes CSS theme blocks and backup files to the project's global stylesheet (such as src/styles/globals.css) when apply_theme is called.
- Secrets
- Reads the optional GITHUB_PERSONAL_ACCESS_TOKEN environment variable (or --github-api-key argument) and sends it as a Bearer header in requests to GitHub.
Findings
-
HighTheme tools download and execute unpinned remote code via new Function()
src/tools/tweakcn/fetch-presets.ts:92
Whenever list_themes, get_theme, or apply_theme is called, the server downloads a TypeScript file from the unpinned main branch of a third-party GitHub repository (jnsahaj/tweakcn) or falls back to reading tweakcn/theme-presets.ts from the current working directory. Instead of parsing the data safely, it passes the extracted text directly into new Function(), executing it as live JavaScript in the Node.js process. If that third-party repository is compromised, or if the network request fails while you are working inside an untrusted project folder containing tweakcn/theme-presets.ts, arbitrary code can run on your machine and read your environment variables and files, even from a read-only list_themes call.
Fix: Replace new Function() with a safe data format (such as bundled JSON or a strict AST/JSON parser that never evaluates code), pin any remote preset source to an immutable commit hash, and remove the fallback that reads from process.cwd().
-
HighGitHub API path traversal and private repository access in get_directory_structure
The get_directory_structure tool is described as browsing the public shadcn-ui v4 repository and is marked read-only, so coding agents often run it without asking. However, it accepts arbitrary owner, repo, path, and branch arguments and interpolates them without URL encoding into requests authenticated with your GITHUB_PERSONAL_ACCESS_TOKEN (a pattern repeated in axios-svelte.ts, axios-vue.ts, axios-react-native.ts, and getBlockCode). If you supply a GitHub token that has access to private repositories, a prompt-injected agent can list private repos, obtain temporary signed raw download URLs, or pass ../ segments and a # fragment in path to hit any GET endpoint on api.github.com (such as git/blobs) and read full private file contents leaked through the JSON error message.
Fix: Lock repository requests to the allowlisted public framework repositories, validate and encode each path segment with encodeURIComponent while rejecting '..' and '#' characters, and never echo raw upstream API responses in error messages.
-
MediumHTTP mode binds to 0.0.0.0 without authentication and disables Origin and DNS-rebinding checks
When started with --mode http, --mode dual, or Docker, the server defaults to binding on 0.0.0.0:7423 with no password or token check and configures CORS to reflect any requesting Origin (origin: true, credentials: true). Because the server only enables Host and Origin validation when the configured host string is explicitly localhost, 127.0.0.1, or ::1, running the README's --mode http command leaves those protections turned off. Anyone on your local network, as well as any malicious website you visit in your browser on the same machine, can send requests directly to http://localhost:7423/mcp to overwrite CSS files via apply_theme or query GitHub using your configured token.
Fix: Default the HTTP bind address to 127.0.0.1 instead of 0.0.0.0, restrict CORS origins by default instead of reflecting all origins, enforce Origin/Host validation unless explicitly disabled, and require an authentication token for non-loopback deployments.
-
LowDesktop bundle and plugin configs run unpinned npm package versions at startup
Both manifest.json (used for the one-click Claude Desktop .mcpb extension, which excludes built code and fetches from npm on launch) and .mcp.json (used for the Codex plugin) run npx -y @jpisnice/shadcn-ui-mcp-server without pinning a specific version while forwarding GITHUB_PERSONAL_ACCESS_TOKEN. Every time the editor starts the server, it automatically downloads and executes whatever version is currently tagged latest on npm without confirmation.
Fix: Pin the exact package version in manifest.json and .mcp.json (for example, @jpisnice/shadcn-ui-mcp-server@3.0.0) or bundle the compiled build directory directly inside the .mcpb archive.
