Mcp Documentation Server

io.github.andrea9293由 GitHub 账号 andrea9293 发布v1.15.3更新于 Oct 25, 2026

Local-first document management and semantic search for AI coding agents

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

本地优先的文档服务器,让 AI 助手存储文档、处理上传文件,并对它们进行混合语义搜索,内置网页仪表盘。

可以做什么
在本地知识库中添加、列出、读取和删除文档,支持元数据与内容预览。处理放入 uploads 文件夹的 .txt、.md、.pdf 文件,进行分块并生成嵌入,并可查看上传路径与文件列表。在单个文档内做向量语义搜索,在所有文档间做全文加向量的混合搜索,并获取匹配分块附近的上下文窗口。配置密钥后可选用 Gemini 驱动的 AI 搜索。端口 3080 上的网页仪表盘提供同样的浏览、上传、搜索和删除操作,所有工具也以 REST API 形式开放。
适用场景
适合希望助手基于本地文件搭建并查询私有、离线文档或知识库,而不依赖云数据库或厂商账号的场景。也适合需要检索项目文档、笔记或 PDF 并获取周边上下文的编程助手。
运行要求
通过 npx 在本地运行(需要 Node.js)。无需账号或 API 密钥,所有环境变量均为可选。GEMINI_API_KEY 可启用 AI 搜索。MCP_BASE_DIR 指定数据目录,网页界面默认绑定 127.0.0.1:3080。嵌入模型首次使用时下载(约 80–420 MB)。
安装前请注意
工具可添加和删除文档,delete_document 还会移除分块、数据库条目及相关文件,删除不可恢复。网页界面和 REST API 会在端口 3080 自动启动;将 WEB_HOST 设为 0.0.0.0 会在所有网络接口上暴露它们。使用 AI 搜索时 GEMINI_API_KEY 会发送给 Google。更换嵌入模型需要重新添加所有文档。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Documentation Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[MCP Registry] [npm version] [GitHub Stars] [License: MIT] [Ask DeepWiki]

[Donate with PayPal] ["Buy Me A Coffee"]

MCP Documentation Server

Local-first document management and semantic search for AI coding agents. No external databases, no cloud APIs, no vendor lock-in.

Unlike other MCP servers that are CLI-only, this one ships with a full web dashboard — browse, search, upload, and manage your knowledge base from your browser. Every MCP tool is also exposed as a REST API, giving AI agents a lean, schema-free interface.

  • 🏠 Runs fully offline — Orama vector DB with local AI embeddings (Transformers.js)
  • 🌐 Built-in Web UI — starts automatically on port 3080 alongside the MCP server
  • 🔍 Hybrid search — full-text + vector similarity with parent-child chunking
  • 🤖 Optional AI search — Google Gemini for advanced document analysis (bring your own key)
  • 📁 Drag & drop uploads — .txt, .md, .pdf support
  • 📦 Published on the MCP Registry — installable via npx, no clone needed

Quick Start

json
{  "mcpServers": {    "documentation": {      "command": "npx",      "args": ["-y", "@andrea9293/mcp-documentation-server"]    }  }}

Open your browser at http://localhost:3080 — the web UI starts automatically.

🤖 Agent Skill (REST API) — recommended for AI agents

Every MCP tool is also accessible via the REST API on http://127.0.0.1:3080/api/. This is the recommended way to interact from AI agents (Claude Code, OpenCode, Gemini CLI, Cursor) because it avoids loading MCP tool schemas into the conversation context — only the response JSON enters.

bash
curl -s http://127.0.0.1:3080/api/configcurl -s http://127.0.0.1:3080/api/documentscurl -s -X POST http://127.0.0.1:3080/api/search-all \  -H "Content-Type: application/json" \  -d '{"query": "your search", "limit": 5}'

A ready-to-use skill is included at skills/documentation-server/SKILL.md — it teaches your agent every endpoint with examples. Install it:

bash
npx skills add https://github.com/andrea9293/mcp-documentation-server --skill documentation-server

Basic workflow

  1. Add documents using add_document or place .txt / .md / .pdf files in the uploads folder and call process_uploads.
  2. Search across everything with search_all_documents, or within a single document with search_documents.
  3. Use get_context_window to fetch neighboring chunks and give the LLM broader context.

Web UI

The web interface starts automatically on port 3080 when the MCP server launches. From the web UI you can:

  • 📊 Dashboard — overview of all documents and stats
  • 📄 Documents — browse, view, and delete documents
  • ➕ Add Document — create documents with title, content, and metadata
  • 🔍 Search All — semantic search across all documents
  • 🎯 Search in Doc — search within a specific document
  • 🤖 AI Search — Gemini-powered analysis (if GEMINI_API_KEY is set)
  • 📁 Upload Files — drag & drop files and process them into the knowledge base
  • 🪟 Context Window — explore chunks around a specific index

Configure an MCP client

Minimal
json
{  "mcpServers": {    "documentation": {      "command": "npx",      "args": ["-y", "@andrea9293/mcp-documentation-server"]    }  }}
With environment variables (all optional)
json
{  "mcpServers": {    "documentation": {      "command": "npx",      "args": ["-y", "@andrea9293/mcp-documentation-server"],      "env": {        "MCP_BASE_DIR": "/path/to/workspace",        "GEMINI_API_KEY": "your-api-key-here",        "MCP_EMBEDDING_MODEL": "Xenova/all-MiniLM-L6-v2",        "START_WEB_UI": "true",        "WEB_HOST": "127.0.0.1",        "WEB_PORT": "3080"      }    }  }}

All environment variables are optional. Without GEMINI_API_KEY, only the local embedding-based search tools are available.

MCP Tools

The server registers the following tools (all validated with Zod schemas):

📄 Document Management

ToolDescription
add_documentAdd a document (title, content, optional metadata)
list_documentsList all documents with metadata and content preview
get_documentRetrieve the full content of a document by ID
delete_documentRemove a document, its chunks, database entries, and associated files

📁 File Processing

ToolDescription
process_uploadsProcess all files in the uploads folder (chunking + embeddings)
get_uploads_pathReturns the absolute path to the uploads folder
list_uploads_filesLists files in the uploads folder with size and format info
get_ui_urlReturns the Web UI URL (e.g. http://localhost:3080) — useful to open the dashboard or to locate the uploads folder from the browser

🔍 Search

ToolDescription
search_documentsSemantic vector search within a specific document
search_all_documentsHybrid (full-text + vector) cross-document search
get_context_windowReturns a window of chunks around a given chunk index
search_documents_with_ai🤖 AI-powered search using Gemini (requires GEMINI_API_KEY)

Configuration

Configure via environment variables or a .env file in the project root:

VariableDefaultDescription
MCP_BASE_DIR~/.mcp-documentation-serverBase directory for data storage
MCP_EMBEDDING_MODELXenova/all-MiniLM-L6-v2Embedding model name
GEMINI_API_KEY—Google Gemini API key (enables search_documents_with_ai)
MCP_CACHE_ENABLEDtrueEnable/disable LRU embedding cache
START_WEB_UItrueSet to false to disable the built-in web interface
WEB_HOST127.0.0.1Bind address for the web UI (use 0.0.0.0 to expose on all interfaces)
WEB_PORT3080Port for the web UI
MCP_STREAMING_ENABLEDtrueEnable streaming reads for large files
MCP_STREAM_CHUNK_SIZE65536Streaming buffer size in bytes (64KB)
MCP_STREAM_FILE_SIZE_LIMIT10485760Threshold to switch to streaming (10MB)

Storage layout

~/.mcp-documentation-server/     # Or custom path via MCP_BASE_DIR├── data/│   ├── orama-chunks.msp         # Orama vector DB (child chunks + embeddings)│   ├── orama-docs.msp           # Orama document DB (full content + metadata)│   ├── orama-parents.msp        # Orama parent chunks DB (context sections)│   ├── migration-complete.flag   # Written after legacy JSON migration│   └── *.md                     # Markdown copies of documents└── uploads/                     # Drop .txt, .md, .pdf files here

Embedding Models

Set via MCP_EMBEDDING_MODEL:

ModelDimensionsNotes
Xenova/all-MiniLM-L6-v2384Default — fast, good quality
Xenova/paraphrase-multilingual-mpnet-base-v2768Recommended — best quality, multilingual

Models are downloaded on first use (~80–420 MB). The vector dimension is determined automatically from the provider.

⚠️ Important: Changing the embedding model requires re-adding all documents — embeddings from different models are incompatible. The Orama database is recreated automatically when the dimension changes.

Architecture

Server (FastMCP, stdio)  ├─ Web UI (Express, port 3080)  │    └─ REST API → DocumentManager  └─ MCP Tools       └─ DocumentManager            ├─ OramaStore          — Orama vector DB (chunks DB + docs DB + parents DB), persistence, migration            ├─ IntelligentChunker  — Parent-child chunking (code, markdown, text, PDF)            ├─ EmbeddingProvider   — Local embeddings via @xenova/transformers            │    └─ EmbeddingCache — LRU in-memory cache            └─ GeminiSearchService — Optional AI search via Google Gemini
  • OramaStore manages three Orama instances: one for document metadata/content, one for child chunks with vector embeddings, and one for parent chunks (context sections). All are persisted to binary files on disk and restored on startup.
  • IntelligentChunker implements the Parent-Child Chunking pattern: documents are first split into large parent chunks that preserve full context (sections, paragraphs), then each parent is further split into small child chunks for precise vector search. At query time, results are deduplicated by parent so that the LLM receives both the matched fragment and the broader context.
  • EmbeddingProvider lazily loads a Transformers.js model for local inference — no API calls needed.

Development

bash
git clone https://github.com/andrea9293/mcp-documentation-server.gitcd mcp-documentation-servernpm install
bash
npm run dev       # FastMCP dev mode with hot reloadnpm run build     # TypeScript compilationnpm run inspect   # FastMCP web UI for interactive tool testingnpm start         # Direct tsx execution (MCP server + web UI)npm run web       # Run only the web UI (development)npm run web:build # Run only the web UI (compiled)

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/name
  3. Follow Conventional Commits for messages
  4. Open a pull request

License

MIT — see LICENSE

Support


Star History

[Star History Chart]

Built with FastMCP, Orama, and TypeScript

来源:README.md,提交 9a75899

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.15.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分