LightRAG MCP Server

A bridge to the LightRAG knowledge base for AI assistants.

README.md

LightRAG MCP Server

English | 正體中文


English

A Model Context Protocol (MCP) server that provides a bridge to the LightRAG knowledge base. This allows AI assistants like Claude to query your technical documentation directly.

Features

  • Knowledge Base Querying: Access your private documents through LightRAG.
  • Language Support: Built-in support for Traditional Chinese and English.
  • Flexible Modes: Support for hybrid, naive, local, and global retrieval modes.
  • Easy Configuration: Simple environment variable setup.

Quick Start

  1. Installation
    python -m venv venv
    source venv/bin/activate  # Windows: venv\Scripts\activate
    pip install -r requirements.txt
    
  2. Configuration Copy .env.example to .env and set:
    • LIGHTRAG_URL: Your LightRAG backend URL.
    • LIGHTRAG_LANG: Default language (zh or en).
  3. Run
    python lightrag_mcp.py
    

Tool: `query_knowledge_base`

  • query (string): Search query.
  • mode (string): hybrid (default), naive, local, global.
  • lang (string): zh (Traditional Chinese) or en (English).

正體中文

基於 Model Context Protocol (MCP) 的伺服器,作為 LightRAG 知識庫的橋樑。讓 AI 助手(如 Claude)可以直接查詢您的技術文件。

核心功能

  • 知識庫查詢:透過 LightRAG 存取您的私有文件。
  • 多語言支援:內建支援正體中文英文
  • 靈活模式:支援 hybridnaivelocalglobal 檢索模式。
  • 簡易配置:透過環境變數輕鬆設定。

快速啟動

  1. 安裝
    python -m venv venv
    source venv/bin/activate  # Windows: venv\Scripts\activate
    pip install -r requirements.txt
    
  2. 配置 複製 .env.example.env 並設定:
    • LIGHTRAG_URL: LightRAG 後端 URL。
    • LIGHTRAG_LANG: 預設語言 (zhen)。
  3. 執行
    python lightrag_mcp.py
    

工具:`query_knowledge_base`

  • query (字串):查詢字句或問題。
  • mode (字串):檢索模式,可選 hybrid (預設), naive, local, global
  • lang (字串):語言切換,可選 zh (正體中文) 或 en (英文)。

Development / 開發規範

See AGENTS.md for detailed guidelines. / 請參閱 AGENTS.md 了解詳細開發規範。

License

MIT

Tools 1

query_knowledge_baseQueries the LightRAG knowledge base using specified retrieval modes and language settings.

Environment Variables

LIGHTRAG_URLrequiredThe URL of your LightRAG backend server.
LIGHTRAG_LANGDefault language for queries, either 'zh' or 'en'.

Try it

Query the knowledge base for 'how to configure the authentication module' using hybrid mode.
Find information about our deployment pipeline in the documentation using global retrieval.
Search for 'API rate limits' in the knowledge base using Traditional Chinese.
What are the best practices for data migration mentioned in the technical docs?

Frequently Asked Questions

What are the key features of LightRAG MCP?

Direct querying of private technical documentation via LightRAG.. Support for multiple retrieval modes: hybrid, naive, local, and global.. Bilingual support for English and Traditional Chinese.. Simple integration via environment variables..

What can I use LightRAG MCP for?

Retrieving specific technical implementation details from internal documentation.. Summarizing complex project architecture based on private knowledge base files.. Cross-referencing documentation across different retrieval granularities for better accuracy.. Providing AI assistants with context from private RAG-indexed datasets..

How do I install LightRAG MCP?

Install LightRAG MCP by running: python -m venv venv && source venv/bin/activate && pip install -r requirements.txt

What MCP clients work with LightRAG MCP?

LightRAG MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep LightRAG MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare