Token导航 LogoToken导航TokenDH.com
Knowledge Index MCP logo
搜索检索stdio官方级别未说明来源级核验

Knowledge Index MCP

MCP Server

一个本地优先的文档语义搜索服务器,支持PDF、Word、PowerPoint、Excel和文本/Markdown文件的自然语言搜索。

工具数

9

提示词数

0

GitHub Stars

1

资源数

0
搜索本地处理PythonClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mike-anderson

提供方

mike-anderson

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx --from doc-index-mcp doc-index-install-skill

详细介绍

文档索引MCP

这是干什么用的?

文档的本地第一语义搜索服务器。索引PDF、Word文档、PowerPoint、Excel文件和文本/标记,然后通过模型上下文协议(MCP)使用自然语言进行搜索。

  • 语义搜索 -使用自然语言查询查找相关内容
  • 边界感知分块 -尊重文档结构(章节、节、标题)
  • 表格提取 -将文档中的表格提取为CSV格式
  • 完全本地化 -没有外部API,没有云服务,没有Docker容器,没有PyTorch
  • 轻量级 -基于ONNX的嵌入(约50MB,而PyTorch约2GB)

快速开始

1.添加到MCP配置中

需要 紫外线.如果你没有紫外线,请参阅 替代安装 在......下面

添加 .mcp.json 在项目根目录(适用于Claude Code)或Claude Desktop配置中:

{
  "mcpServers": {
    "doc-index": {
      "command": "uvx",
      "args": ["doc-index-mcp"]
    }
  }
}

2.安装克劳德技能(可选)

该技能教克劳德如何有效地使用搜索工具(令牌预算、边界扩展等):

uvx --from doc-index-mcp doc-index-install-skill

就是这样——开始让克劳德索引和搜索你的文档。

支持格式

格式扩展名注释
文本.txt纯文本
Markdown.md, .markdown保留边界标题
PDF.pdf使用页面标记提取文本
Word.docx段落、标题、表格
PowerPoint.pptx幻灯片、笔记、表格
Excel.xlsx, .xls图纸作为表格

为什么没有外部服务?

组件传统RAG此服务器
嵌入OpenAI API/托管模型本地ONNX模型(fastembed)
矢量数据库松果体/编织体/Qdrant本地文件(usearch)
存储云/托管数据库本地 .docindex/ 目录
依赖关系PyTorch(~2GB)ONNX运行时(~50MB)

工具

doc_index

为文档建立索引以进行语义搜索。

{
  "file_path": "docs/manual.pdf",
  "source_name": "manual"
}

doc_search

使用自然语言搜索索引文档。

{
  "query": "how to configure authentication",
  "top_k": 5,
  "expand_to_boundary": "section",
  "max_return_tokens": 4096
}

参数:

  • query -搜索查询
  • sources -筛选特定来源(可选)
  • top_k -结果数(默认值:5)
  • expand_to_boundary -将结果展开到完整的“章节”、“部分”、“小节”或“页面”
  • max_return_tokens -结果令牌预算(默认值:4096)
  • include_siblings -展开时包含兄弟部分

doc_list

列出所有索引源。

doc_chunk

通过ID和可选邻居检索特定块。

{
  "chunk_id": "manual:42",
  "neighbors": 2
}

doc_toc

获取索引文档的目录(章节、小节、小节)。在检索特定内容之前,使用此功能了解文档结构。

{
  "source_name": "manual",
  "max_depth": 3
}

doc_get_content

按结构位置检索文档内容。只提供一个定位器: boundary_id, chapter, section,或 pages.

{
  "source_name": "manual",
  "chapter": "3",
  "max_return_tokens": 8192
}

read_document

无需索引即可阅读文档。返回格式化文本。

{
  "file_path": "report.pdf",
  "max_chars": 100000
}

list_tables

列出文档中的所有表。

{
  "file_path": "data.xlsx"
}

extract_table

将特定表提取为CSV。

{
  "file_path": "data.xlsx",
  "table_index": 0,
  "max_rows": 100
}

环境变量

变量描述默认值
MCP_WORKING_DIR解析文件路径的基本目录当前工作目录
DOC_INDEX_DIR用于存储矢量索引的目录.docindex 在工作目录中

替代安装

使用pip进行全局安装

pip install doc-index-mcp

然后在你的 .mcp.json:

{
  "mcpServers": {
    "doc-index": {
      "command": "doc-index-mcp"
    }
  }
}

从源码安装

克隆仓库并安装依赖项:

git clone https://github.com/mike-anderson/doc-index-mcp.git
cd doc-index-mcp
pip install -e .

然后指出你的 .mcp.json 在服务器入口点:

{
  "mcpServers": {
    "doc-index": {
      "command": "python",
      "args": ["/path/to/doc-index-mcp/src/server.py"]
    }
  }
}

建筑

一切都在本地运行,不需要外部API、数据库或嵌入式服务器。

flowchart TB
    subgraph Client["MCP Client (Claude Desktop, etc.)"]
        LLM[LLM]
    end

    subgraph MCP["Doc Index MCP Server"]
        Server[server.py]

        subgraph Services["Local Services"]
            Loader[Document Loader
PDF, DOCX, PPTX, XLSX]
            Chunker[Boundary-Aware
Chunker]
            Embedder[Embedder
ONNX Runtime]
            VectorStore[Vector Store
usearch]
        end
    end

    subgraph Storage["Local Filesystem"]
        Docs[(Source
Documents)]
        Index[(".docindex/
├── manifest.json
└── vectors/
    ├── index.usearch
    ├── chunks.jsonl
    └── boundaries.json")]
    end

    subgraph Models["Embedded Model (downloaded once)"]
        ONNX[BAAI/bge-small-en-v1.5
ONNX format ~50MB]
    end

    LLM |MCP Protocol| Server
    Server --> Loader
    Server --> Chunker
    Server --> Embedder
    Server --> VectorStore

    Loader -->|read| Docs
    VectorStore |read/write| Index
    Embedder -->|load once| ONNX

    style Client fill:#e1f5fe
    style Storage fill:#fff3e0
    style Models fill:#f3e5f5
    style MCP fill:#e8f5e9

数据流

flowchart LR
    subgraph Index["Indexing"]
        direction TB
        A[Document] --> B[Load & Extract Text]
        B --> C[Detect Boundaries]
        C --> D[Chunk ~256 tokens]
        D --> E[Generate Embeddings]
        E --> F[Save to Disk]
    end

    subgraph Search["Searching"]
        direction TB
        G[Query] --> H[Embed Query]
        H --> I[Vector Similarity Search]
        I --> J[Expand to Boundaries]
        J --> K[Return Results]
    end

    Index -.->|stored in .docindex/| Search

许可证

麻省理工学院

目录标签

目录标签

搜索本地处理PythonClaude语义搜索本地部署文档索引自然语言处理文件管理

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

9

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP