Mastra MCP server and tooling that provides real-time access to shadcn-svelte component documentation and developer utilities using web scraping.
Choose the base host that fits your workflow — both expose the same toolset, but their runtime characteristics differ:
| Host | Base URL | Highlights |
|---|---|---|
| Mastra Cloud | https://shadcn-svelte.mastra.cloud | Primary choice - Zero cold start, maximum responsiveness, and consistently reliable performance. Tool discovery issue has been fixed. |
| Railway | https://shadcn-svelte-mcp.up.railway.app | Backup option with consistent tool visibility. Expect a split-second cold start; the very first request might fail and then succeed on retry. Alternate base host: https://shadcn-svelte-mcp-api.up.railway.app. |
/api/mcp/shadcn/sse for the SSE transport (best for editors that keep long-lived connections)./api/mcp/shadcn/mcp for the HTTP transport (handy for CLIs and quick one-off calls).https://shadcn-svelte-mcp-api.up.railway.app and append the same /api/mcp/shadcn/{sse|mcp} path.[!NOTE] This project follows our Code of Conduct and welcomes contributions! See our Contributing Guidelines for details.
This repository contains a Mastra-based MCP server that provides real-time access to shadcn-svelte component documentation using web scraping. Use it in your AI-powered code editor to get instant access to the latest shadcn-svelte component information directly from the official website.
Mastra Cloud is the recommended primary deployment for all editors. It offers zero cold start and maximum responsiveness. SSE works best for editors that keep a persistent connection, while HTTP is handy for one-off requests and scripts. VS Code users can open the Command Palette (Cmd/Ctrl+Shift+P) and run MCP: Add server to paste either URL.
Cmd/Ctrl + ,).Mastra Cloud — SSE example:
{
"shadcn-svelte": {
"type": "sse",
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
}
}
Mastra Cloud — HTTP example:
{
"shadcn-svelte": {
"type": "http",
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
}
}
You can swap in the Railway host if you prefer guaranteed tool visibility:
- "url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
+ "url": "https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/sse"
~/.codeium/windsurf/mcp_config.json.{
"mcpServers": {
"shadcn-svelte": {
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse",
"transport": "sse"
}
}
}
mcp.json in Agent mode and click "start".Use the HTTP variant if you need it:
{
"servers": {
"shadcn-svelte": {
"type": "http",
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
}
}
}
You can swap in the Railway host if you prefer guaranteed tool visibility:
- "url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
+ "url": "https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/sse"
Cmd/Ctrl + ,).~/.config/zed/settings.json and add an entry under context_servers:{
"context_servers": {
"shadcn-svelte": {
"source": "custom",
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
],
"env": {}
}
}
}
{
"context_servers": {
"shadcn-svelte": {
"source": "custom",
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/mcp"
],
"env": {}
}
}
}
You can swap in the Railway host if you prefer guaranteed tool visibility:
- "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
+ "https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/sse"
The same base URLs work across CLIs. Mastra Cloud is the recommended primary deployment for the fastest responses with zero cold start. Railway serves as a reliable backup option.
Global settings (~/.claude/settings.json):
{
"mcpServers": {
"shadcn-svelte": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
]
}
}
}
Project-scoped override (.mcp.json):
{
"mcpServers": {
"shadcn-svelte": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
]
}
}
}
Enable project servers with:
{
"enableAllProjectMcpServers": true
}
Command palette alternative:
claude mcp add shadcn-svelte --url https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp
claude mcp add shadcn-svelte --url https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/mcp
Use /permissions inside Claude Code to grant tool access if prompted.
You can swap in the Railway host if you prefer guaranteed tool visibility:
- "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
+ "https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/mcp"
Register either endpoint:
codex mcp add shadcn-svelte --url https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse
codex mcp list
Swap in the Railway host if you prefer guaranteed tool visibility:
- --url https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse
+ --url https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/sse
Create or edit ~/.gemini/settings.json:
mkdir -p ~/.gemini
nano ~/.gemini/settings.json
Add a configuration. Mastra Cloud example:
{
"mcpServers": {
"shadcn-svelte": {
"httpUrl": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
}
}
}
Prefer the npx mcp-remote command variant if your CLI version expects a command:
{
"mcpServers": {
"shadcn-svelte": {
"command": "npx",
"args": [
"mcp-remote",
"https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
]
}
}
}
Mastra Cloud is recommended for zero cold start and maximum responsiveness. Restart the CLI to apply changes. Railway serves as a backup option.
You can swap in the Railway host if you prefer guaranteed tool visibility:
- "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
+ "https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/mcp"
claude mcp listcodex mcp listnpx mcp-remote https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcpcurl -I https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcpcurl -N https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sseIf the Railway check fails on the first attempt, wait a moment and retry; the cold start clears almost immediately. Claude Code may prompt for tool permissions — use /permissions or set allowedTools in ~/.claude.json. Editors that maintain long-lived connections should use the SSE URL; quick scripts can stick with HTTP.
The tool discovery issue has been fixed for Mastra Cloud (https://shadcn-svelte.mastra.cloud), which can now be used reliably as the primary deployment. Use the Railway host below only as a backup when Mastra Cloud is experiencing downtime. The toolset is identical; only the host name differs. Expect a split-second cold start for the Railway deployment.
{
"shadcn-svelte-backup": {
"url": "https://shadcn-svelte-mcp.up.railway.app/api/mcp/shadcn/sse",
"type": "http"
}
}
Use this backup when:
https://shadcn-svelte.mastra.cloud) is experiencing downtime.Once installed, your AI assistant will have access to these tools:
After installing the MCP server in your editor, you can ask your AI assistant:
Want to run the MCP server locally or contribute to the project?
src/ - Mastra bootstrap, MCP servers, tools, and agentssrc/services/ - Web scraping services for real-time documentation fetchingsrc/mastra/tools/ - Tools that expose component discovery, fetching and utilitiessrc/mastra/agents/ - Specialized AI agent for shadcn-svelte assistancescripts/ - Version management and automation scripts# npm
npm install
# or bun
bun install
# or pnpm
pnpm install
# Starts Mastra in dev mode; this repo's smoke-test expects a short run to detect runtime errors
npm run dev
npm run dev - Start Mastra in development mode (recommended smoke-test).npm run build - Build the Mastra project for production.npm run start - Start the built Mastra server.npm run check-versions - Check if package.json and mcp-server.ts versions match (fails if mismatched).npm run sync-versions-auto - Check versions and auto-sync if mismatched (package.json is source of truth).npm run sync-versions - Sync versions from latest git tag to both files.This project exposes a production-ready MCP Server that makes shadcn-svelte documentation and tools available to AI code editors.
What this means:
src/mastra/mcp-server.ts) - Exposes four shadcn-svelte tools to external MCP clients (Cursor, Windsurf, VS Code, etc.)The server is deployed at https://shadcn-svelte.mastra.cloud and exposes tools via HTTP and SSE transports.
For a detailed explanation of MCP concepts, see MCP_ARCHITECTURE.md.
.md endpoint fetching for componentssrc/mastra/tools and should use zod for input validationsrc/services/ and use Crawlee (with Playwright) for real-time documentation fetching from JavaScript-heavy pagescreateTool with proper input/output schemasThe project includes a comprehensive test suite covering:
package.json engines)src/mastra/tools/shadcn-svelte-get.ts and shadcn-svelte-list.tsnpm run dev to surface runtime integration issues earlyThis project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions! Please read our Contributing Guidelines and Code of Conduct before getting started.
For more details:
MCP_Prompts_and_Course_System.md for comprehensive documentation on the MCP prompt system and Mastra course integrationMCP_ARCHITECTURE.md for detailed explanation of MCP server vs clientsrc/services/ for Crawlee-based real-time documentation fetching implementation.github/copilot-instructions.md