mcpField
M
mcp-svelte-docs

mcp-svelte-docs

Local
github.com/spences10Memory & Knowledge123Updated 48w ago

About mcp-svelte-docs

mcp-svelte-docs is an MCP server for searching Svelte 5 and SvelteKit documentation, with definitions extracted from TypeScript declarations and built-in caching. It is aimed at developers who need precise syntax and parameter details.

Key features

  1. 01Single svelte_definition tool
  2. 0228+ covered definitions
  3. 03Syntax, quick and full formats
  4. 04Fuzzy matching for identifier typos
  5. 05Svelte 4 to 5 migration guidance

Use cases

  1. 01Letting a coding agent look up exact Svelte 5 rune signatures
  2. 02Checking newer features such as remote functions and await expressions
  3. 03Following Svelte 4 to 5 migration patterns

MCP support

The server exposes a single svelte_definition tool that MCP clients can call to look up Svelte documentation.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"svelte-docs": {
"command": "npx",
"args": [
"-y",
"mcp-svelte-docs"
]
}
}
}
Run commandnpx -y mcp-svelte-docs

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmmcp-svelte-docs

Tools

1

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
identifierstringYesSvelte 5 identifier to look up. Examples: "$state", "$derived", "$props", "$effect", "snippets", "onclick", "component-events". Use exact identifiers for best results.
formatenumNoResponse format: "syntax" returns just TypeScript signature (~50 words), "quick" returns definition + minimal example (~200 words), "full" returns complete definition with examples (~500-1000 words).syntax | quick | full

Details

From the project README

mcp-svelte-docs

A Model Context Protocol (MCP) server providing authoritative Svelte 5 and SvelteKit definitions extracted directly from TypeScript declarations. Get precise syntax, parameters, and examples for all Svelte 5 concepts through a single, unified interface.

Architecture

Definition-First Approach: Rather than multiple specialized tools, this server provides one powerful svelte_definition tool that accesses 28+ comprehensive definitions covering:

  • All Svelte 5 runes ($state, $derived, $props, $effect variants)
  • Modern features (snippets, await expressions, remote functions)
  • Event handling (DOM events, custom events, component communication)
  • Migration guidance (Svelte 4 to 5 patterns and best practices)
  • TypeScript interfaces (Snippet, Snapshot types)
  • Advanced patterns (global state, common mistakes, lifecycle equivalents)

Available Tool

svelte_definition

Single, powerful tool for all Svelte 5 and SvelteKit concepts:

svelte_definition(identifier: string, format?: "syntax"|"quick"|"full")

Examples:

  • svelte_definition("$state") - Complete $state documentation
  • svelte_definition("snippets", "quick") - Snippet overview with example
  • svelte_definition("onclick", "syntax") - Just the TypeScript signature
  • svelte_definition("migration-patterns") - Svelte 4 → 5 migration guide

Response Formats:

  • "syntax" - TypeScript signature only (~50 words)
  • "quick" - Definition + minimal example (~200 words)
  • "full" - Complete documentation with examples (~500-1000 words, default)
Available Identifiers (28+)

Core Runes: $state, $state.raw, $state.snapshot, $derived, $derived.by, $props, $bindable, $effect, $effect.pre, $effect.root, $effect.pending, $effect.tracking

Development Tools: $inspect, $host

Features & Patterns: snippets, onclick, component-events, migration-patterns, await-expressions, remote-functions, global-state, common-mistakes, lifecycle-equivalents

Event Handling: custom-events, event-delegation, event-modifiers

TypeScript Interfaces: snippet, snapshot

Key Features

🎯 Authoritative & TypeScript-First
  • Direct from Source: Definitions extracted from official Svelte 5 TypeScript declarations
  • Always Current: Reflects the actual API, not outdated tutorials
  • Type-Safe: Includes precise parameter types, return values, and constraints
⚡ Single Interface, Complete Coverage
  • One Tool: svelte_definition replaces 16+ specialized tools
  • 28+ Definitions: Every Svelte 5 rune, feature, and pattern covered
  • Consistent Responses: Same interface whether you need $state or remote-functions
🚀 Modern Svelte 5 & SvelteKit Support
  • Await Expressions: Async operations directly in templates (await-expressions)
  • Remote Functions: Type-safe client-server communication (remote-functions)
  • All Runes: Complete $effect family, $state variants, $derived.by, $bindable
  • Advanced Patterns: Event handling, global state, component communication
📚 Smart Error Recovery
  • Fuzzy Matching: Suggests correct identifiers for typos
  • Related Concepts: Points to similar definitions when searches fail
  • Migration Help: Converts Svelte 4 patterns to Svelte 5 equivalents

Config

Claude Desktop (via WSL)

{
	"mcpServers": {
		"mcp-svelte-docs": {
			"command": "wsl.exe",
			"args": ["bash", "-c", "npx -y mcp-svelte-docs"]
		}
	}
}

Cursor

Install MCP Server

Windsurf (via WSL)

{
	"mcpServers": {
		"mcp-svelte-docs": {
			"command": "wsl.exe",
			"args": ["bash", "-c", "npx -y mcp-svelte-docs"]
		}
	}
}

Windows (without WSL)

{
	"mcpServers": {
		"mcp-svelte-docs": {
			"command": "npx",
			"args": ["-y", "mcp-svelte-docs"]
		}
	}
}

macOS / Linux

{
	"mcpServers": {
		"mcp-svelte-docs": {
			"command": "npx",
			"args": ["-y", "mcp-svelte-docs"]
		}
	}
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Acknowledgments

Built on:

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.