No description available
MCP server for integrating LightRAG with AI tools. Provides a unified interface for interacting with LightRAG API through the MCP protocol.
LightRAG MCP Server is a bridge between LightRAG API and MCP-compatible clients. It allows using LightRAG (Retrieval-Augmented Generation) capabilities in various AI tools that support the MCP protocol.
This server is designed to be used as an MCP server and should be installed in a virtual environment using uv, not as a system-wide package.
# Create a virtual environment
uv venv --python 3.11
# Install the package in development mode
uv pip install -e .
Important: LightRAG MCP server should only be run as an MCP server through an MCP client configuration file (mcp-config.json).
The following arguments are available when configuring the server in mcp-config.json:
--host: LightRAG API host (default: localhost)--port: LightRAG API port (default: 9621)--api-key: LightRAG API key (optional)The MCP server requires a running LightRAG API server. Start it as follows:
# Create virtual environment
uv venv --python 3.11
# Install dependencies
uv pip install -r LightRAG/lightrag/api/requirements.txt
# Start LightRAG API
uv run LightRAG/lightrag/api/lightrag_server.py --host localhost --port 9621 --working-dir ./rag_storage --input-dir ./input --llm-binding openai --embedding-binding openai --log-level DEBUG
To set up LightRAG MCP as an MCP server, add the following configuration to your MCP client configuration file (e.g., mcp-config.json):
{
"mcpServers": {
"lightrag-mcp": {
"command": "uvx",
"args": [
"lightrag_mcp",
"--host",
"localhost",
"--port",
"9621",
"--api-key",
"your_api_key"
]
}
}
}
{
"mcpServers": {
"lightrag-mcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/lightrag_mcp",
"run",
"src/lightrag_mcp/main.py",
"--host",
"localhost",
"--port",
"9621",
"--api-key",
"your_api_key"
]
}
}
}
Replace /path/to/lightrag_mcp with the actual path to your lightrag-mcp directory.
query_document: Execute a query to documents through LightRAG APIinsert_document: Add text directly to LightRAG storageupload_document: Upload document from file to the /input directoryinsert_file: Add document from file directly to storageinsert_batch: Add batch of documents from directoryscan_for_new_documents: Start scanning the /input directory for new documentsget_documents: Get list of all uploaded documentsget_pipeline_status: Get status of document processing in pipelineget_graph_labels: Get labels (node and relationship types) from knowledge graphcreate_entities: Create multiple entities in knowledge graphedit_entities: Edit multiple existing entities in knowledge graphdelete_by_entities: Delete multiple entities from knowledge graph by namedelete_by_doc_ids: Delete all entities and relationships associated with multiple documentscreate_relations: Create multiple relationships between entities in knowledge graphedit_relations: Edit multiple relationships between entities in knowledge graphmerge_entities: Merge multiple entities into one with relationship migrationcheck_lightrag_health: Check LightRAG API statusuv pip install -e ".[dev]"
ruff check src/
mypy src/
MIT
{
"mcpServers": {
"lightrag-mcp": {
"command": "uvx",
"args": [
"lightrag_mcp",
"--host",
"localhost",
"--port",
"9621",
"--api-key",
"your_api_key"
]
}
}
}Related projects feature coming soon
Will recommend related projects based on sub-categories