ragflow-mcp-server-fixed
ragflow-mcp-server-fixed
stdio MCP 클라이언트를 위한 수정된 RAGFlow MCP 서버입니다.
실행 파일 이름을 ragflow-mcp-server로 유지하므로, 클라이언트는 패키지 소스만 변경하여 기존 패키지에서 전환할 수 있습니다.
수정 사항
일부 RAGFlow 배포 환경에서는 레거시 채팅 엔드포인트에서 오류가 발생합니다. 예:
'NoneType' object is not subscriptable
required argument are missing: messages이 서버는 다음과 같은 방식으로 이를 처리합니다:
RAGFlow HTTP API를 직접 호출합니다.
스트림 응답을 방어적으로 파싱합니다.
필요 시 OpenAI 호환 RAGFlow 엔드포인트로 폴백합니다.
RAGFlow에서 더 명확한 오류 메시지를 반환합니다.
도구
도구 | 목적 |
| RAGFlow 데이터셋을 나열합니다. |
| 데이터셋에 대한 채팅 어시스턴트와 세션을 생성합니다. |
|
|
| 서버에 구성된 RAGFlow 채팅 어시스턴트에게 직접 질문합니다. |
| 데이터셋에서 일치하는 청크를 직접 검색합니다. |
대부분의 사용 사례에서는 --default-chat-name 또는 --default-chat-id를 구성한 다음 ask_configured_chat을 사용하는 것이 좋습니다.
빠른 시작
{
"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>"
]
}MCP 클라이언트가 환경 변수를 지원하는 경우:
{
"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>"
}
}가능하면 이름 대신 채팅 ID를 사용하세요:
{
"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>"
]
}서버 옵션
옵션 | 환경 변수 | 설명 |
|
| RAGFlow API 키. |
|
| RAGFlow 기본 URL. |
|
|
|
|
|
|
|
| 구성된 채팅을 위해 생성된 세션 이름. |
로컬 개발
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.py보안
API 키를 커밋하지 마십시오.
보안 정보는 환경 변수를 사용하는 것을 권장합니다.
로그, 스크린샷, 공개 이슈 또는 채팅 기록에 노출된 키는 즉시 교체하십시오.
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 OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
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.