Sandbox
@arabold/docs-mcp-server

MCP server for current documentation search

This project indexes documentation from websites, GitHub, npm, PyPI, local folders, and archives, then serves it through an MCP endpoint and a CLI. Your agent can scrape docs, search the index, and fetch a page as Markdown, with optional embeddings for better semantic search.

1,724 stars182 forksTypeScriptUpdated 19d ago
Who it's for

Builders who want their agent to use current documentation instead of outdated model memory.

What it delivers

You can ground agent answers in the exact docs and versions your project uses.

What it does

Index docs from many sources

Scrapes websites, GitHub repositories, npm packages, PyPI packages, local folders, and zip archives into one searchable index.

Version-specific search

Lets you query the documentation for the exact library version in your project.

MCP server for agent clients

Exposes the index through an MCP endpoint that works with Claude, Cline, Copilot, Gemini CLI, and other MCP clients.

CLI for scraping and querying

Includes commands to scrape docs, search the index, and fetch a single URL as Markdown.

Agent skills bundle

Ships skills in `skills/` that teach agents how to use the CLI for search, index management, and URL fetching.

Local and private deployment

Runs on your machine with Docker or Node.js so your code and documents stay local.

Embedding-based semantic search

Supports optional embedding models like OpenAI, Ollama, Gemini, and Azure to improve retrieval quality.

How to get it

  1. 11. Index documentation (requires Node.js 22+)
    npx @arabold/docs-mcp-server@latest scrape react https://react.dev/reference/react
  2. 2For hash-routed SPA docs sites, enable hash preservation explicitly
    npx @arabold/docs-mcp-server@latest scrape my-spa https://docs.example.com/#/guide --preserve-hashes
  3. 32. Query the index
    npx @arabold/docs-mcp-server@latest search react "useEffect cleanup" --output yaml
  4. 43. Fetch a single page as Markdown
    npx @arabold/docs-mcp-server@latest fetch-url https://react.dev/reference/react/useEffect
  5. 51. Start the server
    npx @arabold/docs-mcp-server@latest
  6. 6scrape_docs also accepts preserveHashes: true for documentation sites that use…
    docker run --rm \
      -v docs-mcp-data:/data \
      -v docs-mcp-config:/config \
      -p 6280:6280 \
      ghcr.io/arabold/docs-mcp-server:latest \
      --protocol http --host 0.0.0.0 --port 6280

README

Grounded Docs: Your AI's Up-to-Date Documentation Expert

Docs MCP Server solves the problem of AI hallucinations and outdated knowledge by providing a personal, always-current documentation index for your AI coding assistant. It fetches official docs from websites, GitHub, npm, PyPI, and local files, allowing your AI to query the exact version you are using.

Docs MCP Server Web Interface

✨ Why Grounded Docs MCP Server?

The open-source alternative to Context7, Nia, and Ref.Tools.

  • Up-to-Date Context: Fetches documentation directly from official sources on demand.
  • 🎯 Version-Specific: Queries target the exact library versions in your project.
  • 💡 Reduces Hallucinations: Grounds LLMs in real documentation.
  • 🔒 Private & Local: Runs entirely on your machine; your code never leaves your network.
  • 🧩 Broad Compatibility: Works with any MCP-compatible client (Claude, Cline, etc.).
  • 📁 Multiple Sources: Index websites, GitHub repositories, local folders, and zip archives.
  • 📄 Rich File Support: Processes HTML, Markdown, PDF, Office documents (Word, Excel, PowerPoint), OpenDocument, RTF, EPUB, Jupyter Notebooks, and 90+ source code languages.

📄 Supported Formats

CategoryFormats
DocumentsPDF, Word (.docx/.doc), Excel (.xlsx/.xls), PowerPoint (.pptx/.ppt), OpenDocument (.odt/.ods/.odp), RTF, EPUB, FictionBook, Jupyter Notebooks
ArchivesZIP, TAR, gzipped TAR (contents are extracted and processed individually)
WebHTML, XHTML
MarkupMarkdown, MDX, reStructuredText, AsciiDoc, Org Mode, Textile, R Markdown
Source CodeTypeScript, JavaScript, Python, Go, Rust, C/C++, Java, Kotlin, Ruby, PHP, Swift, C#, and many more
DataJSON, YAML, TOML, CSV, XML, SQL, GraphQL, Protocol Buffers
ConfigDockerfile, Makefile, Terraform/HCL, INI, dotenv, Bazel

See Supported Formats for the complete reference including MIME types and processing details.


🚀 Quick Start

CLI First

For agents and scripts, the CLI is usually the simplest way to use Grounded Docs.

1. Index documentation (requires Node.js 22+):

npx @arabold/docs-mcp-server@latest scrape react https://react.dev/reference/react

For hash-routed SPA docs sites, enable hash preservation explicitly:

npx @arabold/docs-mcp-server@latest scrape my-spa https://docs.example.com/#/guide --preserve-hashes

2. Query the index:

npx @arabold/docs-mcp-server@latest search react "useEffect cleanup" --output yaml

3. Fetch a single page as Markdown:

npx @arabold/docs-mcp-server@latest fetch-url https://react.dev/reference/react/useEffect

Output Behavior

  • Structured commands default to clean JSON on stdout in non-interactive runs.
  • Use --output json|yaml|toon to pick a structured format.
  • Plain-text commands such as fetch-url keep their text payload on stdout.
  • Diagnostics go through the shared logger and are kept off stdout in non-interactive runs.
  • Use --quiet to suppress non-error diagnostics or --verbose to enable debug output.

Agent Skills

The skills/ directory contains Agent Skills that teach AI coding assistants how to use the CLI — covering documentation search, index management, and URL fetching.

MCP Server

If you want a long-running MCP endpoint for Claude, Cline, Copilot, Gemini CLI, or other MCP clients:

1. Start the server:

npx @arabold/docs-mcp-server@latest

2. Open the Web UI at http://localhost:6280 to add documentation.

3. Connect your AI client by adding this to your MCP settings (e.g., claude_desktop_config.json):

{
  "mcpServers": {
    "docs-mcp-server": {
      "type": "sse",
      "url": "http://localhost:6280/sse"
    }
  }
}

See Connecting Clients for VS Code (Cline, Roo) and other setup options.

scrape_docs also accepts preserveHashes: true for documentation sites that use hash-based client-side routing. Use it only for hash-routed SPAs; normal sites typically use hash fragments for in-page anchors.

Alternative: Run with Docker
docker run --rm \
  -v docs-mcp-data:/data \
  -v docs-mcp-config:/config \
  -p 6280:6280 \
  ghcr.io/arabold/docs-mcp-server:latest \
  --protocol http --host 0.0.0.0 --port 6280

🧠 Configure Embedding Model (Recommended)

Using an embedding model is optional but dramatically improves search quality by enabling semantic vector search.

Example: Enable OpenAI Embeddings

OPENAI_API_KEY="sk-proj-..." npx @arabold/docs-mcp-server@latest

See Embedding Models for configuring Ollama, Gemini, Azure, and others.


📚 Documentation

Getting Started

  • Installation: Detailed setup guides for Docker, Node.js (npx), and Embedded mode.
  • Connecting Clients: How to connect Claude, VS Code (Cline/Roo), and other MCP clients.
  • Basic Usage: Using the Web UI, CLI, and scraping local files.
  • Configuration: Full reference for config files and environment variables.
  • Supported Formats: Complete file format and MIME type reference.
  • Embedding Models: Configure OpenAI, Ollama, Gemini, and other providers.
  • Search Quality Benchmark: Measure retrieval quality with IR metrics + LLM-judged scores; prerequisites, how to run, how to interpret results.

Hash-Routed SPAs

  • Use --preserve-hashes, MCP preserveHashes, or the Web UI "Preserve Hash Routes" checkbox only for docs sites that route with URLs like #/guide.
  • When enabled with scrapeMode=fetch, the scraper automatically upgrades the job to Playwright because plain fetch cannot evaluate client-side hash routes.
  • Refresh reuses the stored preserveHashes setting by default, and CLI/Web refresh entrypoints can override it explicitly.

Markdown-Optimized Web Scraping

  • Web scrapes and refreshes automatically probe for llms.txt at the documentation subpath and site root before normal crawling. When found, the curated links become additional crawl seeds, and pages discovered this way prefer .md URL variants such as /guide/index.html.md or /page.html.md before falling back to the original page.
  • Web requests send Accept: text/markdown, text/html;q=0.9, */*;q=0.8 by default. Servers that support Markdown content negotiation, including Cloudflare Markdown for Agents, can return Markdown directly so the scraper bypasses HTML-to-Markdown conversion for cleaner output.
  • This behavior is automatic and requires no configuration. Custom Accept headers are preserved when provided.

Key Concepts & Architecture

  • Deployment Modes: Standalone vs. Distributed (Docker Compose).
  • Authentication: Securing your server with OAuth2/OIDC.
  • Security: Trust boundaries, deployment hardening, and outbound access controls.
  • Telemetry: Privacy-first usage data collection.
  • Architecture: Deep dive into the system design.

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for development guidelines and setup instructions.

License

This project is licensed under the MIT License. See LICENSE for details.

Files in the repo

Repository payload40 top-level entries
  • .agent
  • .claude
  • .cline
  • .clinerules
  • .gemini
  • .github
  • .husky
  • .opencode
  • .vitest-config-mock
  • db
  • docs
  • openspec
  • public
  • scripts
  • skills
  • src
  • test
  • tests
  • .dockerignore
  • .env.example
  • .gitignore
  • .nvmrc
  • .releaserc.json
  • AGENTS.md
  • ARCHITECTURE.md
  • biome.json
  • CHANGELOG.md
  • CLAUDE.md
  • commitlint.config.js
  • CONTRIBUTING.md
  • docker-compose.yml
  • Dockerfile
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • tsconfig.build.json
  • tsconfig.json
  • vite.config.ts
  • vite.config.web.ts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k