MCP Local Rag logo

MCP Local Rag

by nkapila6

Local MCP web search with on-device ranking, passage extraction, full-page retrieval, and multi-engine research.

Install MCP Local Rag

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "nkapila6-mcp-local-rag": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/nkapila6/mcpsurfr",
        "mcpsurfr"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

nkapila6/mcp-local-rag MCP server gives LLM clients local web search through DuckDuckGo and other backends, without requiring search API keys. It ranks results on the host using a small MobileBERT model and NumPy, extracts main page content, and returns relevant passages or full-page text with URLs. Use it for current-information lookups, technical research, and multi-query investigations where local result ranking and deduplication are useful. The project now uses the mcpsurfr name, while the older command and configuration URL remain supported.

Use cases

  • Search the current web for information beyond a model's training data
  • Retrieve relevant passages from technical documentation
  • Compare results from multiple search engines
  • Run multi-query research with deduplicated sources

Key features

  • Local semantic reranking with MobileBERT and NumPy
  • DuckDuckGo, Google, and multi-backend web search
  • Passage extraction with BM25 and relevance ranking
  • Full-page retrieval with cleaned main content
  • Duplicate removal and result warnings
  • Deep research across multiple search terms

Tools5

What MCP Local Rag lets your agent do. Expand a tool for its parameters.

Verified live~1.4k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

21/21 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · mcpsurfr (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars144Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Tools exposed5Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Local Rag works

What nkapila6/mcp-local-rag MCP server does

nkapila6/mcp-local-rag brings web search into MCP-compatible LLM clients without requiring API keys. Search requests use the ddgs package and can query several engines, while ranking and result selection happen locally. The server can return targeted passages, complete page text, or a consolidated research result assembled from multiple searches.

Its main search modes are:

  • search returns relevant passages, with optional keyword hints, rather than entire pages.
  • rag_search_ddgs retrieves full pages through DuckDuckGo-backed search and orders them by semantic relevance.
  • rag_search_google performs the corresponding Google-backed search and can fall back to automatic engine selection when Google blocks a request.
  • deep_research combines several search terms across selected backends, removes duplicates, and ranks the collected material.
  • deep_research_ddgs and deep_research_google provide DuckDuckGo-only and Google-only shortcuts.

The server also provides a search skill and a research(topic) prompt. These help clients select tools and backends, plan multiple queries, and produce cited summaries.

How it works

The server first obtains search results through ddgs. In automatic mode, the package can try several engines and skip engines that are blocked. Search results are initially selected from their snippets, then pages may be fetched and divided into passages. Keyword matching uses BM25; when that is insufficient or returns too many candidates, a MobileBERT embedding model running with NumPy ranks passages by meaning.

Fetched pages are processed to retain their main content instead of navigation elements, cookie notices, or footers. Code blocks and tables preserve their lines. Duplicate pages found under different URLs are merged. The response includes page URLs and can identify skipped pages, truncation, fallback behavior, and engine failures through reasons or warnings.

Setup and configuration

A stdio configuration can run the server with uvx directly from the Git repository:

config.json
{
  "mcpServers": {
    "mcpsurfr": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/nkapila6/mcpsurfr", "mcpsurfr"]
    }
  }
}

Docker is also supported on amd64 and arm64:

config.json
{
  "mcpServers": {
    "mcpsurfr": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "--init", "ghcr.io/nkapila6/mcpsurfr:latest"]
    }
  }
}

The project was tested with Claude Desktop, Claude Code, Cursor, and Goose. Existing mcp-local-rag configurations continue to work because the former URL redirects and the mcp-local-rag command remains available. The renamed configuration uses the mcpsurfr command and removes the former Python 3.10 pin.

Full-page tools use a 40,000-character limit per call by default. Set MCPSURFR_MAX_CHARS in the MCP server environment to change that limit, for example 80000.

Tools and capabilities

Supported research backends include automatic multi-engine selection, Brave, DuckDuckGo, Google, Grokipedia, Mojeek, Startpage, Wikipedia, and Yahoo. The available tool description also lists Bing and Yandex as selectable backends. DuckDuckGo is suitable for privacy-focused general searches, Google for broad or technical coverage, Wikipedia for encyclopedia-style facts, and multiple backends for wider coverage.

The deep_research workflow accepts multiple terms, aggregates results, ranks them, and removes duplicates. Full-page responses share the character budget, while passage-oriented search can substantially reduce the amount of text returned to the model. Search output can also indicate when a page was blocked, is a PDF, duplicated another result, or was truncated.

Limitations and notes

Web access still depends on the selected engines and the pages they expose. Google may block requests, in which case Google-backed search can fall back to automatic search. Some pages may be skipped because they are blocked, PDFs, duplicates, or otherwise unsuitable for extraction. The server is intended for local ranking and retrieval; its results are search context for an LLM rather than a guarantee of source completeness or correctness.

The project is MIT licensed and was formerly published under the mcp-local-rag name.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Local Rag

nkapila6/mcp-local-rag is an MCP server that connects LLM clients to web search backends through ddgs. Its main tools include passage-oriented search, DuckDuckGo and Google retrieval, and deep research across multiple queries, with local relevance ranking, page extraction, deduplication, URLs, and warnings.

Install it through an MCP client using `uvx` or Docker. The uvx configuration runs `mcpsurfr` from the Git repository, while Docker uses the `ghcr.io/nkapila6/mcpsurfr:latest` image with interactive input enabled.

Yes, Cursor is one of the clients tested with the server. Add its stdio configuration to Cursor's MCP settings, using either the `uvx` command or the Docker command shown for the renamed `mcpsurfr` project.

Set `MCPSURFR_MAX_CHARS` in the server environment. Full-page tools default to a 40,000-character budget per call; setting the variable to a larger value such as `80000` raises that limit.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Local Rag AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/nkapila6-mcp-local-rag?style=directory)](https://allmcps.com/mcp/nkapila6-mcp-local-rag)
HTML Embed
<a href="https://allmcps.com/mcp/nkapila6-mcp-local-rag"><img src="https://allmcps.com/api/badge/nkapila6-mcp-local-rag?style=directory" alt="MCP Local Rag on AllMCPs" /></a>