MCP Hub
Back to servers

ragflow-mcp-server-fixed

A fixed MCP server that interacts with RAGFlow for dataset management and chat operations, handling legacy endpoint errors and providing a fallback to OpenAI-compatible endpoints.

glama
Updated
May 4, 2026

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

ToolPurpose
list_datasetsList RAGFlow datasets.
create_chatCreate a chat assistant and session for a dataset.
chatAsk a question in a session returned by create_chat.
ask_configured_chatAsk a server-configured RAGFlow chat assistant directly.
retrieveRetrieve 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

OptionEnvironment variableDescription
--api-keyRAGFLOW_API_KEYRAGFlow API key.
--base-urlRAGFLOW_BASE_URLRAGFlow base URL.
--default-chat-idRAGFLOW_DEFAULT_CHAT_IDExisting RAGFlow chat assistant ID for ask_configured_chat.
--default-chat-nameRAGFLOW_DEFAULT_CHAT_NAMEExisting RAGFlow chat assistant name for ask_configured_chat.
--default-session-nameRAGFLOW_DEFAULT_SESSION_NAMESession 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.

Reviews

No reviews yet

Sign in to write a review