mcp-svelte-docs
🔍 MCP server that lets you search and access Svelte documentation with built-in caching
GitHub Stars
109
User Rating
Not Rated
Favorites
0
Views
20
Forks
8
Issues
3
README
mcp-svelte-docs
A Model Context Protocol (MCP) server that provides a comprehensive
reference guide for Svelte 5 and SvelteKit, helping LLMs provide
accurate guidance when users are working with Svelte. It includes
detailed documentation for:
- Svelte 5 core features (runes, components, events)
- Modern async patterns (await expressions, loading states)
- SvelteKit remote functions (type-safe client-server
communication) - Migration patterns from Svelte 4 to Svelte 5
- Common mistakes and best practices
- Advanced patterns for state management and data flow
Available Tools
This MCP server provides 16 specialized tools for Svelte 5 and
SvelteKit development:
Core Svelte 5 Runes
svelte5_state- Documentation for$staterune (reactive state)svelte5_derived- Documentation for$derivedrune (computed
values)svelte5_props- Documentation for$propsrune (component
properties)svelte5_effect- Documentation for$effectrune (side effects)
Svelte 5 Features
svelte5_snippets- Documentation for snippets (replacement for
slots)svelte5_events- Event handling patterns in Svelte 5svelte5_component_events- Component event patterns and best
practicessvelte5_global_state- Global state management patterns
Modern Async Features ✨ NEW
svelte5_await_expressions- Await expressions for async operations
(experimental)sveltekit_remote_functions- Remote functions for type-safe
client-server communication (experimental)
Migration & Guidance
svelte5_migration- Migration patterns from Svelte 4 to Svelte 5svelte5_mistakes- Common mistakes and how to avoid themsvelte5_overview- General overview of Svelte 5 featuressvelte5_runes_overview- Comprehensive overview of all runes
Tool Parameters
All tools support an optional includeExamples parameter:
includeExamples: true(default) - Include code examples and
demonstrationsincludeExamples: false- Return documentation without code
examples for concise reference
Key Features
🚀 Experimental Async Support
- Await Expressions: Use
awaitdirectly in components,$derived, and markup - Boundaries: Error handling and loading states with
<svelte:boundary> - Synchronized Updates: Consistent UI updates during async
operations - Performance Patterns: Avoid waterfalls, optimize concurrent
requests
⚡ Remote Functions
- Type-safe Communication: Full TypeScript support between client
and server - Four Function Types: Query (read), Form (submit), Command
(execute), Prerender (static) - Optimistic Updates: Immediate UI feedback with server
synchronization - Progressive Enhancement: Works with and without JavaScript
📚 Comprehensive Documentation
- Real-world Examples: Patterns from core maintainer projects
- Migration Guidance: Step-by-step Svelte 4 to 5 migration
- Error Prevention: Common mistakes and corrections
- Best Practices: Production-ready patterns and recommendations
Config
Claude Desktop (via WSL)
{
"mcpServers": {
"mcp-svelte-docs": {
"command": "wsl.exe",
"args": ["bash", "-c", "npx -y mcp-svelte-docs"]
}
}
}
Cursor
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: