Skip to main content
Glama
TimaxLacs

lightrag-mcp

by TimaxLacs

lightrag-mcp

MCP 服务器,将 LightRAG 连接到任何 MCP 客户端——Cursor、Claude Desktop 等。为代理提供持久化知识库访问:笔记、决策、文档、runbook。

两个工具,因为知识检索有两种不同的场景:

工具

功能

适用场景

search_lightrag

返回带来源链接的现成答案

对知识库的常规提问

get_lightrag_context

仅返回上下文和来源,不生成答案

需要自行组装答案时:与代码核对、与当前对话结合

两个工具均标记为 readOnlyHint,因此客户端不会将其视为改变状态的操作。

安装

npm install

需要 Node.js 18 或更高版本——使用内置的 fetch

Related MCP server: expert-mcp-server

配置

package.json 旁边创建 .env

LIGHTRAG_URL=http://localhost:9621
LIGHTRAG_API_KEY=ваш-ключ

LIGHTRAG_URL 为可选参数,默认值为 http://localhost:9621LIGHTRAG_API_KEY 为必填项:缺少时服务器会在启动时立即报错并给出明确提示,而不是等到首次请求时才失败。

环境文件路径可通过 LIGHTRAG_MCP_ENV_FILE 变量覆盖——当客户端从其他工作目录启动服务器时非常方便。

连接到 Cursor

~/.cursor/mcp.json 中:

{
  "mcpServers": {
    "lightrag": {
      "command": "node",
      "args": ["/абсолютный/путь/lightrag-mcp/src/server.js"],
      "env": {
        "LIGHTRAG_MCP_ENV_FILE": "/абсолютный/путь/lightrag-mcp/.env"
      }
    }
  }
}

搜索模式

mode 参数接受 mix(默认)、hybridlocalglobalnaive。未知模式会在发起网络请求之前被拒绝。请求始终携带来源链接并启用重排序。

测试

npm test

测试使用内置的 node --test,无外部依赖。HTTP 通过 fetchImpl 参数进行替换,因此既覆盖成功响应,也覆盖错误场景:缺少密钥、空问题、未知模式、响应状态失败。

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

UpdatingMaintainers
UpdatingResponse time
Release cycle
0Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enables AI agents to query specialized, domain-specific knowledge bases built using the LightRAG framework for enhanced retrieval-augmented generation. It allows for managing and searching knowledge graphs and vector embeddings to provide accurate, context-aware information during an AI assistant's reasoning process.
    59
    MIT

View all related MCP servers

Related MCP Connectors

  • Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.

  • Shared, peer-validated knowledge archive for AI agents — search, contribute, and validate via MCP

  • Agentic search over your Dewey document collections from any MCP-compatible client.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TimaxLacs/lightrag-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server