DocMesh MCP
Indexes public documentation sites into PostgreSQL and exposes retrieval-only MCP tools for listing sources, searching with citations, and fetching documents.
README
DocMesh MCP
DocMesh indexes multiple public documentation sites into PostgreSQL and exposes cited passages through one MCP server. It is retrieval-only: it does not answer the technical question or mutate sources through MCP.
Architecture
The ingestion plane validates and DNS-pins public URLs, discovers pages from sitemaps or same-origin links, extracts article Markdown, chunks by headings, embeds changed chunks, and updates each document transactionally. The query plane routes a query to up to three sources, runs exact-symbol, PostgreSQL full-text, and pgvector searches, then combines ranks with reciprocal-rank fusion. See ARCHITECTURE.md.
Prerequisites and setup
- Node.js 22+ (Node 24 LTS works)
- pnpm 10+
- Docker, or PostgreSQL 17 with pgvector
pnpm install
cp .env.example .env
docker compose up -d
pnpm migrate
The checked-in migration uses vector(1536), matching .env.example. To change embedding dimensions safely, create a migration that rebuilds the vector column and HNSW index, set EMBEDDING_DIMENSION, then re-ingest all documents. Do not change only the environment variable.
Sources, ingestion, and search
pnpm cli source add --name AlphaDB --url https://docs.example.com --aliases alpha --tags database
pnpm cli source version:add --source alpha-db --version 2.0 --url https://docs.example.com/v2 --default
pnpm cli source list
pnpm cli ingest --source alpha-db
pnpm cli search --query "How does AlphaClient.connect() retry?"
For checked-in fixtures, no localhost crawl bypass is provided. They are loaded directly from trusted repository files:
pnpm fixtures:ingest
ALLOW_DEBUG=true pnpm cli search --query "Compare AlphaDB and BetaORM transactions" --debug
pnpm eval
MCP
Local stdio configuration:
{
"mcpServers": {
"docmesh": {
"command": "pnpm",
"args": ["--dir", "/absolute/path/to/docmesh-mcp", "mcp:stdio"],
"env": { "DATABASE_URL": "postgres://docmesh:docmesh@localhost:5432/docmesh" }
}
}
}
Remote Streamable HTTP:
pnpm mcp:http
# endpoint: http://127.0.0.1:3000/mcp
The public surface is deliberately small: list_sources, search_docs, get_document, and docs://{sourceId}/{version}/{documentId} resources. Ingestion and arbitrary fetching are CLI-only.
Configuration
.env.example documents all variables. Core groups are database connection, embedding provider/model/dimension, optional OpenAI router and timeout, crawler limits, HTTP port, Playwright fallback, logging, and development debug output. Without an API key, fake deterministic embeddings and deterministic routing keep local tests credential-free. For useful production semantic retrieval, select the OpenAI embedding provider and re-ingest.
Playwright is installed as an optional package but browser binaries are not downloaded automatically. If rendering is enabled, run pnpm exec playwright install chromium explicitly.
Checks
pnpm format:check
pnpm lint
pnpm typecheck
pnpm test
Database integration tests are enabled with TEST_DATABASE_URL:
TEST_DATABASE_URL=postgres://docmesh:docmesh@localhost:5432/docmesh pnpm test
Security
Crawling arbitrary URLs is dangerous. DocMesh permits only HTTP(S), rejects credentials and private/loopback/link-local/multicast/reserved/metadata addresses, pins validated DNS answers for each request, revalidates every redirect, limits redirects/time/bytes/pages/depth, accepts textual content types, and restricts recursive links to configured origins and path prefixes. Playwright validates every browser request but browser-level DNS pinning depends on Chromium; keep it disabled for untrusted sources unless the deployment also enforces outbound network policy.
Known limitations
- HTML heuristics cover common documentation layouts, not every JavaScript framework.
- HTTP validators are stored, but conditional
If-None-Match/If-Modified-Sincerequests are not yet issued; normalized hashes still prevent re-embedding unchanged content. - Sequential fetching deliberately favors politeness and simplicity over large-crawl throughput.
- The router cache is process-local only through provider/client behavior; a durable routing cache is not included in the MVP.
- Remote deployment needs authentication, TLS, rate limiting, and network egress controls in front of the MCP endpoint.
Highest-value next improvements: conditional HTTP recrawls, a bounded concurrent crawl worker pool, and retrieval evaluation on a larger real documentation corpus.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。