R

RAG MCP

by MasihMoafi · io.github.MasihMoafi/rag-mcp

A local hybrid-search MCP server that enables coding agents to query files and folders using natural language, returning relevant code chunks with exact source paths. Everything runs on-device with no API keys or network calls.

pypi Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-masihmoafi-rag-mcp": {
      "command": "uvx",
      "args": [
        "ragmcp-cli"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<YOUR_VALUE>",
        "RAG_MCP_RRF_K": "60",
        "RAG_MCP_TOP_K": "5",
        "RAG_MCP_MAX_DEPTH": "20",
        "RAG_MCP_CHUNK_SIZE": "700",
        "RAG_MCP_MAX_TOKENS": "2000000",
        "RAG_MCP_EMBED_MODEL": "all-MiniLM-L6-v2",
        "RAG_MCP_RERANK_TOP_K": "5",
        "RAG_MCP_CHUNK_OVERLAP": "100",
        "RAG_MCP_EMBED_API_KEY": "<VALUE>",
        "RAG_MCP_RERANKER_TYPE": "cross-encoder",
        "RAG_MCP_EMBED_BASE_URL": "<VALUE>",
        "RAG_MCP_EMBED_PROVIDER": "sentencetransformer",
        "RAG_MCP_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "RAG_MCP_WORKSPACE_ROOT": "<VALUE>"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-masihmoafi-rag-mcp": {
      "command": "uvx",
      "args": [
        "ragmcp-cli"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<YOUR_VALUE>",
        "RAG_MCP_RRF_K": "60",
        "RAG_MCP_TOP_K": "5",
        "RAG_MCP_MAX_DEPTH": "20",
        "RAG_MCP_CHUNK_SIZE": "700",
        "RAG_MCP_MAX_TOKENS": "2000000",
        "RAG_MCP_EMBED_MODEL": "all-MiniLM-L6-v2",
        "RAG_MCP_RERANK_TOP_K": "5",
        "RAG_MCP_CHUNK_OVERLAP": "100",
        "RAG_MCP_EMBED_API_KEY": "<VALUE>",
        "RAG_MCP_RERANKER_TYPE": "cross-encoder",
        "RAG_MCP_EMBED_BASE_URL": "<VALUE>",
        "RAG_MCP_EMBED_PROVIDER": "sentencetransformer",
        "RAG_MCP_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "RAG_MCP_WORKSPACE_ROOT": "<VALUE>"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-masihmoafi-rag-mcp": {
      "command": "uvx",
      "args": [
        "ragmcp-cli"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<YOUR_VALUE>",
        "RAG_MCP_RRF_K": "60",
        "RAG_MCP_TOP_K": "5",
        "RAG_MCP_MAX_DEPTH": "20",
        "RAG_MCP_CHUNK_SIZE": "700",
        "RAG_MCP_MAX_TOKENS": "2000000",
        "RAG_MCP_EMBED_MODEL": "all-MiniLM-L6-v2",
        "RAG_MCP_RERANK_TOP_K": "5",
        "RAG_MCP_CHUNK_OVERLAP": "100",
        "RAG_MCP_EMBED_API_KEY": "<VALUE>",
        "RAG_MCP_RERANKER_TYPE": "cross-encoder",
        "RAG_MCP_EMBED_BASE_URL": "<VALUE>",
        "RAG_MCP_EMBED_PROVIDER": "sentencetransformer",
        "RAG_MCP_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "RAG_MCP_WORKSPACE_ROOT": "<VALUE>"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-masihmoafi-rag-mcp": {
      "command": "uvx",
      "args": [
        "ragmcp-cli"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<YOUR_VALUE>",
        "RAG_MCP_RRF_K": "60",
        "RAG_MCP_TOP_K": "5",
        "RAG_MCP_MAX_DEPTH": "20",
        "RAG_MCP_CHUNK_SIZE": "700",
        "RAG_MCP_MAX_TOKENS": "2000000",
        "RAG_MCP_EMBED_MODEL": "all-MiniLM-L6-v2",
        "RAG_MCP_RERANK_TOP_K": "5",
        "RAG_MCP_CHUNK_OVERLAP": "100",
        "RAG_MCP_EMBED_API_KEY": "<VALUE>",
        "RAG_MCP_RERANKER_TYPE": "cross-encoder",
        "RAG_MCP_EMBED_BASE_URL": "<VALUE>",
        "RAG_MCP_EMBED_PROVIDER": "sentencetransformer",
        "RAG_MCP_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "RAG_MCP_WORKSPACE_ROOT": "<VALUE>"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-masihmoafi-rag-mcp": {
      "command": "uvx",
      "args": [
        "ragmcp-cli"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<YOUR_VALUE>",
        "RAG_MCP_RRF_K": "60",
        "RAG_MCP_TOP_K": "5",
        "RAG_MCP_MAX_DEPTH": "20",
        "RAG_MCP_CHUNK_SIZE": "700",
        "RAG_MCP_MAX_TOKENS": "2000000",
        "RAG_MCP_EMBED_MODEL": "all-MiniLM-L6-v2",
        "RAG_MCP_RERANK_TOP_K": "5",
        "RAG_MCP_CHUNK_OVERLAP": "100",
        "RAG_MCP_EMBED_API_KEY": "<VALUE>",
        "RAG_MCP_RERANKER_TYPE": "cross-encoder",
        "RAG_MCP_EMBED_BASE_URL": "<VALUE>",
        "RAG_MCP_EMBED_PROVIDER": "sentencetransformer",
        "RAG_MCP_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "RAG_MCP_WORKSPACE_ROOT": "<VALUE>"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-masihmoafi-rag-mcp": {
      "command": "uvx",
      "args": [
        "ragmcp-cli"
      ],
      "env": {
        "OPENROUTER_API_KEY": "<YOUR_VALUE>",
        "RAG_MCP_RRF_K": "60",
        "RAG_MCP_TOP_K": "5",
        "RAG_MCP_MAX_DEPTH": "20",
        "RAG_MCP_CHUNK_SIZE": "700",
        "RAG_MCP_MAX_TOKENS": "2000000",
        "RAG_MCP_EMBED_MODEL": "all-MiniLM-L6-v2",
        "RAG_MCP_RERANK_TOP_K": "5",
        "RAG_MCP_CHUNK_OVERLAP": "100",
        "RAG_MCP_EMBED_API_KEY": "<VALUE>",
        "RAG_MCP_RERANKER_TYPE": "cross-encoder",
        "RAG_MCP_EMBED_BASE_URL": "<VALUE>",
        "RAG_MCP_EMBED_PROVIDER": "sentencetransformer",
        "RAG_MCP_RERANKER_MODEL": "cross-encoder/ms-marco-MiniLM-L-6-v2",
        "RAG_MCP_WORKSPACE_ROOT": "<VALUE>"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
OPENROUTER_API_KEY secret No OpenRouter key for answer synthesis and hosted reranking; exact-word search works without it
RAG_MCP_RRF_K No Reciprocal Rank Fusion constant. Default: 60
RAG_MCP_TOP_K No Candidates pulled from vector search before fusion. Default: 5
RAG_MCP_MAX_DEPTH No Directory-scan depth limit. Default: 20
RAG_MCP_CHUNK_SIZE No Characters per chunk before overlap. Default: 700
RAG_MCP_MAX_TOKENS No Directory-scan size limit. Default: 2000000
RAG_MCP_EMBED_MODEL No Embedding model name, meaning depends on provider. Default: all-MiniLM-L6-v2
RAG_MCP_RERANK_TOP_K No Results kept after reranking. Default: 5
RAG_MCP_CHUNK_OVERLAP No Characters shared between adjacent chunks. Default: 100
RAG_MCP_EMBED_API_KEY No API key, only used by openai_compatible provider.
RAG_MCP_RERANKER_TYPE No Reranker type: cross-encoder or disabled. Default: cross-encoder
RAG_MCP_EMBED_BASE_URL No Override endpoint for openai_compatible provider. Defaults to official OpenAI endpoint.
RAG_MCP_EMBED_PROVIDER No Embedding provider to use: sentencetransformer (local), ollama (local server), or openai_compatible (remote). Default: sentencetransformer
RAG_MCP_RERANKER_MODEL No Reranker model, used when type is cross-encoder. Default: cross-encoder/ms-marco-MiniLM-L-6-v2
RAG_MCP_WORKSPACE_ROOT No The root directory to search by default. Can be overridden with the doc_path parameter. If unset, the server uses the current working directory.

Similar servers