M

MCP Local RAG

by damoqiongqiu · io.github.damoqiongqiu/mcp-local-rag

A fully local RAG MCP server for semantic code search and code intelligence, using AST-level chunking and hybrid search to pinpoint functions, classes, and APIs. No cloud, no API keys, zero setup.

npm 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-damoqiongqiu-mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "@damoqiongqiu/mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "cwd",
        "BASE_DIRS": "<VALUE>",
        "DB_PATH": "./lancedb/",
        "CACHE_DIR": "./models/",
        "MODEL_NAME": "all-MiniLM-L6-v2",
        "MAX_FILE_SIZE": "100",
        "RAG_MAX_DISTANCE": "<VALUE>",
        "RAG_GROUPING": "<VALUE>",
        "RAG_MAX_FILES": "<VALUE>",
        "CHUNK_MIN_LENGTH": "50",
        "RAG_DEVICE": "cpu",
        "RAG_DTYPE": "fp32",
        "RAG_HYBRID_WEIGHT": "0.6",
        "RAG_WATCH": "<VALUE>",
        "HF_ENDPOINT": "huggingface.co",
        "HF_AUTO_MIRROR": "true",
        "HTTPS_PROXY": "<VALUE>",
        "HTTP_PROXY": "<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-damoqiongqiu-mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "@damoqiongqiu/mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "cwd",
        "BASE_DIRS": "<VALUE>",
        "DB_PATH": "./lancedb/",
        "CACHE_DIR": "./models/",
        "MODEL_NAME": "all-MiniLM-L6-v2",
        "MAX_FILE_SIZE": "100",
        "RAG_MAX_DISTANCE": "<VALUE>",
        "RAG_GROUPING": "<VALUE>",
        "RAG_MAX_FILES": "<VALUE>",
        "CHUNK_MIN_LENGTH": "50",
        "RAG_DEVICE": "cpu",
        "RAG_DTYPE": "fp32",
        "RAG_HYBRID_WEIGHT": "0.6",
        "RAG_WATCH": "<VALUE>",
        "HF_ENDPOINT": "huggingface.co",
        "HF_AUTO_MIRROR": "true",
        "HTTPS_PROXY": "<VALUE>",
        "HTTP_PROXY": "<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-damoqiongqiu-mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "@damoqiongqiu/mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "cwd",
        "BASE_DIRS": "<VALUE>",
        "DB_PATH": "./lancedb/",
        "CACHE_DIR": "./models/",
        "MODEL_NAME": "all-MiniLM-L6-v2",
        "MAX_FILE_SIZE": "100",
        "RAG_MAX_DISTANCE": "<VALUE>",
        "RAG_GROUPING": "<VALUE>",
        "RAG_MAX_FILES": "<VALUE>",
        "CHUNK_MIN_LENGTH": "50",
        "RAG_DEVICE": "cpu",
        "RAG_DTYPE": "fp32",
        "RAG_HYBRID_WEIGHT": "0.6",
        "RAG_WATCH": "<VALUE>",
        "HF_ENDPOINT": "huggingface.co",
        "HF_AUTO_MIRROR": "true",
        "HTTPS_PROXY": "<VALUE>",
        "HTTP_PROXY": "<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-damoqiongqiu-mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "@damoqiongqiu/mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "cwd",
        "BASE_DIRS": "<VALUE>",
        "DB_PATH": "./lancedb/",
        "CACHE_DIR": "./models/",
        "MODEL_NAME": "all-MiniLM-L6-v2",
        "MAX_FILE_SIZE": "100",
        "RAG_MAX_DISTANCE": "<VALUE>",
        "RAG_GROUPING": "<VALUE>",
        "RAG_MAX_FILES": "<VALUE>",
        "CHUNK_MIN_LENGTH": "50",
        "RAG_DEVICE": "cpu",
        "RAG_DTYPE": "fp32",
        "RAG_HYBRID_WEIGHT": "0.6",
        "RAG_WATCH": "<VALUE>",
        "HF_ENDPOINT": "huggingface.co",
        "HF_AUTO_MIRROR": "true",
        "HTTPS_PROXY": "<VALUE>",
        "HTTP_PROXY": "<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-damoqiongqiu-mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "@damoqiongqiu/mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "cwd",
        "BASE_DIRS": "<VALUE>",
        "DB_PATH": "./lancedb/",
        "CACHE_DIR": "./models/",
        "MODEL_NAME": "all-MiniLM-L6-v2",
        "MAX_FILE_SIZE": "100",
        "RAG_MAX_DISTANCE": "<VALUE>",
        "RAG_GROUPING": "<VALUE>",
        "RAG_MAX_FILES": "<VALUE>",
        "CHUNK_MIN_LENGTH": "50",
        "RAG_DEVICE": "cpu",
        "RAG_DTYPE": "fp32",
        "RAG_HYBRID_WEIGHT": "0.6",
        "RAG_WATCH": "<VALUE>",
        "HF_ENDPOINT": "huggingface.co",
        "HF_AUTO_MIRROR": "true",
        "HTTPS_PROXY": "<VALUE>",
        "HTTP_PROXY": "<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-damoqiongqiu-mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "@damoqiongqiu/mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "cwd",
        "BASE_DIRS": "<VALUE>",
        "DB_PATH": "./lancedb/",
        "CACHE_DIR": "./models/",
        "MODEL_NAME": "all-MiniLM-L6-v2",
        "MAX_FILE_SIZE": "100",
        "RAG_MAX_DISTANCE": "<VALUE>",
        "RAG_GROUPING": "<VALUE>",
        "RAG_MAX_FILES": "<VALUE>",
        "CHUNK_MIN_LENGTH": "50",
        "RAG_DEVICE": "cpu",
        "RAG_DTYPE": "fp32",
        "RAG_HYBRID_WEIGHT": "0.6",
        "RAG_WATCH": "<VALUE>",
        "HF_ENDPOINT": "huggingface.co",
        "HF_AUTO_MIRROR": "true",
        "HTTPS_PROXY": "<VALUE>",
        "HTTP_PROXY": "<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
BASE_DIR No Document root (security boundary). The folder you want to search. Default: cwd
BASE_DIRS No JSON array of roots, overrides BASE_DIR. Example: '["/path1","/path2"]'
DB_PATH No Vector database path. Default: ./lancedb/
CACHE_DIR No Model cache directory. Recommend absolute path. Default: ./models/
MODEL_NAME No HuggingFace model ID for embeddings. Default: all-MiniLM-L6-v2
MAX_FILE_SIZE No Max file size in bytes. Default: 100
RAG_MAX_DISTANCE No Maximum distance threshold for search results.
RAG_GROUPING No Grouping strategy: 'similar' or 'related'.
RAG_MAX_FILES No Limit results to top N files.
CHUNK_MIN_LENGTH No Minimum chunk length (1–10000 characters). Default: 50
RAG_DEVICE No ONNX execution device (cpu or webgpu). Default: cpu
RAG_DTYPE No Quantization precision (fp32/fp16/q8). Default: fp32
RAG_HYBRID_WEIGHT No Keyword boost weight: 0 = semantic only, 1 = keyword only. Default: 0.6
RAG_WATCH No File watching (true/1 enables).
HF_ENDPOINT No Manual mirror override for HuggingFace. Default: huggingface.co
HF_AUTO_MIRROR No Auto-detection of mirror (true/1 enables, false disables). Default: true
HTTPS_PROXY No Model download proxy. Example: http://127.0.0.1:7890
HTTP_PROXY No HTTP proxy URL for downloading embedding models. Fallback if HTTPS_PROXY is not set.

Similar servers