Skip to main content
Glama
StudentOfJS

Svelte 5 MCP Server

by StudentOfJS

Svelte 5 MCP Server

A specialized Model Context Protocol (MCP) server for Svelte 5 frontend development, providing curated knowledge, code examples, and intelligent assistance for modern Svelte development with runes, snippets, and enhanced reactivity.

Features

šŸ” Searchable Resources

  • Knowledge Base: Curated Q&A covering Svelte 5 concepts, runes, and best practices

  • Code Examples: Searchable collection of Svelte 5 patterns and component implementations

šŸ› ļø Intelligent Tools

  • search_knowledge - Find explanations and concepts

  • search_examples - Discover code patterns and implementations

  • generate_with_context - Create components using curated patterns

  • audit_with_rules - Review code against Svelte 5 best practices

  • explain_concept - Get detailed explanations with examples

šŸ“ Smart Prompts

  • generate-component - Generate modern Svelte 5 components

  • audit-svelte5-code - Audit code for optimization opportunities

  • explain-concept - Detailed concept explanations

  • search-patterns - Find specific implementation patterns

Related MCP server: SvelteLS.MCP

Installation

# Clone and setup
git clone <repository-url>
cd svelte5-mcp-server

# Install dependencies
npm install

# Build the server
npm run build

# Start the server
npm start

Project Structure

svelte5-mcp-server/
ā”œā”€ā”€ src/
│   └── index.ts          # Main MCP server implementation
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ svelte_5_knowledge.json    # Curated Q&A knowledge base
│   └── svelte_5_patterns.json     # Code examples and patterns
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
ā”œā”€ā”€ example system prompt         # Svelte 5 specific system prompt (quite strict, adjust for your own preferences)
└── README.md

Usage with Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "svelte5": {
      "command": "node",
      "args": ["/path/to/svelte5-mcp-server/dist/index.js"],
      "env": {}
    }
  }
}

Usage Examples

šŸ” Search Knowledge

Tool: search_knowledge
Query: "runes reactivity"

Returns detailed explanations about Svelte 5 runes and the new reactivity system.

šŸ“š Find Code Examples

Tool: search_examples  
Query: "counter component $state"

Returns working Svelte 5 counter implementations using the $state rune.

šŸ—ļø Generate Components

Tool: generate_with_context
Description: "A todo list with add/remove functionality"
Features: ["$state", "snippets", "accessibility"]

Generates a complete todo component using modern Svelte 5 patterns with relevant examples from the knowledge base.

šŸ” Audit Code

Tool: audit_with_rules
Code: "<script>let count = 0;</script><button on:click={() => count++}>{count}</button>"
Focus: "best-practices"

Analyzes code and suggests Svelte 5 improvements (e.g., using $state and modern event handling).

Key Svelte 5 Concepts Covered

šŸŽÆ Runes System

  • $state - Reactive state management

  • $derived - Computed values and derived state

  • $effect - Side effects and lifecycle

  • $props - Component properties

  • $bindable - Two-way data binding

  • $inspect - Development debugging

