DocMCP

DocMCP

Index any documentation website and search it from AI coding assistants via the Model Context Protocol (MCP).

Category
访问服务器

README

DocMCP

Index any documentation website and search it from AI coding assistants via the Model Context Protocol (MCP).

Features

  • Crawl & Index: Automatically crawl documentation sites via sitemap or recursive links
  • Hybrid Search: Combines BM25 keyword search with vector embeddings for best results
  • MCP Integration: Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible tool
  • Multiple Providers: Anthropic (Voyage), OpenAI, or BM25-only (zero setup)
  • Cross-Platform: Works on macOS, Linux, and Windows

Installation

npm install -g @pieeee/docmcp

Requirements

  • Node.js 20+
  • One of: Anthropic API key, OpenAI API key, or use BM25-only mode (no API needed)

Quick Start

# Initial setup
docmcp init

# Index a documentation site
docmcp add https://tailwindcss.com/docs

# List indexed docs
docmcp list

MCP Configuration

Claude Code

claude mcp add docmcp -- docmcp serve

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "docmcp": {
      "command": "docmcp",
      "args": ["serve"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "docmcp": {
      "command": "docmcp",
      "args": ["serve"]
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "docmcp": {
      "command": "docmcp",
      "args": ["serve"]
    }
  }
}

CLI Commands

Command Description
docmcp init Setup wizard - configure embedding provider and data directory
docmcp add <url> Crawl and index a documentation site
docmcp list Show all indexed documentation
docmcp remove <name> Remove indexed documentation
docmcp serve Start MCP server (stdio transport)

Add Command Options

docmcp add <url> [options]

Options:
  -n, --name <name>           Override auto-detected doc name
  -d, --depth <number>        Max crawl depth (default: 10)
  -m, --max-pages <number>    Max pages to crawl (default: unlimited)
  -i, --include <pattern...>  Only crawl URLs matching pattern (glob)
  -e, --exclude <pattern...>  Skip URLs matching pattern (glob)
  --delay <ms>                Delay between requests (default: 200)
  --concurrency <number>      Parallel requests (default: 3)
  --no-sitemap                Skip sitemap, force recursive crawl
  --openapi                   Treat URL as OpenAPI/Swagger JSON spec

OpenAPI/Swagger Support

You can index OpenAPI specs directly:

docmcp add https://api.example.com/openapi.json --openapi
docmcp add https://petstore.swagger.io/v2/swagger.json --openapi

This parses the spec and indexes all endpoints, parameters, and schemas for search.

MCP Tools

When connected as an MCP server, DocMCP exposes these tools:

Tool Description
search_docs Search indexed documentation with hybrid BM25 + vector search
list_docs List all indexed documentation sources

search_docs

Search your indexed documentation:

search_docs(query: "how to center a div", doc?: "Tailwind", limit?: 5)

Parameters:

  • query (required): Search query
  • doc (optional): Filter to specific documentation
  • limit (optional): Max results (default: 5)

Embedding Providers

Provider API Key Required Notes
anthropic ANTHROPIC_API_KEY Uses Voyage AI embeddings (recommended)
openai OPENAI_API_KEY Uses text-embedding-3-small
bm25only None Keyword search only, zero setup

Set your API key as an environment variable or enter it during docmcp init.

Data Storage

All data is stored in ~/.docmcp/:

~/.docmcp/
├── config.json    # Configuration (API keys stored here)
└── db/
    └── docs.db    # SQLite database with FTS5 + vector search

Platform Support

Platform Status Notes
macOS (Intel) Full
macOS (Apple Silicon) Full
Linux (x64) Full
Linux (ARM64) Full
Windows (x64) Full May require build tools for native modules

Windows Prerequisites

If installation fails on Windows due to native module compilation:

  1. Install Visual Studio Build Tools
  2. Or run: npm install --global windows-build-tools
  3. Retry: npm install -g docmcp

How It Works

  1. Crawl: DocMCP crawls documentation sites using sitemap or recursive link following
  2. Parse: HTML is cleaned and converted to Markdown, preserving code blocks
  3. Chunk: Content is split at heading boundaries into ~512 token chunks
  4. Index: Chunks are stored in SQLite with FTS5 (BM25) and vector embeddings
  5. Search: Queries use hybrid search combining keyword and semantic matching

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT - see LICENSE for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选