Back to MCP directory
publicPublicdnsLocal runtime

LanceDB

一个基于LanceDB的MCP服务器,使LLM能够通过代理RAG和混合搜索直接与本地文档交互。

article

README

🚀 🗄️ LanceDB MCP 服务器用于 LLM

一个基于模型上下文协议(MCP)的服务器,它能让大语言模型(LLM)直接与本地存储的文档进行交互,通过代理检索增强生成(RAG)和混合搜索在 LanceDB 中得以实现。用户可以向 LLM 询问有关整个数据集或特定文档的问题。

🚀 快速开始

要开启使用,请创建一个本地目录用于存储索引,并将以下配置添加到您的 Claude Desktop 配置文件中:

  • MacOS~/Library/Application\ 支持/Claude/claude_desktop_config.json
  • Windows%APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "lancedb": {
      "command": "npx",
      "args": [
        "lance-mcp",
        "本地索引目录路径"
      ]
    }
  }
}

先决条件

  • Node.js 18+
  • npx
  • MCP 客户端(例如 Claude Desktop App)
  • 摘要和嵌入模型已安装(参见 config.ts,默认使用 Ollama 模型)
    • ollama pull snowflake-arctic-embed2
    • ollama pull llama3.1:8b

示例

示例图像

本地开发模式

{
  "mcpServers": {
    "lancedb": {
      "command": "node",
      "args": [
        "生成的 index.js 文件路径"
      ]
    }
  }
}

您需要运行 npm run build 来生成 index.js

使用 Inspector 工具检查 MCP 服务器的状态:

inspect http://localhost:3000

种子数据

运行种子脚本以创建两个表:

  1. 文档摘要。
  2. 分块的向量索引。

运行命令时,指定数据库路径和文档文件夹的位置:

node seeds/index.js --db <数据库路径> --docs <文档文件夹路径>

如果需要重新创建索引,可以使用 --overwrite 选项。

示例提示

  • 查询目录中的文档:“What documents do we have in the catalog?”
  • 基于内容查询:“Why is the US healthcare system so broken?”

工具

  • Catalog Tools
    • 搜索摘要。
  • Chunks Tools
    • 搜索具体的文档块。

✨ 主要特性

  • 🔍 基于 LanceDB 的无服务器向量索引和文档摘要目录。
  • 📊 高效使用 LLM 令牌。LLM 在需要时自行查找所需信息。
  • 📈 安全性。索引本地存储,因此在使用本地 LLM 时不会将数据传输到云。

📄 许可证

项目使用 MIT License,允许自由使用和修改。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client