🧩 Modern Patterns

  • Snippets - Reusable template blocks ({#snippet}, {@render})

  • Enhanced Reactivity - Fine-grained updates

  • Event Handling - Modern onclick vs legacy on:click

  • TypeScript Integration - Better type inference

  • Accessibility - Built-in a11y considerations

šŸ“ˆ Migration Support

  • Svelte 4 → 5 migration patterns

  • Legacy reactive statements ($:) → runes

  • Slots → snippets conversion

  • Event dispatcher → callback props

Data Format

Knowledge Base (svelte_5_knowledge.json)

{
  "question": "How do you manage reactive state in Svelte 5?",
  "answer": "In Svelte 5, reactive state is managed using the $state rune..."
}

Examples (svelte_5_patterns.json)

{
  "instruction": "Create a Svelte 5 component demonstrating $state",
  "input": "The rune allows you to create reactive state...",
  "output": "<script>\nlet count = $state(0);\n</script>\n\n<button onclick={() => count++}>\n  clicks: {count}\n</button>"
}

Configuration

The server uses a better-sqlite3 database and FTS5 queries for search

  • Full-Text Search: Utilizes SQLite's FTS5 extension for powerful and efficient searching across the knowledge base and code examples.

  • Tokenization: Employs the unicode61 tokenizer with a comprehensive set of separators for robust indexing of terms.

  • Synonym Expansion: Enhances search recall by automatically expanding query terms with predefined Svelte 5-specific synonyms (e.g., '$state' also matches 'reactive state').

  • Result Highlighting: Search results include highlighted matches within relevant fields (e.g., question, answer, instruction) using FTS5's highlight() function.

  • Relevance Ranking: Results are ordered by relevance based on FTS5's internal ranking algorithm.

  • Advanced Boosting: Offers capabilities for custom scoring and boosting to fine-tune search results, such as prioritizing matches in question fields or code content.

Development

Building

npm run build     # Compile TypeScript
npm run dev       # Watch mode for development

Data Processing

node process-attached-data.js    # Process curated knowledge
node setup-data.js              # Create sample data

Testing

The server provides comprehensive logging and error handling:

# Test the server
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | npm start

Contributing

Adding Knowledge

  1. Add entries to data/svelte_5_knowledge.json

  2. Format: {"question": "...", "answer": "..."}

  3. Focus on Svelte 5 specific features and best practices

Adding Examples

  1. Add entries to data/svelte_5_patterns.json

  2. Format: {"instruction": "...", "input": "...", "output": "..."}

  3. Include complete, working Svelte 5 code examples

Search Optimization

  • Use descriptive, searchable keywords in questions and instructions

  • Include alternative phrasings for common concepts

  • Tag examples with relevant feature names ($state, snippets, etc.)

Advanced Usage

Custom Search Queries

The search tools support sophisticated queries:

// Search for state management patterns
search_examples("$state reactive updates")

// Find accessibility guidance
search_knowledge("a11y accessibility screen reader")

// Discover migration patterns
search_examples("svelte 4 migration runes")

Prompt Chaining

Use prompts in sequence for complex workflows:

  1. search-patterns - Find relevant patterns

  2. generate-component - Create based on patterns

  3. audit-svelte5-code - Review and optimize

Integration Tips

  • Claude Desktop: Best for interactive development

  • API Integration: Use programmatically for code generation

  • CI/CD: Audit code in automated workflows

  • Documentation: Generate examples for style guides

Troubleshooting

Common Issues

"No results found"

  • Check search terms are relevant to Svelte 5

  • Try broader queries first, then narrow down

  • Ensure data files are properly formatted json

"Tool not found"

  • Verify server is built (npm run build)

  • Check MCP client configuration

  • Review server logs for startup errors

"Invalid data format"

  • Validate JSON files

  • Check for trailing commas or syntax errors

Debugging

# Enable debug logging
DEBUG=* npm start

License

MIT License - see LICENSE file for details.

Acknowledgments

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    A comprehensive MCP server that provides AI assistants with tools for file system management, Git integration, and shell command execution. It features specialized code utilities for analysis, formatting, and linting to enhance development workflows within Claude Desktop.
    28
    7
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    An MCP server that wraps the Svelte Language Server to provide IDE-like tools for Claude Code and other MCP clients. It enables advanced Svelte development features including symbol navigation, diagnostics, refactoring, and component-specific analysis.
    21
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    MCP server that provides tools, resources, and prompts to help LLMs build Svelte UI components for Q-SYS systems, including discovering components and controls from a Q-SYS Core.
    9
    4
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

  • Official MCP server for Lovable, the AI-powered full-stack app builder.

  • MCP server for AI agent profiles and smart notes. 60+ coding prompt packs with expert personas.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/StudentOfJS/svelte5-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server