The RAG Documentation MCP Server provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context. It offers a comprehensive set of tools for searching, managing, and indexing documentation from both web sources and local repositories.
The easiest way to get started is using Docker Compose:
docker-compose up -d
To stop the services:
docker-compose down
The system uses Ollama as the default embedding provider for local embeddings generation, with OpenAI available as a fallback option.
EMBEDDING_PROVIDER
: Choose the primary provider ('ollama' or 'openai', default: 'ollama')EMBEDDING_MODEL
: Specify the model to use (defaults to 'nomic-embed-text' for Ollama or 'text-embedding-3-small' for OpenAI)OPENAI_API_KEY
: Required when using OpenAI as providerFALLBACK_PROVIDER
: Optional backup providerFALLBACK_MODEL
: Optional model for fallback providerQDRANT_URL
: URL for Qdrant vector database (default: "http://localhost:6333")Add this to your cline_mcp_settings.json
:
{
"mcpServers": {
"rag-docs": {
"command": "node",
"args": ["/path/to/your/mcp-ragdocs/build/index.js"],
"env": {
"EMBEDDING_PROVIDER": "ollama",
"EMBEDDING_MODEL": "nomic-embed-text",
"OPENAI_API_KEY": "your-api-key-here",
"FALLBACK_PROVIDER": "openai",
"FALLBACK_MODEL": "nomic-embed-text",
"QDRANT_URL": "http://localhost:6333"
},
"disabled": false,
"autoApprove": [
"search_documentation",
"list_sources",
"extract_urls",
"remove_documentation",
"list_queue",
"run_queue",
"clear_queue",
"add_documentation",
"add_repository",
"list_repositories",
"update_repository",
"remove_repository",
"watch_repository",
"get_indexing_status"
]
}
}
}
Add this to your claude_desktop_config.json
:
{
"mcpServers": {
"rag-docs": {
"command": "node",
"args": ["/path/to/your/mcp-ragdocs/build/index.js"],
"env": {
"EMBEDDING_PROVIDER": "ollama",
"EMBEDDING_MODEL": "nomic-embed-text",
"OPENAI_API_KEY": "your-api-key-here",
"FALLBACK_PROVIDER": "openai",
"FALLBACK_MODEL": "nomic-embed-text",
"QDRANT_URL": "http://localhost:6333"
},
"autoApprove": [
"search_documentation",
"list_sources",
"extract_urls",
"remove_documentation",
"list_queue",
"run_queue",
"clear_queue",
"add_documentation",
"add_repository",
"list_repositories",
"update_repository",
"remove_repository",
"watch_repository",
"get_indexing_status"
]
}
}
}
For optimal reliability, configure both Ollama and OpenAI:
{
"EMBEDDING_MODEL": "nomic-embed-text",
"FALLBACK_PROVIDER": "openai",
"FALLBACK_MODEL": "text-embedding-3-small",
"OPENAI_API_KEY": "your-api-key-here"
}
This ensures fast local embedding generation with Ollama, with automatic fallback to OpenAI if needed.
Access the web interface after starting the services:
http://localhost:3030
add_documentation with {
"url": "https://example.com/docs"
}
add_repository: Index a local code repository
add_repository with {
"path": "/path/to/your/repo",
"name": "my-project",
"include": ["**/*.js", "**/*.ts", "**/*.md"],
"exclude": ["**/node_modules/**", "**/dist/**"],
"watchMode": true
}
list_repositories: List all indexed repositories
update_repository: Re-index a repository with updated configuration
update_repository with {
"name": "my-project",
"include": ["**/*.js", "**/*.ts", "**/*.md", "**/*.json"],
"exclude": ["**/node_modules/**", "**/dist/**", "**/tests/**"]
}
remove_repository: Remove a repository from the index
remove_repository with {
"name": "my-project"
}
watch_repository: Start or stop watching a repository for changes
watch_repository with {
"name": "my-project",
"action": "start"
}
get_indexing_status: Get the current status of repository indexing
get_indexing_status with {
"name": "my-project"
}
The system supports a repositories.json
configuration file for automatically indexing repositories at startup:
{
"repositories": [
{
"path": "/path/to/your/repo",
"name": "my-project",
"include": ["**/*.js", "**/*.ts", "**/*.md"],
"exclude": ["**/node_modules/**", "**/.git/**"],
"watchMode": true,
"watchInterval": 60000,
"chunkSize": 1000,
"fileTypeConfig": {
".js": { "include": true, "chunkStrategy": "semantic" },
".ts": { "include": true, "chunkStrategy": "semantic" },
".md": { "include": true, "chunkStrategy": "semantic" }
}
}
],
"autoWatch": true
}
If the server fails to start due to a port conflict:
npx kill-port 3030
Or check which process is using the port:
lsof -i :3030
For large repositories:
get_indexing_status
to monitor progressTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "rag-docs" '{"command":"node","args":["/path/to/your/mcp-ragdocs/build/index.js"],"env":{"EMBEDDING_PROVIDER":"ollama","EMBEDDING_MODEL":"nomic-embed-text","OPENAI_API_KEY":"your-api-key-here","FALLBACK_PROVIDER":"openai","FALLBACK_MODEL":"nomic-embed-text","QDRANT_URL":"http://localhost:6333"},"autoApprove":["search_documentation","list_sources","extract_urls","remove_documentation","list_queue","run_queue","clear_queue","add_documentation","add_repository","list_repositories","update_repository","remove_repository","watch_repository","get_indexing_status"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"rag-docs": {
"command": "node",
"args": [
"/path/to/your/mcp-ragdocs/build/index.js"
],
"env": {
"EMBEDDING_PROVIDER": "ollama",
"EMBEDDING_MODEL": "nomic-embed-text",
"OPENAI_API_KEY": "your-api-key-here",
"FALLBACK_PROVIDER": "openai",
"FALLBACK_MODEL": "nomic-embed-text",
"QDRANT_URL": "http://localhost:6333"
},
"autoApprove": [
"search_documentation",
"list_sources",
"extract_urls",
"remove_documentation",
"list_queue",
"run_queue",
"clear_queue",
"add_documentation",
"add_repository",
"list_repositories",
"update_repository",
"remove_repository",
"watch_repository",
"get_indexing_status"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"rag-docs": {
"command": "node",
"args": [
"/path/to/your/mcp-ragdocs/build/index.js"
],
"env": {
"EMBEDDING_PROVIDER": "ollama",
"EMBEDDING_MODEL": "nomic-embed-text",
"OPENAI_API_KEY": "your-api-key-here",
"FALLBACK_PROVIDER": "openai",
"FALLBACK_MODEL": "nomic-embed-text",
"QDRANT_URL": "http://localhost:6333"
},
"autoApprove": [
"search_documentation",
"list_sources",
"extract_urls",
"remove_documentation",
"list_queue",
"run_queue",
"clear_queue",
"add_documentation",
"add_repository",
"list_repositories",
"update_repository",
"remove_repository",
"watch_repository",
"get_indexing_status"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect