ragflow-mcp-server-fixed
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-server-fixedask your configured chat: what's the revenue for Q3?"
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-fixed
A fixed RAGFlow MCP server for stdio MCP clients.
It keeps the executable name ragflow-mcp-server, so clients can switch from
the original package by changing only the package source.
What This Fixes
Some RAGFlow deployments return errors from the legacy chat endpoint, for example:
'NoneType' object is not subscriptable
required argument are missing: messagesThis server handles that by:
calling RAGFlow HTTP APIs directly;
parsing stream responses defensively;
falling back to the OpenAI-compatible RAGFlow endpoint when needed;
returning clearer error messages from RAGFlow.
Tools
Tool | Purpose |
| List RAGFlow datasets. |
| Create a chat assistant and session for a dataset. |
| Ask a question in a session returned by |
| Ask a server-configured RAGFlow chat assistant directly. |
| Retrieve matching chunks directly from a dataset. |
For most usage, configure --default-chat-name or --default-chat-id, then use
ask_configured_chat.
Quick Start
{
"command": "uvx",
"args": [
"--from",
"git+https://github.com/FoundZiGu/ragflow-mcp-server-fixed.git@v0.1.2",
"ragflow-mcp-server",
"--api-key",
"ragflow-REPLACE_WITH_YOUR_KEY",
"--base-url",
"http://<RAGFLOW_HOST>:9380",
"--default-chat-name",
"<CHAT_NAME>"
]
}If your MCP client supports environment variables:
{
"command": "uvx",
"args": [
"--from",
"git+https://github.com/FoundZiGu/ragflow-mcp-server-fixed.git@v0.1.2",
"ragflow-mcp-server"
],
"env": {
"RAGFLOW_API_KEY": "ragflow-REPLACE_WITH_YOUR_KEY",
"RAGFLOW_BASE_URL": "http://<RAGFLOW_HOST>:9380",
"RAGFLOW_DEFAULT_CHAT_NAME": "<CHAT_NAME>"
}
}Use chat ID instead of name when possible:
{
"command": "uvx",
"args": [
"--from",
"git+https://github.com/FoundZiGu/ragflow-mcp-server-fixed.git@v0.1.2",
"ragflow-mcp-server",
"--api-key",
"ragflow-REPLACE_WITH_YOUR_KEY",
"--base-url",
"http://<RAGFLOW_HOST>:9380",
"--default-chat-id",
"<CHAT_ID>"
]
}Server Options
Option | Environment variable | Description |
|
| RAGFlow API key. |
|
| RAGFlow base URL. |
|
| Existing RAGFlow chat assistant ID for |
|
| Existing RAGFlow chat assistant name for |
|
| Session name created for the configured chat. |
Local Development
uv run ragflow-mcp-server --helpexport RAGFLOW_API_KEY="ragflow-REPLACE_WITH_YOUR_KEY"
export RAGFLOW_BASE_URL="http://<RAGFLOW_HOST>:9380"
export RAGFLOW_DEFAULT_CHAT_NAME="<CHAT_NAME>"
uv run python tests/smoke_test.pySecurity
Do not commit API keys.
Prefer environment variables for secrets.
Rotate keys that have appeared in logs, screenshots, public issues, or chat transcripts.
Available Tools
5 toolsask_configured_chatAsk configured chatA
Preferred one-step QA tool. Ask a question in the RAGFlow chat assistant configured on server startup. No dataset_id, chat_id, or session_id is required.
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | Question | |
| stream | No | Use RAGFlow streaming first. Default true. | |
| new_session | No | Create a new configured chat session for this question. | |
| session_name | No | Optional session name when new_session is true. |
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. It mentions streaming default true but does not disclose whether the tool creates sessions (though 'new_session' parameter hints at it) or any other side effects. Basic information is present but lacks depth.
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, with two short sentences that front-load the core purpose and key differentiator. Every word serves a purpose without unnecessary detail.
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 no output schema and no annotations, the description provides adequate context for basic usage but fails to specify the return format or behavior of streaming. It covers the tool's role but leaves some practical questions unanswered.
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 defines parameters well. The description adds no additional meaning beyond the schema, placing it at the baseline of 3.
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 it is a one-step QA tool that asks a question in the preconfigured RAGFlow chat assistant. It differentiates itself from siblings by explicitly noting no dataset_id, chat_id, or session_id is required, making its purpose and scope very clear.
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 positions this as the 'preferred one-step QA tool' and implies it is for users who do not have specific IDs, guiding when to use it. However, it does not explicitly state when to use alternative siblings like 'chat' or 'create_chat'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
chatChatC
Ask a question in a created RAGFlow chat session.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session id returned by create_chat | |
| question | Yes | Question | |
| stream | No | Use RAGFlow streaming first. Default true. |
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. It only states the tool's function without revealing traits like error handling, streaming behavior, or authentication needs. The minimal text does not sufficiently inform the agent about side effects or constraints.
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 with no wasted words. However, it is so brief that it sacrifices useful context, placing it slightly below a perfect score.
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 lack of output schema and annotations, the description should compensate but does not. It omits details about return values, error states, or streaming nuances, leaving the agent underinformed for a chat interaction tool.
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%, providing descriptions for all three parameters. The tool description adds no extra meaning beyond the schema, so it meets the baseline but does not enhance understanding.
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 specifies the action ('Ask a question') and the resource ('created RAGFlow chat session'), making the tool's purpose evident. However, it does not explicitly differentiate from sibling tools like 'ask_configured_chat' or 'create_chat', which slightly diminishes clarity.
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, such as 'ask_configured_chat' or 'create_chat'. It also lacks any prerequisites or exclusions, leaving the agent without context for appropriate invocation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_chatCreate chatB
Create a RAGFlow chat assistant and session for one dataset.
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | Dataset id | |
| name | No | Chat name | |
| llm_id | No | Optional RAGFlow LLM id | |
| prompt_config | No | Optional RAGFlow prompt_config | |
| llm_setting | No | Optional RAGFlow llm_setting |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It only states creation, but does not disclose side effects (e.g., whether it modifies existing data, what happens if the dataset doesn't exist, or if the operation is idempotent).
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 with no wasted words. It front-loads the core action, but could be slightly expanded without losing conciseness.
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 is too brief given the complexity: 5 parameters (including nested objects), no output schema, and no mention of what the tool returns or how to use the created chat. Additional context on success behavior and error cases is missing.
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% with descriptions for each parameter, though they are minimal. The tool description does not add additional meaning beyond the schema, such as clarifying the role of 'prompt_config' or 'llm_setting'. 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 clearly states 'Create a RAGFlow chat assistant and session for one dataset,' which is a specific verb+resource. It distinguishes from sibling tools like 'ask_configured_chat' (for asking questions) and 'chat' (for general chatting).
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 is provided on when to use this tool versus alternatives, such as when to create a new chat vs using an existing one. The description does not mention prerequisites or conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_datasetsList datasetsB
List RAGFlow datasets. Returns dataset id and name.
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Optional dataset id | |
| name | No | Optional dataset name |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description should explicitly state that the tool is read-only and disclose any side effects. It only says 'List' which implies read-only but does not clarify auth requirements or rate limits.
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, short sentence that is easy to parse. It could be improved by structuring return fields, but it is not 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?
For a simple list tool with optional filters, the description is minimally adequate. It lacks mention of output format, pagination, or behavior when no parameters are provided.
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% with descriptions for both parameters. The description adds no extra meaning beyond what the schema provides, so baseline score of 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 clearly states 'List RAGFlow datasets' with a specific verb and resource. It distinguishes itself from siblings like 'chat' and 'retrieve' which are not listing datasets.
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 alternatives like 'ask_configured_chat' or how to handle optional parameters. Missing context about prerequisites or scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
retrieveRetrieve chunksB
Retrieve relevant chunks directly from a RAGFlow dataset.
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | Dataset id | |
| question | Yes | Retrieval query | |
| page_size | No | Max chunks, default 8 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only states 'retrieve relevant chunks directly,' implying a read-only operation, but does not mention what happens on invalid dataset_id, whether it modifies data, or any error handling.
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 concise sentence with no wasted words. However, it could be slightly expanded to improve clarity without sacrificing conciseness.
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 lack of output schema and annotations, the description is too minimal. It does not explain the return format, what 'chunks' are, or any pagination details, leaving the agent underinformed for a retrieval tool.
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%, so the input schema already describes each parameter. The description adds no additional meaning beyond what is in the schema, meeting the baseline for high coverage.
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 verb 'retrieve' and the resource 'chunks directly from a RAGFlow dataset'. It distinguishes from sibling tools like 'ask_configured_chat' and 'chat', which involve conversational interactions.
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 implies usage for retrieving chunks, but it does not provide guidance on when to use this tool over siblings (e.g., when to use 'ask_configured_chat' instead). No explicit when-not or alternatives are mentioned.
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.
5 tool updates
v0.1.2- First observed
ask_configured_chat - First observed
chat - First observed
create_chat - First observed
list_datasets - First observed
retrieve
TDQS
Scored across 5 tools
Most tools have distinct purposes: listing datasets, retrieving chunks, and creating chat sessions are clear. However, ask_configured_chat and chat both serve QA functions, which could lead to confusion if the agent does not carefully read the descriptions.
Tool names are inconsistent: some are verb_noun (list_datasets, create_chat), others are single verbs (chat, retrieve), and one includes an adjective (ask_configured_chat). This mixed pattern can confuse an agent.
With 5 tools, the surface is slightly lean but still covers essential RAGFlow operations: listing datasets, creating chats, retrieving chunks, and QA. It does not feel bloated, though a few more tools could enhance completeness.
The tool set lacks update and delete operations for both chats and datasets, and there is no tool to manage documents within datasets. This leaves significant gaps for a production RAG system, potentially causing agent failures.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.