RAG Documentation MCP server

Integrates Qdrant vector search with documentation retrieval to enable context-aware responses and semantic querying for enhanced knowledge access.
Back to servers
Setup instructions
Provider
Rahul Retnan
Release date
Jan 26, 2025
Language
TypeScript
Stats
41 stars

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.

Installation

Docker Compose Setup

The easiest way to get started is using Docker Compose:

docker-compose up -d

To stop the services:

docker-compose down

Configuration Options

The system uses Ollama as the default embedding provider for local embeddings generation, with OpenAI available as a fallback option.

Environment Variables

  • 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 provider
  • FALLBACK_PROVIDER: Optional backup provider
  • FALLBACK_MODEL: Optional model for fallback provider
  • QDRANT_URL: URL for Qdrant vector database (default: "http://localhost:6333")

Cline Configuration

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"
      ]
    }
  }
}

Claude Desktop Configuration

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"
      ]
    }
  }
}

Recommended Configuration

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.

Usage

Web Interface

Access the web interface after starting the services:

  1. Open your browser and navigate to: http://localhost:3030
  2. The interface provides:
    • Real-time queue monitoring
    • Documentation source management
    • Search interface for testing queries
    • System status and health checks

Available Tools

Documentation Search and Management

  • search_documentation: Search through documentation using vector search
  • list_sources: List all available documentation sources
  • extract_urls: Extract URLs from text and check if they're in the documentation
  • remove_documentation: Remove documentation from a specific source

Queue Management

  • list_queue: List all items in the processing queue
  • run_queue: Process all items in the queue
  • clear_queue: Clear all items from the processing queue

Adding Documentation

  • add_documentation: Add new documentation directly by providing a URL
    add_documentation with {
      "url": "https://example.com/docs"
    }
    

Repository Management

  • 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"
    }
    

Repository Configuration File

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
}

Troubleshooting

Server Not Starting (Port Conflict)

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

Timeout Issues with Large Repositories

For large repositories:

  • The system uses asynchronous processing to avoid MCP timeouts
  • Indexing continues in the background after initial response
  • Use get_indexing_status to monitor progress
  • If issues persist, try more specific include/exclude patterns or break repositories into smaller units

How to install this MCP server

For Claude Code

To 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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later