Mastra MCP server and tooling that provides real-time access to shadcn-svelte component documentation and developer utilities using web scraping. Now deployed and available at https://shadcn-svelte.mastra.cloud!
[!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.
Add the Shadcn Svelte Docs MCP server to your AI code editor to get instant access to shadcn-svelte component documentation and utilities.
{
"shadcn-svelte": {
"type": "sse",
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
}
}
Or use the HTTP endpoint:
{
"shadcn-svelte": {
"type": "http",
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
}
}
~/.codeium/windsurf/mcp_config.json in your editor{
"mcpServers": {
"shadcn-svelte": {
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse",
"transport": "sse"
}
}
}
.vscode/mcp.json in your workspace root{
"servers": {
"shadcn-svelte": {
"type": "sse",
"url": "https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
}
}
}
mcp.json and click "start"Tip: You can also add MCP servers from the Command Palette in VS Code — press Ctrl+Shift+P (or Cmd+Shift+P on macOS), run "MCP: Add server" (or "mcp add server"), then choose:
npx command starting a stdio MCP server)https://.../mcp or .../sse URL)This Command Palette flow is the quickest way to add a server without editing files manually.
Zed uses a settings.json file for MCP server configuration:
~/.config/zed/settings.json)context_servers:{
"context_servers": {
"shadcn-svelte": {
"source": "custom",
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse"
],
"env": {}
}
}
}
Alternatively, for HTTP transport:
{
"context_servers": {
"shadcn-svelte": {
"source": "custom",
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/mcp"
],
"env": {}
}
}
}
settings.json manually — open Zed's Agent/AI settings and use the "Add server" form to paste the HTTP/SSE URL or configure a local command.Install using the terminal:
claude mcp add shadcn-svelte --url https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse
Register from the terminal:
codex mcp add shadcn-svelte --url https://shadcn-svelte.mastra.cloud/api/mcp/shadcn/sse
Then run codex mcp list to confirm it's enabled.
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 agents.src/services/ - Web scraping services for real-time documentation fetching.src/mastra/tools/ - Tools that expose component discovery, fetching and utilities.package.json - npm scripts and dependencies.# npm
npm install
# or bun
bun install
# or pnpm
pnpm install
# Copy the example environment file
cp .env.example .env
# Add your Firecrawl API configuration
FIRECRAWL_API_URL=your_firecrawl_api_url
FIRECRAWL_API_KEY=your_firecrawl_api_key
# Starts Mastra in dev mode; this repo's smoke-test expects a short run to detect runtime errors
npm run dev
npm run mcp:stdio
Or start the dev HTTP server:
npm run mcp: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 mcp:stdio - Run the MCP server in stdio mode (runs npx tsx src/index.ts).npm run mcp:dev - Run the MCP dev server (runs npx tsx src/dev-server.ts).npm run test:firecrawl - Run the Firecrawl test harness (npx tsx src/test-firecrawl.ts)npm run test:simple - Run the simple tools test (npx tsx src/test-tools-simple.ts)npm run test:mcp - Run the MCP server test (npx tsx src/test-mcp.ts)npm test - Placeholder test script (prints an error message by default)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 three 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.
src/mastra/tools and should use zod for input validation.src/services/ and use Firecrawl API for real-time documentation fetching.createTool with proper input/output schemas.package.json engines).src/mastra/tools/shadcn-svelte-get.ts and shadcn-svelte-list.ts.npm run dev to surface runtime integration issues early.This 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_ARCHITECTURE.md for detailed explanation of MCP server vs clientsrc/services/ for real-time documentation fetching implementation.github/copilot-instructions.md