Skip to main content

A mcp server that talk with my ragflow

Project description

RagFlow MCP Server

一个用于与RagFlow知识库系统交互的MCP(Model Context Protocol)服务器。

功能特性

  • 📋 数据集管理: 列出、创建数据集
  • 📄 文档管理: 列出、创建、下载文档
  • 📝 内容管理: 创建文本块(chunks)到文档
  • 🔍 智能检索: 在知识库中搜索相关内容
  • 🚀 自动检测: 自动查找文档所属数据集

安装

# 安装依赖
pip install fastmcp requests httpx

# 或者安装包
pip install ragflow-mcp

MCP 客户端配置

在你的MCP客户端配置文件中添加以下配置:

方式1: 使用uvx运行(推荐)

{
  "mcpServers": {
    "ragflow_mcp": {
      "command": "uvx",
      "args": [
        "ragflow-mcp",
        "--address", "your-ragflow-server.com",
        "--api-key", "your-api-key-here",
        "--dataset-id", "your-default-dataset-id",
        "--dataset-name", "你的默认数据集名称"
      ]
    }
  }
}

方式2: 使用本地开发版本

{
  "mcpServers": {
    "ragflow_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/ragflow_mcp/src",
        "run",
        "mcp_server_stdio.py",
        "--address", "your-ragflow-server.com",
        "--api-key", "your-api-key-here",
        "--dataset-id", "your-default-dataset-id",
        "--dataset-name", "你的默认数据集名称"
      ]
    }
  }
}

方式3: 使用Python直接运行

{
  "mcpServers": {
    "ragflow_mcp": {
      "command": "python",
      "args": [
        "/path/to/ragflow_mcp/src/mcp_server_stdio.py",
        "--address", "your-ragflow-server.com",
        "--api-key", "your-api-key-here",
        "--dataset-id", "your-default-dataset-id",
        "--dataset-name", "你的默认数据集名称"
      ]
    }
  }
}

参数说明

参数 必需 说明 示例
--address RagFlow服务器地址 ragflow.example.com
--api-key RagFlow API密钥 ragflow-xxxxx
--dataset-id 默认数据集ID abc123def456
--dataset-name 默认数据集名称 我的知识库

可用工具

1. list_all_datasets

列出所有可用的数据集

2. list_all_documents

列出指定数据集下的所有文档

3. create_new_dataset

创建新的数据集

4. create_empty_document

创建空白文档

5. create_chunk_to_document

向文档添加内容块

6. search_chunks

搜索相关内容

7. download_document

下载文档

配置示例

Claude Desktop 配置示例

{
  "mcpServers": {
    "ragflow_mcp": {
      "command": "uvx",
      "args": [
        "ragflow-mcp",
        "--address", "ragflow.iepose.cn",
        "--api-key", "ragflow-g4ZTU4ZjM4YTAwMTExZWZhZjkyMDI0Mm",
        "--dataset-id", "c3303d4ee45611ef9b610242ac180003",
        "--dataset-name", "第二大脑"
      ]
    }
  }
}

安全注意事项

  • ⚠️ API密钥安全: 确保API密钥不会被意外泄露
  • 🔐 访问权限: 只配置你有权访问的RagFlow服务器
  • 📝 配置保护: 注意保护包含敏感信息的配置文件

故障排除

连接失败

检查服务器地址和API密钥是否正确:

python src/mcp_server_stdio.py --address your-server --api-key your-key

权限错误

确保API密钥有足够的权限访问指定的数据集。

配置问题

确保所有必需参数都已正确传递。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragflow_mcp-1.1.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragflow_mcp-1.1.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file ragflow_mcp-1.1.0.tar.gz.

File metadata

  • Download URL: ragflow_mcp-1.1.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for ragflow_mcp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 367c15c5af92ebef711f242aee47ab5f54f32d1c395e71fb063452e0c064676d
MD5 d2a857a4300642977a7e0914154da02b
BLAKE2b-256 5e810555f09ca740ab41e4dcfcfdff6bf713a8b18d98cb9683ddd0f35409c3e7

See more details on using hashes here.

File details

Details for the file ragflow_mcp-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ragflow_mcp-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b604012e6ce7cb0e987af4c41d734fabb2541ab6f95565897776d9c2a45eede0
MD5 672d5559fdd0dea0fdf1de82466e9879
BLAKE2b-256 1711de013c8d7f8790d41764be38acd0ee463575d615f842f2d3e1b93b297739

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page