{"_id":"@binsarjr/svelte5-mcp","_rev":"5-1e9ca4cfa161bede0ce435cefbf96919","name":"@binsarjr/svelte5-mcp","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@binsarjr/svelte5-mcp","version":"1.0.0","keywords":["mcp","svelte","svelte5","frontend","development","assistant"],"author":"","license":"MIT","_id":"@binsarjr/svelte5-mcp@1.0.0","maintainers":[{"name":"binsarjr","email":"binsarjr121@gmail.com"}],"bin":{"svelte5-mcp":"src/index.ts"},"dist":{"shasum":"a78e61c1b995e73da20cbcd80dd940a4c85b9df2","tarball":"https://registry.npmjs.org/@binsarjr/svelte5-mcp/-/svelte5-mcp-1.0.0.tgz","fileCount":8,"integrity":"sha512-ggLCgIyHawfBHft5LlmeqPR+ccV/1VBiFBFT0C5genESEU8VU+0DH1xF7oN6u5mVvtC4iOpKnMnD+EfadH/Aqw==","signatures":[{"sig":"MEUCIQC2YZwHhu1CWui9iD0E9IzAQBEsuiQbOQkTICqNo4oKVgIgcFKkXgfAy3js5ponU1iJ9Du3MpTDTqTRMskRlEYdcvQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":325807},"main":"src/index.ts","type":"module","engines":{"bun":">=1.0.0","node":">=18"},"gitHead":"4ce634e4859ca8d46fc303b64452b41217f05dd2","scripts":{"dev":"bun --watch src/index.ts","start":"bun src/index.ts","inspect":"bunx @modelcontextprotocol/inspector bun src/index.ts"},"_npmUser":{"name":"binsarjr","email":"binsarjr121@gmail.com"},"_npmVersion":"11.3.0","description":"MCP server for Svelte 5 frontend development with curated knowledge and examples","directories":{},"_nodeVersion":"24.2.0","dependencies":{"zod":"^3.25.76","@modelcontextprotocol/sdk":"^1.18.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.22","typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/svelte5-mcp_1.0.0_1758100225176_0.6567548288758425","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@binsarjr/svelte5-mcp","version":"1.0.1","keywords":["mcp","svelte","svelte5","frontend","development","assistant"],"author":"","license":"MIT","_id":"@binsarjr/svelte5-mcp@1.0.1","maintainers":[{"name":"binsarjr","email":"binsarjr121@gmail.com"}],"bin":{"svelte5-mcp":"src/index.ts"},"dist":{"shasum":"4f13369facf4a611c5ebf3245891f0e5c8601146","tarball":"https://registry.npmjs.org/@binsarjr/svelte5-mcp/-/svelte5-mcp-1.0.1.tgz","fileCount":8,"integrity":"sha512-6L44AV91tnOTqdVp3AH1z5ju5oBxbS2v3wnxG0XRA9s3Mle9PZvGkWJKSrsBsHwq3UNOpcTxGvUIbiB1fmYU2g==","signatures":[{"sig":"MEYCIQDbT3zkzXyHH52VSZYz94i9myhEOF020MYL94Dnea+pJQIhAJB35Sk+Y3GQ/qnxVfyiNUkuBsKy0tfHC3bC8lRCg+1A","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":330479},"main":"src/index.ts","type":"module","engines":{"bun":">=1.0.0","node":">=18"},"gitHead":"4ce634e4859ca8d46fc303b64452b41217f05dd2","scripts":{"dev":"bun --watch src/index.ts","start":"bun src/index.ts","inspect":"bunx @modelcontextprotocol/inspector bun src/index.ts"},"_npmUser":{"name":"binsarjr","email":"binsarjr121@gmail.com"},"_npmVersion":"11.3.0","description":"MCP server for Svelte 5 frontend development with curated knowledge and examples","directories":{},"_nodeVersion":"24.2.0","dependencies":{"zod":"^3.25.76","@modelcontextprotocol/sdk":"^1.18.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.22","typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/svelte5-mcp_1.0.1_1758101058349_0.32720208481273527","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@binsarjr/svelte5-mcp","version":"1.0.2","keywords":["mcp","svelte","svelte5","frontend","development","assistant"],"author":"","license":"MIT","_id":"@binsarjr/svelte5-mcp@1.0.2","maintainers":[{"name":"binsarjr","email":"binsarjr121@gmail.com"}],"bin":{"svelte5-mcp":"dist/index.js"},"dist":{"shasum":"bb2f817f6ccf6d49e9a81a92c1083f38c024f7be","tarball":"https://registry.npmjs.org/@binsarjr/svelte5-mcp/-/svelte5-mcp-1.0.2.tgz","fileCount":18,"integrity":"sha512-RotMEzLAyGqcdT1xR1AgljlgLPfmy5A20Th6uGe4e/UaHcxocYhS9qt6AUAFNPFTnKBg5muiGP+R5okB+D9a8A==","signatures":[{"sig":"MEYCIQCYJkFoIsfARDizChc1cRPN2GelZMsuRLcuVSfMG11RwAIhANGakclVfcCm2GNLlhMvOXmOvUme1Cq/cyZ5HK2SfE/G","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":643149},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.0.0","node":">=18"},"gitHead":"4ce634e4859ca8d46fc303b64452b41217f05dd2","scripts":{"dev":"bun --watch src/index.ts","build":"tsc && cp -r src/data dist/ && chmod +x dist/index.js","start":"bun src/index.ts","inspect":"bunx @modelcontextprotocol/inspector bun src/index.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"binsarjr","email":"binsarjr121@gmail.com"},"_npmVersion":"11.3.0","description":"MCP server for Svelte 5 frontend development with curated knowledge and examples","directories":{},"_nodeVersion":"24.2.0","dependencies":{"zod":"^3.25.76","@modelcontextprotocol/sdk":"^1.18.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.22","typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/svelte5-mcp_1.0.2_1758101545591_0.7427741474255334","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@binsarjr/svelte5-mcp","version":"1.0.3","keywords":["mcp","svelte","svelte5","frontend","development","assistant"],"author":"","license":"MIT","_id":"@binsarjr/svelte5-mcp@1.0.3","maintainers":[{"name":"binsarjr","email":"binsarjr121@gmail.com"}],"bin":{"svelte5-mcp":"dist/index.js"},"dist":{"shasum":"ce3febcd741a1d4cd54986392f764ad214015292","tarball":"https://registry.npmjs.org/@binsarjr/svelte5-mcp/-/svelte5-mcp-1.0.3.tgz","fileCount":18,"integrity":"sha512-koSVCravo835Bi1+1mplWIzz3e0xNbnifE7tmVHQm21np5b9pCIUXAc0/HD9Li/o1msYtt2RSsxkel40gpFdFg==","signatures":[{"sig":"MEYCIQDzRgFjiwExerYmXVILEpg7/wirdjSCj/xLqjODHVJlgQIhAOeFCiPzYETlZuJHp5f+wQZZXr2OSMGW6JpkQ1H7xd5m","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":643104},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"bun":">=1.0.0"},"gitHead":"4ce634e4859ca8d46fc303b64452b41217f05dd2","scripts":{"dev":"bun --watch src/index.ts","build":"tsc && cp -r src/data dist/ && chmod +x dist/index.js","start":"bun src/index.ts","inspect":"bunx @modelcontextprotocol/inspector bun src/index.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"binsarjr","email":"binsarjr121@gmail.com"},"_npmVersion":"11.3.0","description":"MCP server for Svelte 5 frontend development with curated knowledge and examples","directories":{},"_nodeVersion":"24.2.0","dependencies":{"zod":"^3.25.76","@modelcontextprotocol/sdk":"^1.18.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.2.22","typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/svelte5-mcp_1.0.3_1758102184389_0.6188288055362781","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@binsarjr/svelte5-mcp","version":"1.0.4","description":"MCP server for Svelte 5 frontend development with curated knowledge and examples","type":"module","main":"dist/index.js","bin":{"svelte5-mcp":"dist/index.js"},"scripts":{"dev":"bun --watch src/index.ts","build":"tsc && cp -r src/data dist/ && chmod +x dist/index.js","start":"bun src/index.ts","prepublishOnly":"npm run build","inspect":"bunx @modelcontextprotocol/inspector bun src/index.ts"},"keywords":["mcp","svelte","svelte5","frontend","development","assistant"],"author":"","license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^1.18.0","zod":"^3.25.76"},"devDependencies":{"@types/bun":"^1.2.22","typescript":"^5.9.2"},"engines":{"bun":">=1.0.0"},"_id":"@binsarjr/svelte5-mcp@1.0.4","gitHead":"38a89684eb30e07266fb4f9513571ede20910cc0","types":"./dist/index.d.ts","_nodeVersion":"24.2.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-Ba1xTUe7FKduOYFxeYJwwQvgBkBMSkZ4PmfRUwluL1boFN5aNZdjLtdRuBAnlLfR8ku1+2rxlr2VNDqnYlan0A==","shasum":"ffa6340eeb2d5760d367f2be7619d2c9111d3e09","tarball":"https://registry.npmjs.org/@binsarjr/svelte5-mcp/-/svelte5-mcp-1.0.4.tgz","fileCount":50,"unpackedSize":1550963,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDyNB7Qyk8Wddlnj/LSilUxT8C3UXFbYwHOwA5u9tFHIQIhAKS+AnXMrL2MGSxHZy6TtpHbq2CdNnPlPZnow6i/4lj6"}]},"_npmUser":{"name":"binsarjr","email":"binsarjr121@gmail.com"},"directories":{},"maintainers":[{"name":"binsarjr","email":"binsarjr121@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/svelte5-mcp_1.0.4_1758108177938_0.24902231029984612"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-17T09:10:25.084Z","modified":"2025-09-17T11:22:58.319Z","1.0.0":"2025-09-17T09:10:25.355Z","1.0.1":"2025-09-17T09:24:18.564Z","1.0.2":"2025-09-17T09:32:25.823Z","1.0.3":"2025-09-17T09:43:04.603Z","1.0.4":"2025-09-17T11:22:58.144Z"},"license":"MIT","keywords":["mcp","svelte","svelte5","frontend","development","assistant"],"description":"MCP server for Svelte 5 frontend development with curated knowledge and examples","maintainers":[{"name":"binsarjr","email":"binsarjr121@gmail.com"}],"readme":"# Svelte 5 MCP Server (Bun Version)\n\nA 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.\n\n> **Note**: This is a fork of [svelte5-mcp](https://github.com/StudentOfJS/svelte5-mcp) that has been adapted to use Bun instead of Node.js. This version is specifically optimized for Svelte 5 development with Bun as the runtime.\n\n## Features\n\n### 🔍 **Searchable Resources**\n- **Knowledge Base**: Curated Q&A covering Svelte 5 concepts, runes, and best practices\n- **Code Examples**: Searchable collection of Svelte 5 patterns and component implementations\n\n### 🛠️ **Intelligent Tools**\n- `search_knowledge` - Find explanations and concepts\n- `search_examples` - Discover code patterns and implementations\n- `generate_with_context` - Create components using curated patterns\n- `audit_with_rules` - Review code against Svelte 5 best practices\n- `explain_concept` - Get detailed explanations with examples\n\n### 📝 **Smart Prompts**\n- `generate-component` - Generate modern Svelte 5 components\n- `audit-svelte5-code` - Audit code for optimization opportunities\n- `explain-concept` - Detailed concept explanations\n- `search-patterns` - Find specific implementation patterns\n\n## Installation\n\n### Option 1: Direct usage with bunx (Recommended)\n\nSimply add to your Claude Desktop configuration - no installation required:\n\n```json\n{\n  \"mcpServers\": {\n    \"svelte5\": {\n      \"command\": \"bunx\",\n      \"args\": [\"@binsarjr/svelte5-mcp\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\n### Option 2: Manual installation\n\n```bash\n# Clone and setup\ngit clone https://github.com/binsarjr/svelte5-mcp\ncd svelte5-mcp-bin\n\n# Install dependencies with Bun\nbun install\n\n# Start the server\nbun start\n```\n\n## Project Structure\n\n```\nsvelte5-mcp-bin/\n├── src/\n│   ├── index.ts          # Main MCP server implementation\n│   ├── Svelte5SearchDB.ts # SQLite database with FTS5 search\n│   └── data/\n│       ├── svelte_5_knowledge.json    # Curated Q&A knowledge base\n│       └── svelte_5_patterns.json     # Code examples and patterns\n├── package.json\n├── bun.lockb            # Bun lock file\n├── tsconfig.json\n└── README.md\n```\n\n## Usage with Claude Desktop\n\n### Recommended: Using bunx (no installation required)\n\n```json\n{\n  \"mcpServers\": {\n    \"svelte5\": {\n      \"command\": \"bunx\",\n      \"args\": [\"@binsarjr/svelte5-mcp\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\n### Alternative: Local installation\n\n```json\n{\n  \"mcpServers\": {\n    \"svelte5\": {\n      \"command\": \"bun\",\n      \"args\": [\"/path/to/svelte5-mcp-bin/src/index.ts\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\n## Usage Examples\n\n### 🔍 Search Knowledge\n```\nTool: search_knowledge\nQuery: \"runes reactivity\"\n```\n\nReturns detailed explanations about Svelte 5 runes and the new reactivity system.\n\n### 📚 Find Code Examples\n```\nTool: search_examples  \nQuery: \"counter component $state\"\n```\n\nReturns working Svelte 5 counter implementations using the `$state` rune.\n\n### 🏗️ Generate Components\n```\nTool: generate_with_context\nDescription: \"A todo list with add/remove functionality\"\nFeatures: [\"$state\", \"snippets\", \"accessibility\"]\n```\n\nGenerates a complete todo component using modern Svelte 5 patterns with relevant examples from the knowledge base.\n\n### 🔍 Audit Code\n```\nTool: audit_with_rules\nCode: \"<script>let count = 0;</script><button on:click={() => count++}>{count}</button>\"\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### 🎯 **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### 🧩 **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### 📈 **Migration Support**\n- Svelte 4 → 5 migration patterns\n- Legacy reactive statements (`$:`) → runes\n- Slots → snippets conversion\n- Event dispatcher → 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\": \"<script>\\nlet count = $state(0);\\n</script>\\n\\n<button onclick={() => count++}>\\n  clicks: {count}\\n</button>\"\n}\n```\n\n## Configuration\n\n### Database Location\n\nThe server stores its SQLite database following the XDG Base Directory specification:\n\n- **All platforms**: `~/.config/binsarjr/svelte5-mcp/database.db`\n\nThis provides a consistent, organized location across all operating systems.\n\n### Environment Variables\n\nYou can customize the database location using environment variables:\n\n```json\n{\n  \"mcpServers\": {\n    \"svelte5\": {\n      \"command\": \"bunx\",\n      \"args\": [\"@binsarjr/svelte5-mcp\"],\n      \"env\": {\n        \"SVELTE5_MCP_CONFIG_DIR\": \"/custom/config/path\",\n        \"SVELTE5_MCP_DB_PATH\": \"/custom/database.db\"\n      }\n    }\n  }\n}\n```\n\n### Search Features\n\nThe server uses SQLite with FTS5 for advanced search capabilities:\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\n### Data Processing\n```bash\nbun process-attached-data.js    # Process curated knowledge\nbun 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\"}' | bun 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- 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**Database/Config Issues**\n- Check if config directory is writable\n- Verify database permissions in the config folder\n- Use `SVELTE5_MCP_DB_PATH` environment variable for custom locations\n- Check logs for database initialization messages\n\n### Debugging\n```bash\n# Enable debug logging\nDEBUG=* bun start\n\n# Test database location\nbunx @binsarjr/svelte5-mcp  # Watch for config path logs\n\n# Check config directory (all platforms)\nls -la ~/.config/binsarjr/svelte5-mcp/\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- Validation with [Zod](https://zod.dev/)\n- Curated Svelte 5 knowledge from official documentation and community best practices","readmeFilename":"README.MD"}