lightrag-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lightrag-mcpWhat do I know about Kubernetes networking?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
lightrag-mcp
MCP server that connects LightRAG to any MCP client — Cursor, Claude Desktop, and others. Gives the agent access to a persistent knowledge base: notes, decisions, documentation, runbooks.
Two tools, because knowledge retrieval has two different scenarios:
Tool | What it does | When you need it |
| Returns a ready answer with source links | A regular question to the knowledge base |
| Returns only context and sources, without generating an answer | When you need to assemble the answer yourself: cross-check with code, combine with the current conversation |
Both tools are marked as readOnlyHint, so the client will not treat them as
state-changing.
Installation
npm installRequires Node.js 18 or newer — the built-in fetch is used.
Related MCP server: mcp-rag-bridge
Configuration
Create .env next to package.json:
LIGHTRAG_URL=http://localhost:9621
LIGHTRAG_API_KEY=ваш-ключLIGHTRAG_URL is optional and defaults to http://localhost:9621.
LIGHTRAG_API_KEY is required: without it the server fails at startup with a
clear error, not at the first request.
The path to the environment file can be overridden with the
LIGHTRAG_MCP_ENV_FILE variable — convenient when the client launches the
server from a different working directory.
Connecting to Cursor
In ~/.cursor/mcp.json:
{
"mcpServers": {
"lightrag": {
"command": "node",
"args": ["/абсолютный/путь/lightrag-mcp/src/server.js"],
"env": {
"LIGHTRAG_MCP_ENV_FILE": "/абсолютный/путь/lightrag-mcp/.env"
}
}
}
}Search modes
The mode parameter accepts mix (default), hybrid, local, global, and
naive. An unknown mode is rejected before the network request. Requests
always go out with source links and reranking enabled.
Tests
npm testTests use the built-in node --test, with no external dependencies. HTTP is
mocked via the fetchImpl parameter, so both successful responses and errors
are covered: missing key, empty question, unknown mode, unsuccessful response
status.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
Knowledge base MCP for AI agents on iknow.dev. Search, read, and maintain via OAuth.
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables MCP-compatible agents to query beliefs, search documents, and explore reasoning chains from expert-service knowledge bases.10MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query and manage a document knowledge base via MCP, with RAG-powered search and grounded answers with citations.MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to query a structured knowledge library for search, explanations, related concepts, learning paths, examples, and cross-domain references via MCP.Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables to build and query a knowledge base with retrieval-augmented generation, supporting document ingestion, hybrid search, and live data integration from external APIs via MCP tools.2-