MCP Docs RAG Server
Allows cloning and pulling from Git repositories to store them as local documents for RAG queries
Enables retrieving repositories from GitHub to be used as document sources for RAG queries
Uses Google's Gemini API for document indexing and embedding generation for RAG functionality
Implemented as a TypeScript-based MCP server with specific capabilities for document processing and RAG
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Docs RAG Server What does the documentation say about authentication in the FastAPI repository?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-docs-rag MCP Server
RAG (Retrieval-Augmented Generation) for documents in a local directory
This is a TypeScript-based MCP server that implements a RAG system for documents stored in a local directory. It allows users to query documents using LLMs with context from locally stored repositories and text files.
Features
Resources
List and access documents via
docs://URIsDocuments can be Git repositories or text files
Plain text mime type for content access
Tools
list_documents- List all available documents in the DOCS_PATH directoryReturns a formatted list of all documents
Shows total number of available documents
rag_query- Query documents using RAGTakes document_id and query as parameters
Returns AI-generated responses with context from documents
add_git_repository- Clone a Git repository to the docs directory with optional sparse checkoutTakes repository_url as parameter
Optional document_name parameter to customize the name of the document (use simple descriptive names without '-docs' suffix)
Optional subdirectory parameter for sparse checkout of specific directories
Automatically pulls latest changes if repository already exists
add_text_file- Download a text file to the docs directoryTakes file_url as parameter
Uses wget to download file
Prompts
guide_documents_usage- Guide on how to use documents and RAG functionalityIncludes list of available documents
Provides usage hints for RAG functionality
Related MCP server: MCP-Typescribe
Development
Install dependencies:
npm installBuild the server:
npm run buildFor development with auto-rebuild:
npm run watchSetup
This server requires a local directory for storing documents. By default, it uses ~/docs but you can configure a different location with the DOCS_PATH environment variable.
Document Structure
The documents directory can contain:
Git repositories (cloned directories)
Plain text files (with .txt extension)
Each document is indexed separately using llama-index.ts with Google's Gemini embeddings.
API Keys
This server uses Google's Gemini API for document indexing and querying. You need to set your Gemini API key as an environment variable:
export GEMINI_API_KEY=your-api-key-hereYou can obtain a Gemini API key from the Google AI Studio website. Add this key to your shell profile or include it in the environment configuration for Claude Desktop.
Installation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
On Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"docs-rag": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-docs-rag"],
"env": {
"DOCS_PATH": "/Users/username/docs",
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}Make sure to replace /Users/username/docs with the actual path to your documents directory.
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspectorThe Inspector will provide a URL to access debugging tools in your browser.
Usage
Once configured, you can use the server with Claude to:
Add documents:
Add a new document from GitHub: https://github.com/username/repositoryor with a custom document name:
Add GitHub repository https://github.com/username/repository-name and name it 'framework'or with sparse checkout of a specific directory:
Add only the 'src/components' directory from https://github.com/username/repositoryor combine custom name and sparse checkout:
Add the 'examples/demo' directory from https://github.com/username/large-repo and name it 'demo-app'or add a text file:
Add this text file: https://example.com/document.txtQuery documents:
What does the documentation say about X in the Y repository?List available documents:
What documents do you have access to?
The server will automatically handle indexing of documents for efficient retrieval.
Available Tools
4 toolsadd_git_repositoryB
Add a git repository to the docs directory with optional sparse checkout. Please do not use 'docs' in the document name.
Inputs: repository_url (required), document_name, subdirectory.
add_text_fileC
Add a text file to the docs directory with a specified name. Please do not use 'docs' in the document name.
Inputs: document_name (required), file_url (required).
list_documentsA
List all available documents in the DOCS_PATH directory. Always use this tool first to check if desired documents already exist before adding new ones.
Inputs: no named parameters.
rag_queryA
Query a document using RAG. Note: If the index does not exist, it will be created when you query, which may take some time.
Inputs: document_id (required), query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: add_git_repository and add_text_file handle different source types for adding documents, list_documents provides discovery, and rag_query enables retrieval. There is no overlap in functionality, making tool selection unambiguous.
All tools follow a consistent verb_noun pattern with snake_case: add_git_repository, add_text_file, list_documents, rag_query. The naming is predictable and readable throughout the set.
Four tools is reasonable for a RAG server focused on document management and querying, though it feels slightly minimal. The count supports core workflows without being overwhelming, but could potentially benefit from additional utilities like document deletion or index management.
The toolset covers adding documents (via git or text), listing, and querying, but lacks update or delete operations for document management. This creates a gap where agents cannot modify or remove documents, which may lead to dead ends in workflows requiring document lifecycle management.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
MCP server for querying Forkast documentation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn 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. Uses Ollama or OpenAI to generate embeddings. Docker files included25 npm30MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to understand and work with TypeScript APIs they haven't been trained on by providing structured access to TypeScript type definitions and documentation.46MIT
- AlicenseBqualityDmaintenanceA complete MCP server for Retrieval-Augmented Generation with file management and vector memory for agents. Supports multiple document formats (PDF, DOCX, TXT, MD, CSV, JSON) with semantic search using Hugging Face embeddings and ChromaDB for efficient vector storage.111MIT
- AlicenseNot gradedqualityDmaintenanceA simple MCP server for local documentation with RAG capabilities, enabling AI assistants to access and search local documents.2MIT
Appeared in Searches
- MCP servers for full-stack development, DevOps, Supabase, QA, and AI agent orchestration
- A server for searching and retrieving information using keyword, semantic, or hybrid search methods
- Semantic search, RAG, and memory systems
- Information about RAG (Retrieval-Augmented Generation) or rag-related topics
- Search for 'aperag' - unclear term or possible misspelling