# Docs RAG

> Docs RAG is an open-source MCP server for files and documents. Local RAG server that lets Claude, Copilot or Cursor search your own documents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, VS Code, macOS, Windows, Linux, Self-hosted
- **Repository:** https://github.com/ahmed-manai/docs-rag-mcp
- **MCP Registry name:** io.github.Ahmed-Manai/docs-rag-mcp
- **Categories:** [files and documents](https://ai-powered.com/categories/files-and-documents), [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-27

## About

Docs RAG is a Model Context Protocol server written in C# that gives an AI assistant a searchable index of your own Markdown, text, HTML, Word and PDF files. Point it at a folder and it splits each file at headings or pages, embeds the passages and stores them in a single SQLite file, so answers can be drawn from your notes rather than from the model's general knowledge.

When you ask a question, the assistant calls the search tool and receives the closest passages together with their file path and section, so answers can cite where they came from. Search blends meaning-based and keyword ranking, which helps with exact terms like API names and error codes. Indexed folders are watched and re-synced when files change, and re-indexing only re-embeds files whose content changed.

The server can run fully locally with Ollama, or use OpenAI or Azure OpenAI embeddings. It is aimed at developers and teams who want to query documentation or personal notes from inside Claude Desktop, VS Code with Copilot or Cursor, and who want to limit which folders the server is allowed to read.

## Features

- **Local embeddings with Ollama:** Builds and queries the index with a local Ollama model so documents need not leave the machine.
- **Hybrid meaning and keyword search:** Ranks passages by embedding similarity blended with full-text keyword matching.
- **Source-cited passages:** Each result includes its file path and heading or PDF page so answers can be traced back.
- **Automatic folder watching:** Watches indexed folders and picks up new, edited and deleted files without manual re-indexing.
- **Indexed files as resources:** Clients that support MCP resources can list indexed files and attach whole documents to a conversation.
- **Folder access limits:** An allowed-paths setting restricts which folders the server may index and read.

## Good for

- Asking an assistant questions about a team handbook or internal policy documents
- Querying a folder of Markdown project notes or API docs from inside an editor
- Searching saved web pages or generated documentation sites by meaning
- Attaching a specific local document to a chat without copying it in by hand
- Keeping a private personal knowledge base searchable without sending files to a cloud service

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add docs-rag-mcp --env DOCSRAG_API_KEY='<DOCSRAG_API_KEY>' --env DOCSRAG_RERANK_API_KEY='<DOCSRAG_RERANK_API_KEY>' -- dnx DocsRagMcp --yes
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add docs-rag-mcp --env DOCSRAG_API_KEY='<DOCSRAG_API_KEY>' --env DOCSRAG_RERANK_API_KEY='<DOCSRAG_RERANK_API_KEY>' -- dnx DocsRagMcp --yes
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.docs-rag-mcp]
command = "dnx"
args = ["DocsRagMcp", "--yes"]
env = { DOCSRAG_API_KEY = "<DOCSRAG_API_KEY>", DOCSRAG_RERANK_API_KEY = "<DOCSRAG_RERANK_API_KEY>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e DOCSRAG_API_KEY='<DOCSRAG_API_KEY>' -e DOCSRAG_RERANK_API_KEY='<DOCSRAG_RERANK_API_KEY>' docs-rag-mcp dnx -- DocsRagMcp --yes

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "docs-rag-mcp": {
      "command": "dnx",
      "args": [
        "DocsRagMcp",
        "--yes"
      ],
      "env": {
        "DOCSRAG_API_KEY": "<DOCSRAG_API_KEY>",
        "DOCSRAG_RERANK_API_KEY": "<DOCSRAG_RERANK_API_KEY>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 1 of 4 tools deletes data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `index_folder`: Indexes the Markdown, text, HTML, Word and PDF files in a folder and its subfolders.
- `search_docs` (name suggests: reads): Returns the passages closest in meaning to a question, with file, section and score.
- `list_sources` (name suggests: reads): Shows the index location, size, embedding model, indexed files and watched folders.
- `remove_from_index` (name suggests: deletes): Removes a file or folder from the index and stops watching it.

## FAQ

### Which document formats can Docs RAG index?

Markdown, plain text, HTML, Word (.docx) and PDF files, including files in subfolders.

### Do my documents leave my machine?

With the default Ollama provider, documents and questions stay local. OpenAI and Azure OpenAI providers send text to those services for embeddings.

### How do I install Docs RAG?

It is published on NuGet and the MCP Registry and is started with dnx, which comes with the .NET 10 SDK. Config snippets are provided for Claude Desktop, VS Code, Cursor and Claude Code.

### Can Docs RAG modify my files?

No. It only reads files and writes its own index database.

### Is Docs RAG free?

Yes. Docs RAG is open source, so you can use and self-host it for free.

### How do I add Docs RAG to Claude Code?

Run this command in your terminal: claude mcp add docs-rag-mcp --env DOCSRAG_API_KEY='<DOCSRAG_API_KEY>' --env DOCSRAG_RERANK_API_KEY='<DOCSRAG_RERANK_API_KEY>' -- dnx DocsRagMcp --yes

### What are the best alternatives to Docs RAG?

The closest alternatives to Docs RAG are Rag Vault, OmniClip RAG, MCP Local Rag, RootMind and OmniClip RAG.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Rag Vault](https://ai-powered.com/mcp/rag-vault): Rag Vault is an open-source MCP server for knowledge and memory.
- [OmniClip RAG](https://ai-powered.com/mcp/omniclip-rag-2): OmniClip RAG is an open-source MCP server for files and documents.
- [MCP Local Rag](https://ai-powered.com/mcp/mcp-local-rag-2): MCP Local Rag is an open-source MCP server for knowledge and memory.
- [RootMind](https://ai-powered.com/mcp/rootmind): RootMind is an open-source MCP server for knowledge and memory.
- [OmniClip RAG](https://ai-powered.com/mcp/omniclip-rag): OmniClip RAG is an open-source MCP server for files and documents.
- [Rag](https://ai-powered.com/mcp/rag): Rag is an open-source MCP server for knowledge and memory.
- [rag-mcp](https://ai-powered.com/mcp/rag-mcp): rag-mcp is an open-source MCP server for knowledge and memory.
- [RAG for your documents](https://ai-powered.com/mcp/rag-for-your-documents): RAG for your documents is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/docs-rag
