A Model Context Protocol (MCP) server that enables semantic search of Svelte 5 documentation using OpenAI's Retrieval API. This server allows AI assistants like Claude and Cursor to search through Svelte 5 documentation using natural language queries.
You can install this package globally using npm:
npm install -g @ronangrant/mcp-svelte-docs
Or run it directly with npx:
npx @ronangrant/mcp-svelte-docs
If you want to clone and build from source:
Clone the repository:
git clone https://github.com/ronangrant/mcp-svelte-docs.git
cd mcp-svelte-docs
Install dependencies:
npm install
Build the project:
npm run build
You can run the MCP server directly for testing:
# Using environment variables
OPENAI_API_KEY="your-openai-api-key" npm start
# Using command-line arguments
npx @ronangrant/mcp-svelte-docs --openai-api-key=your-openai-api-key
For Cursor integration, add a new MCP tool with the following command:
npx -y @ronangrant/mcp-svelte-docs --openai-api-key=your-openai-api-key
To make sure Cursor remembers to use the MCP when working with Svelte 5, you can create a Cursor Rule:
Cmd + Shift + P
(Mac) or Ctrl + Shift + P
(Windows/Linux) and name the filewhen-to-use-svelte-mcp
# Svelte 5 Documentation MCP Rule
## How to use:
Use the MCP to search Svelte 5 documentation instead of guessing. This ensures accuracy and prevents hallucinations.
## When to use it:
- When writing Svelte and unsure about changes from version 4 to 5.
- When encountering errors or unexpected behavior, even if you think you know the cause.
- Whenever a clarification is needed regarding Svelte 5 syntax, API, or best practices.
**Do not guess. Always verify with the MCP.**
This rule reminds Cursor to use the MCP for accurate Svelte 5 information rather than relying on potentially outdated knowledge.
Edit your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"svelte5docs": {
"command": "/usr/local/bin/node",
"args": [
"/path/to/your/mcp-svelte-docs/build/index.js"
],
"env": {
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}
Or, if you installed the package globally:
{
"mcpServers": {
"svelte5docs": {
"command": "npx",
"args": [
"-y",
"@ronangrant/mcp-svelte-docs"
],
"env": {
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}
Restart Claude Desktop
For other MCP hosts, consult their documentation for how to configure external MCP servers. The general approach is to provide:
node /path/to/build/index.js
)OPENAI_API_KEY
(required)The MCP server provides the following tool to AI assistants:
search_svelte_docs
query
: Search querylimit
(optional): Maximum number of results to return (default: 5)OpenAI API Key Issues
sk-
)Retrieval API Access Issues
Configuration Path Issues
which node
to find it)MIT
Contributions are welcome! Please feel free to submit a Pull Request.