Skip to main content
Glama
ragflow-mcp-server-fixed

ragflow-mcp-server-fixed

by FoundZiGu

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: messages

This 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_datasets

List RAGFlow datasets.

create_chat

Create a chat assistant and session for a dataset.

chat

Ask a question in a session returned by create_chat.

ask_configured_chat

Ask a server-configured RAGFlow chat assistant directly.

retrieve

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

--api-key

RAGFLOW_API_KEY

RAGFlow API key.

--base-url

RAGFLOW_BASE_URL

RAGFlow base URL.

--default-chat-id

RAGFLOW_DEFAULT_CHAT_ID

Existing RAGFlow chat assistant ID for ask_configured_chat.

--default-chat-name

RAGFLOW_DEFAULT_CHAT_NAME

Existing RAGFlow chat assistant name for ask_configured_chat.

--default-session-name

RAGFLOW_DEFAULT_SESSION_NAME

Session name created for the configured chat.

Local Development

uv run ragflow-mcp-server --help
export 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

Security

  • 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 tools
ask_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.

Inputs: question (required), stream, new_session, session_name.

chatChatC

Ask a question in a created RAGFlow chat session.

Inputs: session_id (required), question (required), stream.

create_chatCreate chatB

Create a RAGFlow chat assistant and session for one dataset.

Inputs: dataset_id (required), name, llm_id, prompt_config, +1 more.

list_datasetsList datasetsB

List RAGFlow datasets. Returns dataset id and name.

Inputs: id, name.

retrieveRetrieve chunksB

Retrieve relevant chunks directly from a RAGFlow dataset.

Inputs: dataset_id (required), question (required), page_size.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 5 tools

    Disambiguation4/5

    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.

    Naming Consistency2/5

    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.

    Tool Count4/5

    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.

    Completeness2/5

    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.

    Related MCP Connectors