\"\nfocus: \"best-practices\"\n```\n\nanalyzes code and suggests svelte 5 improvements (e.g., using `$state` and modern event handling).\n\n## key svelte 5 concepts covered\n\n### \ud83c\udfaf **runes system**\n- `$state` - reactive state management\n- `$derived` - computed values and derived state\n- `$effect` - side effects and lifecycle\n- `$props` - component properties\n- `$bindable` - two-way data binding\n- `$inspect` - development debugging\n\n### \ud83e\udde9 **modern patterns**\n- **snippets** - reusable template blocks (`{#snippet}`, `{@render}`)\n- **enhanced reactivity** - fine-grained updates\n- **event handling** - modern `onclick` vs legacy `on:click`\n- **typescript integration** - better type inference\n- **accessibility** - built-in a11y considerations\n\n### \ud83d\udcc8 **migration support**\n- svelte 4 \u2192 5 migration patterns\n- legacy reactive statements (`$:`) \u2192 runes\n- slots \u2192 snippets conversion\n- event dispatcher \u2192 callback props\n\n## data format\n\n### knowledge base (`svelte_5_knowledge.json`)\n```json\n{\n \"question\": \"how do you manage reactive state in svelte 5?\",\n \"answer\": \"in svelte 5, reactive state is managed using the $state rune...\"\n}\n```\n\n### examples (`svelte_5_patterns.json`)\n```json\n{\n \"instruction\": \"create a svelte 5 component demonstrating $state\",\n \"input\": \"the rune allows you to create reactive state...\",\n \"output\": \"\\n\\n\"\n}\n```\n\n## configuration\n\nthe server uses a better-sqlite3 database and fts5 queries for search\n\n- **full-text search**: utilizes sqlite's fts5 extension for powerful and efficient searching across the knowledge base and code examples.\n- **tokenization**: employs the `unicode61` tokenizer with a comprehensive set of separators for robust indexing of terms.\n- **synonym expansion**: enhances search recall by automatically expanding query terms with predefined svelte 5-specific synonyms (e.g., '$state' also matches 'reactive state').\n- **result highlighting**: search results include highlighted matches within relevant fields (e.g., question, answer, instruction) using fts5's `highlight()` function.\n- **relevance ranking**: results are ordered by relevance based on fts5's internal ranking algorithm.\n- **advanced boosting**: offers capabilities for custom scoring and boosting to fine-tune search results, such as prioritizing matches in question fields or code content.\n\n## development\n\n### building\n```bash\nnpm run build # compile typescript\nnpm run dev # watch mode for development\n```\n\n### data processing\n```bash\nnode process-attached-data.js # process curated knowledge\nnode setup-data.js # create sample data\n```\n\n### testing\nthe server provides comprehensive logging and error handling:\n\n```bash\n# test the server\necho '{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"tools/list\"}' | npm start\n```\n\n## contributing\n\n### adding knowledge\n1. add entries to `data/svelte_5_knowledge.json`\n2. format: `{\"question\": \"...\", \"answer\": \"...\"}`\n3. focus on svelte 5 specific features and best practices\n\n### adding examples\n1. add entries to `data/svelte_5_patterns.json`\n2. format: `{\"instruction\": \"...\", \"input\": \"...\", \"output\": \"...\"}`\n3. include complete, working svelte 5 code examples\n\n### search optimization\n- use descriptive, searchable keywords in questions and instructions\n- include alternative phrasings for common concepts\n- tag examples with relevant feature names (`$state`, `snippets`, etc.)\n\n## advanced usage\n\n### custom search queries\nthe search tools support sophisticated queries:\n\n```typescript\n// search for state management patterns\nsearch_examples(\"$state reactive updates\")\n\n// find accessibility guidance\nsearch_knowledge(\"a11y accessibility screen reader\")\n\n// discover migration patterns\nsearch_examples(\"svelte 4 migration runes\")\n```\n\n### prompt chaining\nuse prompts in sequence for complex workflows:\n\n1. `search-patterns` - find relevant patterns\n2. `generate-component` - create based on patterns\n3. `audit-svelte5-code` - review and optimize\n\n### integration tips\n- **claude desktop**: best for interactive development\n- **api integration**: use programmatically for code generation\n- **ci/cd**: audit code in automated workflows\n- **documentation**: generate examples for style guides\n\n## troubleshooting\n\n### common issues\n\n**\"no results found\"**\n- check search terms are relevant to svelte 5\n- try broader queries first, then narrow down\n- ensure data files are properly formatted json\n\n**\"tool not found\"**\n- verify server is built (`npm run build`)\n- check mcp client configuration\n- review server logs for startup errors\n\n**\"invalid data format\"**\n- validate json files\n- check for trailing commas or syntax errors\n\n### debugging\n```bash\n# enable debug logging\ndebug=* npm start\n```\n\n## license\n\nmit license - see license file for details.\n\n## acknowledgments\n\n- built with [mcp typescript sdk](https://github.com/modelcontextprotocol/typescript-sdk)\n- search db by [better-sqlite3](https://github.com/wiselibs/better-sqlite3)\n- validation with [zod](https://zod.dev/)\n- curated svelte 5 knowledge from official documentation and community best practices",
"installation_instructions": null,
"categories": [
"Everything"
],
"owners": [],
"owner": null,
"code_snippets": {},
"evaluation_results": [],
"found_via_ownership_request": false,
"security_scans": [
{
"repo_url": "https://github.com/StudentOfJS/svelte5-mcp",
"repo_name": "svelte5-mcp",
"score": 100,
"risk_level": "low",
"score_explanation": "Score starts at 100, deducts points for security issues, and adds points for security best practices",
"scan_id": "3b818a15-db4b-433a-a3a2-3c4ee47cfa31",
"mcp_app_id": "3bed907e-eabc-4162-8af2-a011a32089d9",
"scan_time": "2025-06-08T00:23:51.608416+00:00",
"created_at": "2025-06-08T00:23:51.609158+00:00",
"updated_at": "2025-06-08T00:23:51.609158+00:00",
"findings": [],
"vulnerabilities": []
},
{
"repo_url": "https://github.com/StudentOfJS/svelte5-mcp",
"repo_name": "svelte5-mcp",
"score": 100,
"risk_level": "low",
"score_explanation": "Score starts at 100, deducts points for security issues, and adds points for security best practices",
"scan_id": "347a56c4-30e8-46d1-85cc-5bbd2e130dd9",
"mcp_app_id": "3bed907e-eabc-4162-8af2-a011a32089d9",
"scan_time": "2025-06-13T05:36:13.899651+00:00",
"created_at": "2025-06-13T05:36:13.900413+00:00",
"updated_at": "2025-06-13T05:36:13.900413+00:00",
"findings": [],
"vulnerabilities": []
}
]
}
}
Svelte
A specialized Model Context Protocol (MCP) server for Svelte 5 frontend development