trackmcp
Back to directory
rahulretnan

mcp-ragdocs

View on GitHub

RAG Documentation MCP Server

64 stars TypeScriptOthers Updated Sep 2, 2026

Documentation

RAG Documentation MCP Server

smithery badge

An MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.

Table of Contents

Features

Tools

1. search_documentation

    2. list_sources

      3. extract_urls

        4. remove_documentation

          5. list_queue

            6. run_queue

              7. clear_queue

                8. add_documentation

                  9. add_repository

                    10. list_repositories

                      11. update_repository

                        12. remove_repository

                          13. watch_repository

                            14. get_indexing_status

                              Quick Start

                              The RAG Documentation tool is designed for:

                              • Enhancing AI responses with relevant documentation
                              • Building documentation-aware AI assistants
                              • Creating context-aware tooling for developers
                              • Implementing semantic documentation search
                              • Augmenting existing knowledge bases

                              Docker Compose Setup

                              The project includes a `docker-compose.yml` file for easy containerized deployment. To start the services:

                              bash
                              docker-compose up -d

                              To stop the services:

                              bash
                              docker-compose down

                              Web Interface

                              The system includes a web interface that can be accessed after starting the Docker Compose services:

                              1. Open your browser and navigate to: `http://localhost:3030`

                              2. The interface provides:

                                Configuration

                                Embeddings Configuration

                                The system uses Ollama as the default embedding provider for local embeddings generation, with OpenAI available as a fallback option. This setup prioritizes local processing while maintaining reliability through cloud-based fallback.

                                Environment Variables

                                • `EMBEDDING_PROVIDER`: Choose the primary embedding provider ('ollama' or 'openai', default: 'ollama')
                                • `EMBEDDING_MODEL`: Specify the model to use (optional)
                                  • For OpenAI: defaults to 'text-embedding-3-small'
                                  • For Ollama: defaults to 'nomic-embed-text'
                                • `OPENAI_API_KEY`: Required when using OpenAI as provider
                                • `FALLBACK_PROVIDER`: Optional backup provider ('ollama' or 'openai')
                                • `FALLBACK_MODEL`: Optional model for fallback provider

                                Cline Configuration

                                Add this to your `cline_mcp_settings.json`:

                                json
                                {
                                  "mcpServers": {
                                    "rag-docs": {
                                      "command": "node",
                                      "args": ["/path/to/your/mcp-ragdocs/build/index.js"],
                                      "env": {
                                        "EMBEDDING_PROVIDER": "ollama", // default
                                        "EMBEDDING_MODEL": "nomic-embed-text", // optional
                                        "OPENAI_API_KEY": "your-api-key-here", // required for fallback
                                        "FALLBACK_PROVIDER": "openai", // recommended for reliability
                                        "FALLBACK_MODEL": "nomic-embed-text", // optional
                                        "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`:

                                json
                                {
                                  "mcpServers": {
                                    "rag-docs": {
                                      "command": "node",
                                      "args": ["/path/to/your/mcp-ragdocs/build/index.js"],
                                      "env": {
                                        "EMBEDDING_PROVIDER": "ollama", // default
                                        "EMBEDDING_MODEL": "nomic-embed-text", // optional
                                        "OPENAI_API_KEY": "your-api-key-here", // required for fallback
                                        "FALLBACK_PROVIDER": "openai", // recommended for reliability
                                        "FALLBACK_MODEL": "nomic-embed-text", // optional
                                        "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"
                                      ]
                                    }
                                  }
                                }

                                Default Configuration

                                The system uses Ollama by default for efficient local embedding generation. For optimal reliability:

                                1. Install and run Ollama locally

                                2. Configure OpenAI as fallback (recommended):

                                json
                                {
                                     // Ollama is used by default, no need to specify EMBEDDING_PROVIDER
                                     "EMBEDDING_MODEL": "nomic-embed-text", // optional
                                     "FALLBACK_PROVIDER": "openai",
                                     "FALLBACK_MODEL": "text-embedding-3-small",
                                     "OPENAI_API_KEY": "your-api-key-here"
                                   }

                                This configuration ensures:

                                • Fast, local embedding generation with Ollama
                                • Automatic fallback to OpenAI if Ollama fails
                                • No external API calls unless necessary

                                Note: The system will automatically use the appropriate vector dimensions based on the provider:

                                • Ollama (nomic-embed-text): 768 dimensions
                                • OpenAI (text-embedding-3-small): 1536 dimensions

                                Documentation Management

                                Direct vs. Queue-Based Documentation Addition

                                The system provides two complementary approaches for adding documentation:

                                1. Direct Addition (`add_documentation` tool)

                                  2. Queue-Based Processing

                                    Choose the approach that best fits your documentation management needs. For small numbers of important documents, direct addition provides immediate results. For large documentation sets or recursive crawling, the queue-based approach offers better scalability.

                                    Local Repository Indexing

                                    The system supports indexing local code repositories, making their content searchable alongside web documentation:

                                    1. Repository Configuration

                                      2. File Processing

                                        3. Asynchronous Processing

                                          4. Change Detection

                                            Example usage:

                                            code
                                            add_repository with {
                                              "path": "/path/to/your/repo",
                                              "name": "my-project",
                                              "include": ["**/*.js", "**/*.ts", "**/*.md"],
                                              "exclude": ["**/node_modules/**", "**/dist/**"],
                                              "watchMode": true
                                            }

                                            After starting the indexing process, you can check its status:

                                            code
                                            get_indexing_status with {
                                              "name": "my-project"
                                            }

                                            This will return detailed information about the indexing progress:

                                            code
                                            Repository: my-project
                                            Status: ๐Ÿ”„ Processing
                                            Progress: 45%
                                            Started: 5/11/2025, 2:45:30 PM
                                            Duration: 3m 15s
                                            Files: 120 processed, 15 skipped (of 250)
                                            Chunks: 1500 indexed (of 3300)
                                            Batch: 15 of 33

                                            Repository Configuration File

                                            The system supports a `repositories.json` configuration file that allows you to define repositories to be automatically indexed at startup:

                                            json
                                            {
                                              "repositories": [
                                                {
                                                  "path": "/path/to/your/repo",

                                            The configuration file is automatically updated when repositories are added, updated, or removed using the repository management tools. You can also manually edit the file to configure repositories before starting the server. The paths within the configuration file, such as the `path` for each repository and the implicit location of `repositories.json` itself, are resolved relative to the project root directory where the server is executed.

                                            Configuration Options:

                                            • `repositories`: Array of repository configurations
                                              • `path`: Absolute path to the repository directory

                                            "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

                                            }

                                            code
                                            The configuration file is automatically updated when repositories are added, updated, or removed using the repository management tools. You can also manually edit the file to configure repositories before starting the server.
                                            
                                            **Configuration Options:**
                                            
                                            - `repositories`: Array of repository configurations
                                              - `path`: Absolute path to the repository directory
                                              - `name`: Unique name for the repository
                                              - `include`: Array of glob patterns to include
                                              - `exclude`: Array of glob patterns to exclude
                                              - `watchMode`: Whether to watch for changes
                                              - `watchInterval`: Polling interval in milliseconds
                                              - `chunkSize`: Default chunk size for files
                                              - `fileTypeConfig`: Configuration for specific file types
                                                - `include`: Whether to include this file type
                                                - `chunkStrategy`: Chunking strategy ("semantic", "line", or "character")
                                                - `chunkSize`: Optional override for chunk size
                                            
                                            - `autoWatch`: Whether to automatically start watching repositories with `watchMode: true` at startup
                                            
                                            ## Acknowledgments
                                            
                                            This project is a fork of [qpd-v/mcp-ragdocs](https://github.com/qpd-v/mcp-ragdocs), originally developed by qpd-v. The original project provided the foundation for this implementation.
                                            
                                            Special thanks to the original creator, qpd-v, for their innovative work on the initial version of this MCP server. This fork has been enhanced with additional features and improvements by Rahul Retnan.
                                            
                                            ## Troubleshooting
                                            
                                            ### Server Not Starting (Port Conflict)
                                            
                                            If the MCP server fails to start due to a port conflict, follow these steps:
                                            
                                            1. Identify and kill the process using port 3030:

                                            npx kill-port 3030

                                            code
                                            2. Restart the MCP server
                                            
                                            3. If the issue persists, check for other processes using the port:

                                            lsof -i :3030

                                            code
                                            4. You can also change the default port in the configuration if needed
                                            
                                            ### Missing Tools in Claude Desktop
                                            
                                            If certain tools (like `add_documentation`) are not appearing in Claude Desktop:
                                            
                                            1. Verify that the tool is properly registered in the server's `handler-registry.ts` file
                                            2. Make sure the tool is included in the `ListToolsRequestSchema` handler response
                                            3. Check that your Claude Desktop configuration includes the tool in the `autoApprove` array
                                            4. Restart the Claude Desktop application and the MCP server
                                            5. Check the server logs for any errors related to tool registration
                                            
                                            The most common cause of missing tools is that they are registered as handlers but not included in the `tools` array returned by the `ListToolsRequestSchema` handler.
                                            
                                            ### Timeout Issues with Large Repositories
                                            
                                            If you encounter timeout errors when indexing large repositories:
                                            
                                            1. The system now uses asynchronous processing to avoid MCP timeouts
                                            2. When adding a repository with `add_repository`, the indexing will continue in the background
                                            3. Use the `get_indexing_status` tool to monitor progress
                                            4. If you still experience issues, try these solutions:
                                               - Reduce the scope of indexing with more specific include/exclude patterns
                                               - Break up very large repositories into smaller logical units
                                               - Increase the batch size in the code if your system has more resources available
                                               - Check system resources (memory, CPU) during indexing to identify bottlenecks

                                            Frequently asked questions

                                            What is mcp-ragdocs?

                                            mcp-ragdocs is RAG Documentation MCP Server

                                            How do I install mcp-ragdocs?

                                            Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

                                            Is mcp-ragdocs open source?

                                            Yes โ€” it is hosted on GitHub at https://github.com/rahulretnan/mcp-ragdocs and has 64 stars.

                                            Related MCP tools

                                            Run your own MCP server? See who uses it and what to fix.

                                            Measure it with TrackMCP