RAGFlow MCP Server
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., "@RAGFlow MCP Serversearch my datasets for the 2024 expense policy"
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.
ragflow-mcp-server-continue MCP server
RAGFlow API MCP Server,可以查找知识库和聊天。
Components
Tools
list_datasets
列出所有数据集
返回数据集的 ID 和名称
create_chat
创建一个新的聊天助手
输入:
name: 聊天助手的名称
dataset_id: 数据集的 ID
返回创建的聊天助手的 ID、名称和会话 ID
chat
与聊天助手进行对话
输入:
session_id: 聊天助手的会话 ID
question: 提问内容
返回聊天助手的回答
retrieve
检索相关信息
输入:
dataset_ids: 数据集的 ID
question: 提问内容
返回从知识库检索到的内容
Related MCP server: mcp-lightrag
Configuration
[TODO: Add configuration details specific to your implementation]
Quickstart
Install
GitHub Copilot
.vscode/mcp.json
{
"servers": {
"ragflow-mcp-server": {
"command": "uvx",
"args": [
"ragflow-mcp-server",
"--api-key=ragflow-dhMzViYzJlMTM1NjExZjBiNWU5MDI0Mm",
"--base-url=http://172.16.33.66:8060"
]
}
}
}Continue
config.yaml
mcpServers:
- name: RAGFlow Server
command: uvx
args:
- ragflow-mcp-server
- --api-key
- ragflow-dhMzViYzJlMTM1NjExZjBiNWU5MDI0Mm
- --base-url
- http://172.16.33.66:8060Claude Desktop
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
Development
Building and Publishing
To prepare the package for distribution:
Sync dependencies and update lockfile:
uv syncBuild package distributions:
uv buildThis will create source and wheel distributions in the dist/ directory.
Publish to PyPI:
uv publishNote: You'll need to set PyPI credentials via environment variables or command flags:
Token:
--tokenorUV_PUBLISH_TOKENOr username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory ragflow-mcp-server-continue run ragflow-mcp-server-continueUpon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Available Tools
4 toolschat聊天C
向聊天助手提问
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | 聊天会话ID | |
| question | Yes | 提问的问题 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It doesn't disclose what happens after asking (e.g., returns an answer), any side effects, or idempotency. Simply says 'ask'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is one short sentence, which is concise but under-specified. It could be slightly longer to include key details without being verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given only two parameters and no output schema, the description should clarify that it returns a response and requires an existing session. It lacks this information, making it incomplete for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (both parameters described). The description adds no extra meaning beyond schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'ask the chat assistant' is somewhat vague but indicates the tool is for asking questions. It doesn't explicitly distinguish from sibling 'create_chat', but context implies this is for existing sessions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus siblings. For example, it doesn't say to use this for ongoing conversations and 'create_chat' for new ones.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_chat创建聊天C
创建一个新的聊天助手,基于指定的数据集
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | 数据集ID | |
| name | No | 聊天助手的名称,可选,默认为'RAGFlow助手' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. While '创建一个新的聊天助手' clearly indicates a write/mutation operation, the description doesn't address important behavioral aspects: what permissions are required, whether there are rate limits, what happens if creation fails, or what the expected response format is. For a creation tool with zero annotation coverage, this is inadequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise - a single sentence that directly states the tool's purpose. Every word earns its place with no redundancy or unnecessary elaboration. It's front-loaded with the core functionality immediately apparent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a creation/mutation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what gets created (beyond '聊天助手'), what the creation process entails, what happens on success/failure, or what the agent should expect as a result. The description leaves too many behavioral questions unanswered for a tool that modifies system state.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters completely. The description adds no additional parameter semantics beyond what's in the schema - it mentions '基于指定的数据集' which corresponds to dataset_id, but provides no extra context about dataset requirements, format, or constraints. Baseline 3 is appropriate when schema does all the work.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('创建一个新的聊天助手' - creates a new chat assistant) and the resource ('基于指定的数据集' - based on specified dataset). It's specific about what the tool does, though it doesn't explicitly differentiate from sibling tools like 'chat' which might be for interacting with existing assistants rather than creating new ones.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, when this creation operation is appropriate, or how it differs from sibling tools like 'chat', 'list_datasets', or 'retrieve'. The agent must infer usage context from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_datasets列出数据集B
列出 RAGFlow 中的所有数据集
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits such as read-only nature, authentication requirements, or pagination behavior, which are important for a tool with no output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words, appropriately sized for the simplicity of the operation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description does not detail the output format or behavior (e.g., ordering, empty results), which is needed given the absence of an output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has no parameters, and schema coverage is 100%. The baseline for zero parameters is 4, and no additional parameter semantics are needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'List all datasets in RAGFlow' using a specific verb and resource, distinguishing it from sibling tools like chat and create_chat.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
retrieve检索相关信息C
从RAGFlow中指定的数据集检索相关内容
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_ids | Yes | 数据集ID | |
| question | Yes | 提出的问题 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves content but doesn't describe how it works (e.g., similarity search, ranking), what the output format is (since no output schema exists), or any constraints like rate limits or authentication needs. For a retrieval tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to understand at a glance. Every part of the sentence earns its place by conveying essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a retrieval operation with no annotations and no output schema, the description is incomplete. It doesn't explain what 'relevant content' means, how results are returned, or any behavioral traits. For a tool that likely involves search logic and result formatting, more context is needed to understand its full functionality and limitations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters ('dataset_ids' and 'question') with descriptions. The tool description adds no additional meaning beyond what the schema provides, such as explaining how the question is used for retrieval or the format of dataset IDs. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('检索相关内容' - retrieve relevant content) and the resource ('从RAGFlow中指定的数据集' - from specified datasets in RAGFlow). It distinguishes from sibling tools like 'chat' and 'create_chat' by focusing on retrieval rather than conversation, though it doesn't explicitly mention how it differs from 'list_datasets'. The purpose is specific and actionable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer 'retrieve' over 'chat' or 'create_chat' for information needs, nor does it specify prerequisites or exclusions. Usage is implied by the purpose but lacks explicit context for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
- First observed
chat - First observed
create_chat - First observed
list_datasets - First observed
retrieve
TDQS
Scored across 4 tools
The tools are mostly distinct with clear purposes: chat for queries, create_chat for new assistants, list_datasets for enumeration, and retrieve for content retrieval. However, chat and retrieve could potentially be confused since both involve interacting with datasets, though their descriptions clarify different intents (general Q&A vs. specific content fetching).
All tool names follow a consistent verb-based pattern: chat, create_chat, list_datasets, and retrieve. They use simple, clear verbs without mixing conventions like camelCase or snake_case, making the naming predictable and easy to understand.
With 4 tools, the count is reasonable for a RAG-focused server, covering core operations like chatting, dataset management, and retrieval. It's slightly lean but functional; adding tools for updating or deleting datasets could enhance completeness without being necessary for basic use.
The tools cover key RAG workflows: dataset listing, retrieval, and chat interactions. However, there are notable gaps, such as no tools for creating, updating, or deleting datasets, which limits full lifecycle management. Agents can work around this by focusing on existing datasets, but the surface is incomplete for comprehensive dataset control.
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Search your knowledge bases from any AI assistant using hybrid RAG.
Manage SiteGPT chatbots and account resources through the SiteGPT API v2.
Manage BioFlow link-in-bio pages, blocks, leads, and analytics from AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables creation and querying of knowledge bases using Google's Gemini API File Search feature, allowing AI applications to upload documents and retrieve information through RAG (Retrieval-Augmented Generation).35 npm6MIT
- AlicenseAqualityFmaintenanceEnables AI assistants to interact with LightRAG knowledge graphs, supporting smart upsert for Obsidian vaults, semantic queries, and document/graph management.188Apache 2.0
- FlicenseBqualityDmaintenanceEnables listing datasets, creating chat assistants, and chatting with them via RAGFlow API.33-
- AlicenseNot gradedqualityDmaintenanceEnables semantic retrieval and knowledge base management through the RAGFlow API, including dataset, document, chunk, chat, and graph operations.5MIT