$git clone https://github.com/arabold/docs-mcp-serverDocs 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 e
| 1 | # Grounded Docs: Your AI's Up-to-Date Documentation Expert |
| 2 | |
| 3 | **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. |
| 4 | |
| 5 |  |
| 6 | |
| 7 | ## ✨ Why Grounded Docs MCP Server? |
| 8 | |
| 9 | The open-source alternative to **Context7**, **Nia**, and **Ref.Tools**. |
| 10 | |
| 11 | - ✅ **Up-to-Date Context:** Fetches documentation directly from official sources on demand. |
| 12 | - 🎯 **Version-Specific:** Queries target the exact library versions in your project. |
| 13 | - 💡 **Reduces Hallucinations:** Grounds LLMs in real documentation. |
| 14 | - 🔒 **Private & Local:** Runs entirely on your machine; your code never leaves your network. |
| 15 | - 🧩 **Broad Compatibility:** Works with any MCP-compatible client (Claude, Cline, etc.). |
| 16 | - 📁 **Multiple Sources:** Index websites, GitHub repositories, local folders, and zip archives. |
| 17 | - 📄 **Rich File Support:** Processes HTML, Markdown, PDF, Office documents (Word, Excel, PowerPoint), OpenDocument, RTF, EPUB, Jupyter Notebooks, and [90+ source code languages](docs/concepts/supported-formats.md). |
| 18 | |
| 19 | --- |
| 20 | |
| 21 | ## 📄 Supported Formats |
| 22 | |
| 23 | | Category | Formats | |
| 24 | |----------|---------| |
| 25 | | **Documents** | PDF, Word (.docx/.doc), Excel (.xlsx/.xls), PowerPoint (.pptx/.ppt), OpenDocument (.odt/.ods/.odp), RTF, EPUB, FictionBook, Jupyter Notebooks | |
| 26 | | **Archives** | ZIP, TAR, gzipped TAR (contents are extracted and processed individually) | |
| 27 | | **Web** | HTML, XHTML | |
| 28 | | **Markup** | Markdown, MDX, reStructuredText, AsciiDoc, Org Mode, Textile, R Markdown | |
| 29 | | **Source Code** | TypeScript, JavaScript, Python, Go, Rust, C/C++, Java, Kotlin, Ruby, PHP, Swift, C#, and [many more](docs/concepts/supported-formats.md#source-code) | |
| 30 | | **Data** | JSON, YAML, TOML, CSV, XML, SQL, GraphQL, Protocol Buffers | |
| 31 | | **Config** | Dockerfile, Makefile, Terraform/HCL, INI, dotenv, Bazel | |
| 32 | |
| 33 | See **[Supported Formats](docs/concepts/supported-formats.md)** for the complete reference including MIME types and processing details. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## 🚀 Quick Start |
| 38 | |
| 39 | ### CLI First |
| 40 | |
| 41 | For agents and scripts, the CLI is usually the simplest way to use Grounded Docs. |
| 42 | |
| 43 | **1. Index documentation** (requires Node.js 22+): |
| 44 | |
| 45 | ```bash |
| 46 | npx @arabold/docs-mcp-server@latest scrape react https://react.dev/reference/react |
| 47 | ``` |
| 48 | |
| 49 | For hash-routed SPA docs sites, enable hash preservation explicitly: |
| 50 | |
| 51 | ```bash |
| 52 | npx @arabold/docs-mcp-server@latest scrape my-spa https://docs.example.com/#/guide --preserve-hashes |
| 53 | ``` |
| 54 | |
| 55 | **2. Query the index:** |
| 56 | |
| 57 | ```bash |
| 58 | npx @arabold/docs-mcp-server@latest search react "useEffect cleanup" --output yaml |
| 59 | ``` |
| 60 | |
| 61 | **3. Fetch a single page as Markdown:** |
| 62 | |
| 63 | ```bash |
| 64 | npx @arabold/docs-mcp-server@latest fetch-url https://react.dev/reference/react/useEffect |
| 65 | ``` |
| 66 | |
| 67 | ### Output Behavior |
| 68 | |
| 69 | - Structured commands default to clean JSON on stdout in non-interactive runs. |
| 70 | - Use `--output json|yaml|toon` to pick a structured format. |
| 71 | - Plain-text commands such as `fetch-url` keep their text payload on stdout. |
| 72 | - Diagnostics go through the shared logger and are kept off stdout in non-interactive runs. |
| 73 | - Use `--quiet` to suppress non-error diagnostics or `--verbose` to enable debug output. |
| 74 | |
| 75 | ### Agent Skills |
| 76 | |
| 77 | The [`skills/`](skills/) directory contains [Agent Skills](https://agentskills.io) that teach AI coding assistants how to use the CLI — covering documentation search, index management, and URL fetching. |
| 78 | |
| 79 | ### MCP Server |
| 80 | |
| 81 | If you want a long-running MCP endpoint for Claude, Cline, Copilot, Gemini CLI, or other MCP clients: |
| 82 | |
| 83 | **1. Start the server:** |
| 84 | |
| 85 | ```bash |
| 86 | npx @arabold/docs-mcp-server@latest |
| 87 | ``` |
| 88 | |
| 89 | **2. Open the Web UI** at **[http://localhost:6280](http://localhost:6280)** to add documentation. |
| 90 | |
| 91 | **3. Connect your AI client** by adding this to your MCP settings (e.g., `claude_desktop_config.json`): |
| 92 | |
| 93 | ```json |
| 94 | { |
| 95 | "mcpServers": { |
| 96 | "docs-m |