An MCP server that exposes shadcn-svelte documentation to MCP clients such as Codex. It indexes local documentation files, serves them as MCP resources, and provides tools for searching components, retrieving installation steps, and extracting usage examples.
shadcn-svelte:// URIs.docs/.bun install
bun run build
bun start
The server runs on stdio and is intended to be launched by an MCP client.
On Linux and macOS, if your MCP client expects the built file to be executable, run:
chmod 755 build/index.js
The project build script does not run chmod so it remains Windows-compatible.
Example MCP configuration:
{
"mcpServers": {
"shadcn-svelte-docs": {
"command": "bun",
"args": ["D:/Files/Add_Path/"]
}
}
}
Use the absolute path for your local checkout. Run bun run build before starting the MCP server so build/index.js exists.
search_all_docsSearch across all cached documentation.
Input:
{
"query": "dialog"
}
get_component_docsReturn the full markdown documentation for a component.
Input:
{
"component_name": "alert-dialog"
}
get_resource_docsReturn documentation for a specific MCP resource URI.
Input:
{
"uri": "shadcn-svelte://component/button"
}
get_installation_infoExtract the installation section from a component document.
Input:
{
"component_name": "button"
}
get_usage_examplesExtract code blocks from a component document. Results are capped to keep responses manageable.
Input:
{
"component_name": "form"
}
get_exampleFind the best matching usage example by topic or component name.
Input:
{
"topic": "form validation"
}
list_all_componentsList all available component resources with descriptions.
Input:
{}
get_diagnosticsReturn cache status, resource counts, memory usage, and runtime details.
Input:
{
"include_samples": true
}
update_docsReload the documentation cache. If docs/ is a Git checkout, the server will attempt a git pull before reloading.
Input:
{}
Documentation files are exposed through resource URIs using the shadcn-svelte:// protocol.
Examples:
shadcn-svelte://component/buttonshadcn-svelte://component/alert-dialogshadcn-svelte://guide/readmeshadcn-svelte://example/forms/basicshadcn-svelte://pattern/data-tableThe server indexes files under docs/.
docs/
components/
accordion.md
alert.md
alert-dialog.md
button.md
card.md
dialog.md
Component markdown files should use kebab-case names, such as alert-dialog.md. The component resource URI becomes shadcn-svelte://component/alert-dialog.
The cache currently supports these file types:
.md.svelte.ts.js.json.css.txtbun run build
bun run test
bun run test:watch
bun run test:ui
bun run test:coverage
The main implementation is in src/index.ts. Tests are in src/index.test.ts.
.
├── docs/
│ └── components/
├── src/
│ ├── index.ts
│ └── index.test.ts
├── build/
├── package.json
├── tsconfig.json
└── vitest.config.ts
Apache-2.0