Skip to main content
Glama

🗄️ LLMS 的 LanceDB MCP 服务器

Node.js 18+ 许可证:MIT

模型上下文协议 (MCP) 服务器,使 LLM 能够通过代理 RAG 和 LanceDB 中的混合搜索直接与磁盘上的文档进行交互。您可以向 LLM 询问有关整个数据集或特定文档的问题。

✨ 特点

  • 🔍 由 LanceDB 提供支持的无服务器矢量索引和文档摘要目录。

  • 📊 高效使用 LLM 令牌。LLM 会在需要时自行查找所需内容。

  • 📈 安全性。索引存储在本地,因此使用本地 LLM 时不会将任何数据传输到云端。

Related MCP server: @lex-tools/codebase-context-dumper

🚀 快速入门

首先,创建一个本地目录来存储索引,并将此配置添加到您的 Claude Desktop 配置文件中:

MacOS : ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows : %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "lancedb": {
      "command": "npx",
      "args": [
        "lance-mcp",
        "PATH_TO_LOCAL_INDEX_DIR"
      ]
    }
  }
}

先决条件

  • Node.js 18+

  • NPX

  • MCP 客户端(例如 Claude 桌面应用程序)

  • 安装了摘要和嵌入模型(参见 config.ts - 默认情况下我们使用 Ollama 模型)

    • ollama pull snowflake-arctic-embed2

    • ollama pull llama3.1:8b

演示

本地开发模式:

{
  "mcpServers": {
    "lancedb": {
      "command": "node",
      "args": [
        "PATH_TO_LANCE_MCP/dist/index.js",
        "PATH_TO_LOCAL_INDEX_DIR"
      ]
    }
  }
}

使用npm run build来构建项目。

使用npx @modelcontextprotocol/inspector dist/index.js PATH_TO_LOCAL_INDEX_DIR运行 MCP 工具检查器。

种子数据

种子脚本会在 LanceDB 中创建两个表,一个用于存储文档摘要目录,另一个用于存储矢量化文档的分块。要运行种子脚本,请使用以下命令:

npm run seed -- --dbpath <PATH_TO_LOCAL_INDEX_DIR> --filesdir <PATH_TO_DOCS>

您可以使用 docs/ 目录中的示例数据。您可以随意在 config.ts 文件中调整默认的摘要和嵌入模型。如果您需要重新创建索引,只需使用--overwrite选项重新运行种子脚本即可。

目录

  • 文档摘要

  • 元数据

块

  • 矢量化文档块

  • 元数据

🎯 示例提示

尝试与 Claude 一起执行这些提示来探索其功能:

"What documents do we have in the catalog?"
"Why is the US healthcare system so broken?"

📝 可用工具

服务器提供了这些工具来与索引进行交互:

目录工具

  • catalog_search :在目录中搜索相关文档

块工具

  • chunks_search :根据目录中的特定文档查找相关块

  • all_chunks_search :从所有已知文档中查找相关块

📜 许可证

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol (MCP) server that enables semantic search and retrieval of documentation using a vector database (Qdrant). This server allows you to add documentation from URLs or local files and then search through them using natural language queries.
    17 npm
    136
    Apache 2.0
  • A
    license
    A
    quality
    D
    maintenance
    A Model Context Protocol (MCP) server that provides a local-first RAG engine for your markdown documents. It uses a file-based Milvus vector database to index your notes, enabling LLMs to perform semantic search and retrieve relevant content from your local files.
    3
    61
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that indexes documents and serves relevant context to LLMs via Retrieval Augmented Generation (RAG).
    15 npm
    37
    MIT