A comprehensive MCP server for RAGFlow - semantic retrieval and knowledge base management
概览
A comprehensive Model Context Protocol (MCP) server for RAGFlow that provides full API access for semantic retrieval and knowledge base management. - : Search across datasets using natural language queries - : Create, list, update, and delete datasets - : Upload, parse, list, download, and delete documents - : Add, list, update, and delete document chunks - : Create and manage chat assistants with RAG capabilities - : Create and manage chat sessions - : Build and query knowledge graphs (when supported by your RAGFlow instance) - Python 3.10+ - RAGFlow server running and accessible (v0.16.0+ for core features) - RAGFlow API key GraphRAG and RAPTOR build APIs require RAGFlow v0.21.0 or later. Or manually add to ~/.claude/settings.
README
以下为原文 README 节选,完整内容请查看原文。
RAGFlow MCP Server
A comprehensive Model Context Protocol (MCP) server for RAGFlow that provides full API access for semantic retrieval and knowledge base management.
Features
- Semantic Retrieval: Search across datasets using natural language queries
- Dataset Management: Create, list, update, and delete datasets
- Document Management: Upload, parse, list, download, and delete documents
- Chunk Management: Add, list, update, and delete document chunks
- Chat Assistants: Create and manage chat assistants with RAG capabilities
- Session Management: Create and manage chat sessions
- GraphRAG & RAPTOR: Build and query knowledge graphs (when supported by your RAGFlow instance)
Installation
Prerequisites
- Python 3.10+
- RAGFlow server running and accessible (v0.16.0+ for core features)
- RAGFlow API key
Note: GraphRAG and RAPTOR build APIs require RAGFlow v0.21.0 or later.
Install from source
git clone https://github.com/Juxsta/ragflow-mcp.git
cd ragflow-mcp
pip install -e .
Configure Claude Code
Add to your Claude Code MCP settings:
claude mcp add ragflow -e RAGFLOW_API_KEY=your-api-key -e RAGFLOW_URL=http://localhost:9380/api/v1 -- python -m src.server
Or manually add to ~/.claude/settings.json:
{
"mcpServers": {
"ragflow": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/ragflow-mcp",
"env": {
"RAGFLOW_API_KEY": "your-api-key",
"RAGFLOW_URL": "http://localhost:9380/api/v1"
}
}
}
}
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
RAGFLOW_API_KEY |
Yes | - | Your RAGFlow API key |
RAGFLOW_URL |
No | http://localhost:9380/api/v1 |
RAGFlow API base URL |
RAGFLOW_TIMEOUT |
No | 300 |
Request timeout in seconds |
RAGFLOW_LOG_LEVEL |
No | INFO |
Logging level |
Available Tools
Retrieval
ragflow_retrieval_tool- Semantic search across datasets
Dataset Management
ragflow_list_datasets_tool- List all datasetsragflow_create_dataset_tool- Create a new datasetragflow_update_dataset_tool- Update dataset configurationragflow_delete_dataset_tool- Delete a dataset (requires confirmation)
Document Management
ragflow_list_documents_tool- List documents in a datasetragflow_upload_document_tool- Upload a document (file path or base64)ragflow_parse_document_tool- Trigger async document parsingragflow_parse_document_sync_tool- Parse and wait for completionragflow_download_document_tool- Download document contentragflow_delete_document_tool- Delete a document (requires confirmation)ragflow_stop_parsing_tool- Cancel an active parsing job
Chunk Management
ragflow_list_chunks_tool- List chunks in a documentragflow_add_chunk_tool- Add a chunk to a document
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"ragflow": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/ragflow-mcp",
"env": {
"RAGFLOW_API_KEY": "your-api-key",
"RAGFLOW_URL": "http://localhost:9380/api/v1"
}
}
}
}