/ 目錄 / 演練場 / mcp-documentation-server
● 社群 andrea9293 ⚡ 即開即用

mcp-documentation-server

作者 andrea9293 · andrea9293/mcp-documentation-server

將 PDF、Markdown 和文字檔案放入本地向量資料庫,然後用混合搜尋向 AI 提問。完全不需要雲端服務。

mcp-documentation-server 由 andrea9293 開發,是一個本地 RAG 伺服器。可透過網頁介面(埠號 3080)拖放 .txt / .md / .pdf 檔案,或透過工具輸入。支援混合全文 + 向量搜尋與父子分塊。完全在本地執行,內建嵌入功能;Gemini 金鑰為選用,可提升檢索品質。

為什麼要用

核心特性

即時演示

實際使用效果

documentation-server.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "documentation-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-documentation-server"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "documentation-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-documentation-server"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "documentation-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-documentation-server"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "documentation-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-documentation-server"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "documentation-server",
      "command": "npx",
      "args": [
        "-y",
        "mcp-documentation-server"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "documentation-server": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcp-documentation-server"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add documentation-server -- npx -y mcp-documentation-server

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: mcp-documentation-server

讓 AI 可查詢新框架的說明文件

👤 正在採用新函式庫的開發者 ⏱ ~20 min beginner

何時使用: 官方文件篇幅龐大,你希望 Claude 能以有依據的引用來回答問題。

前置條件
  • 已安裝 mcp-documentation-server — npx -y @andrea9293/mcp-documentation-server
步驟
  1. 匯入文件
    將函式庫的 .md 說明文件上傳到 http://localhost:3080 的儀表板。✓ 已複製
    → 檔案已處理並分塊完成
  2. 提出具體問題
    對「如何設定中介軟體」執行 search_documents,並列出前 3 個區塊及其來源路徑。✓ 已複製
    → 附有引用的摘錄內容
  3. 進行有依據的綜合分析
    根據這些區塊,為此框架撰寫最精簡的中介軟體設定。✓ 已複製
    → 有效的設定,並附有引用的文件行數

結果: 一個能引用來源的個人文件助理。

注意事項
  • 含有掃描圖片的 PDF 不會自動 OCR — 上傳前先用 ocrmypdf 等工具進行 OCR 處理
  • 未使用 Gemini 時,大型文件集的嵌入品質較低 — 選用 GEMINI_API_KEY 可解鎖更高品質的語意搜尋
搭配使用: filesystem

將內部 Wiki 匯出轉為 RAG 資料來源

👤 使用支援 Markdown 匯出之 Wiki 的團隊 ⏱ ~25 min beginner

何時使用: 已將 Notion/Confluence 內容匯出為 Markdown,並希望 AI 能存取這些內容。

步驟
  1. 透過 process_uploads 批次匯入
    對 ./wiki-export/ 執行 process_uploads,處理所有 .md 檔案。✓ 已複製
    → 每個資料夾的文件數量
  2. 全範圍搜尋
    執行 search_all_documents:'deployment runbook',取前 5 筆。✓ 已複製
    → 依相關性排序的清單

結果: 一個本地、私有且可搜尋的 Wiki。

建立個人研究論文資料庫

👤 研究人員、學生 ⏱ ~30 min beginner

何時使用: 你下載了大量論文,希望能直接查詢,而不是讓它們堆在下載資料夾裡。

步驟
  1. 放入 PDF
    將 ~/Papers/ 中的所有 PDF 上傳到說明文件伺服器。✓ 已複製
    → 論文已分塊並建立索引
  2. 跨語料庫提問
    執行 search_documents:'attention variants with lower quadratic cost',回傳作者與年份。✓ 已複製
    → 附有引用的摘錄內容

結果: 一個基於你個人論文集的本地迷你 Perplexity。

組合

與其他 MCP 搭配,撬動十倍槓桿

documentation-server + filesystem

自動化監控資料夾的匯入流程

每當有新的 PDF 放入 ~/Papers/Inbox,就自動對說明文件伺服器執行 process_uploads。✓ 已複製
documentation-server + swarmvault

比較:documentation-server 適合快速匯入;swarmvault 則建立結構化 Wiki

將我的研究 PDF 同時匯入兩個系統,並針對相同查詢比較兩者的檢索品質。✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
add_document title, content, metadata? 程式化匯入文件時使用 free (local embeddings)
list_documents (none) 查看已建立索引的文件時使用 free
get_document id 取得特定文件時使用 free
delete_document id 清理文件時使用 free
search_documents query, top_k? 在特定文件集內查詢時使用 free
search_all_documents query, top_k? 進行全域 RAG 查詢時使用 free
get_context_window chunk_id 將範圍較小的命中結果展開為更廣泛的上下文時使用 free
search_documents_with_ai query 需要一次性答案綜合時使用 Gemini call (needs key)
process_uploads path?: str 從上傳資料夾批次匯入時使用 free

成本與限制

運行它的成本

API 配額
本地執行時無限制;設定 GEMINI_API_KEY 後會使用 Gemini 用量
每次呼叫 Token 數
搜尋依 top_k 回傳 500-3000 個 token
費用
免費;啟用後 Gemini 按呼叫次數計費
提示
探索性工作可跳過 Gemini,本地嵌入對已知項目查詢已經足夠。

安全

權限、密鑰、影響範圍

憑證儲存: GEMINI_API_KEY(選用)存於環境變數中
資料出站: 除非啟用 Gemini,否則僅限本地;儀表板在埠號 3080

故障排查

常見錯誤與修復

Port 3080 in use

將 WEB_PORT 環境變數設定為其他埠號。

驗證: lsof -i :3080
PDF parse error

有密碼保護或掃描版的 PDF 會失敗。請移除密碼或先執行 OCR。

驗證: Try a plain PDF
search returns empty

請確認已匯入文件:執行 list_documents。若結果為空,請重新執行 process_uploads。

驗證: list_documents

替代方案

mcp-documentation-server 對比其他方案

替代方案何時用它替代權衡
swarmvault需要結構化 Wiki 加知識圖譜,而不只是搜尋功能較為複雜,前期設定工作較多
Cloud RAG (Pinecone, Weaviate)需要團隊共用且可擴展的方案需付費;資料會離開你的機器
llm-context.py需要的是針對特定任務的上下文,而非持久化文件檢索解決的是不同問題

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills