
Ragflow-Knowledge-MCP-Server
Un simple serveur MCP de base de connaissances pour Ragflow.
3 years
Works with Finder
0
Github Watches
2
Github Forks
0
Github Stars
ragflow-knowledge-mcp-server
A simple MCP server of knowledge base for RAGFlow.
Supported RAGFlow versions:
- 0.17.2
1. Available tools
1. Dynamic knowledge base searching tools
Enable dynamic knowledge base searching tools in config.yaml
, see also Server configurations:
datasets:
- dataset-id: 00000000000000000000000000000000
search-tool-name: search_xxx_knowledge
#search-tool-description: "Search knowledge about XXX(中文说明)."
#search-tool-result: simple
search-tool-description: "Search knowledge about XXX(中文说明). Results in JSON format, knowledge in the 'content' property."
search-tool-result: json
2. list_knowledge_bases
(default disabled)
Enable list_knowledge_bases
tool in config.yaml
:
list-bases-enabled: true
-
Default description: List knowledge bases.
-
Input properties:
-
page
, str: The page number to list the bases for, optional, defaults to 1. -
limit
, str: The maximum number of knowledge bases to list, optional, defaults to 20. -
timeout
, int: Dynamic timeout parameter, enabled bytimeout-param-enabled
, optional, defaults to 60 seconds.
-
3. get_knowledge_base_info
(default disabled)
Enable get_knowledge_base_info
tool in config.yaml
:
get-base-enabled: true
-
Default description: Get information of the specified knowledge base ID, results including the knowledge base name, description, and other information.
-
Input properties:
-
knowledge_base_id
, str: The ID of the knowledge base to query. -
timeout
, int: Dynamic timeout parameter, enabled bytimeout-param-enabled
, optional, defaults to 60 seconds.
-
2. Install and run
2.1. Install using pip
# Uninstall the previous version
pip uninstall --yes ragflow-knowledge-mcp-server
pip install ragflow-knowledge-mcp-server --upgrade --force-reinstall --extra-index-url http://127.0.0.1:8081/repository/pypi-group/simple --trusted-host 127.0.0.1
2.2. Install from source
cd /path/to/project
pip install .
# Or install using pytools.sh
./pytools.sh reinstall
2.3. Run
export SIMP_LOGGER_LOG_FILE=/path/to/mcp.log
export SIMP_LOGGER_LOG_LEVEL=DEBUG
# Run server directly
ragflow-knowledge-mcp-server --config=/path/to/config.yaml
# Or run with python
python -m ragflow_knowledge_mcp_server --config=/path/to/config.yaml
# Or run with uv
uv run ragflow-knowledge-mcp-server --config=/path/to/config.yaml
2.4. Run with Docker or Docker Compose
-
Docker
- Export the
EXTRA_INDEX_URL
environment variable, then run docker/0.1.0/build.sh to build the image, modifying the build script as needed or building manually. - Then refer to docker/0.1.0/run-in-docker.bat to run the container.
- Export the
-
Docker Compose
- Modify the
.env
file. - Modify the
config.yaml
file. - Run docker/0.1.0/docker-compose-up-d.bat to start the container, modifying the startup script as needed or running manually.
- Modify the
3. Server configurations
- YAML:
Example configurations yaml
, for full configuration, see MCPServerProperties.py:
server-name: ragflow-knowledge-base
default-base-url: http://127.0.0.1:9388/api/v1
default-api-key: ragflow-00000000000000000000000000000000
timeout: 60
timeout-param-enabled: false
# SSE
transport: sse # Defaults to stdio
sse-port: 41106
list-bases-enabled: false
get-base-enabled: false
datasets:
- dataset-id: 00000000000000000000000000000000
search-tool-name: search_xxx_knowledge
search-tool-description: "Search knowledge about XXX(中文说明). Results in JSON format, knowledge in the 'content' property."
- enabled: false
id-param-enabled: true
search-tool-name: search_knowledge
search-tool-description: "Search knowledge from specified knowledge base('knowledge_base_id')."
Or configures the base URL and API key for each dataset and tools:
server-name: ragflow-knowledge-base
timeout: 60
timeout-param-enabled: false
# SSE
transport: sse # Defaults to stdio
sse-port: 41106
list-bases-enabled: false
list-bases-base-url: http://127.0.0.1:9388/api/v1
list-bases-api-key: ragflow-00000000000000000000000000000000
get-base-enabled: false
datasets:
- dataset-id: 00000000000000000000000000000000
base-url: http://127.0.0.1:9388/api/v1
api-key: ragflow-00000000000000000000000000000000
# Other properties...
- Available environment variables:
Yaml | Environment variable name | Default value | Description |
---|---|---|---|
RAGFLOW_KNOWLEDGE_MCP_SERVER_CONFIG |
config.yaml |
The config file path, also available in CLI option --config=/path/to/config.yaml . |
|
default-base-url |
DEFAULT_RAGFLOW_KNOWLEDGE_BASE_URL |
- | The default base URL for the knowledge base. |
default-api-key |
DEFAULT_RAGFLOW_KNOWLEDGE_API_KEY |
- | The default API key for the knowledge base. |
server-name |
RAGFLOW_KNOWLEDGE_MCP_SERVER_NAME |
RAGFlow Knowledge Base | The name of the MCP server. |
transport |
RAGFLOW_KNOWLEDGE_MCP_SERVER_TRANSPORT |
stdio | The transport type. Can be stdio or sse . |
sse-transport-endpoint |
RAGFLOW_KNOWLEDGE_MCP_SERVER_SSE_TRANSPORT_ENDPOINT |
/messages/ |
The SSE transport endpoint. |
sse-bind-host |
RAGFLOW_KNOWLEDGE_MCP_SERVER_SSE_BIND_HOST |
0.0.0.0 | The host to bind the SSE transport. |
sse-port |
RAGFLOW_KNOWLEDGE_MCP_SERVER_SSE_PORT |
41106 | The port for the SSE transport. |
sse-debug-enabled |
RAGFLOW_KNOWLEDGE_MCP_SERVER_SSE_DEBUG_ENABLED |
False | Whether to enable debug mode for SSE. |
timeout |
RAGFLOW_KNOWLEDGE_MCP_SERVER_TIMEOUT |
60 | The timeout for the server. |
timeout-param-enabled |
RAGFLOW_KNOWLEDGE_MCP_SERVER_TIMEOUT_PARAM_ENABLED |
False | Whether to enable the timeout parameter. |
timeout-param-description |
RAGFLOW_KNOWLEDGE_MCP_SERVER_TIMEOUT_PARAM_DESCRIPTION |
The total timeout for one calling, in seconds, optional, defaults to {self.timeout} seconds. |
The description of the timeout parameter. |
-
Available environment variables of
simp-logger
:
Variable name | Default value | Description |
---|---|---|
SIMP_LOGGER_LOG_FILE_ENABLED |
True | Whether to enable logging to file. |
SIMP_LOGGER_LOG_CONSOLE_ENABLED |
True | Whether to enable logging to console. |
SIMP_LOGGER_LOG_LEVEL |
INFO | The log level. |
SIMP_LOGGER_LOG_FILE |
~/logs/simp-logger.log |
The log file path. |
SIMP_LOGGER_LOG_PATTERN |
%(asctime)s %(levelname)s [%(threadName)s]: %(message)s |
The log pattern. |
SIMP_LOGGER_LOG_MAX_BYTES |
10485760 (10MB) | The maximum size of the log file. |
SIMP_LOGGER_LOG_BACKUP_COUNT |
5 | The number of backup files to keep. |
SIMP_LOGGER_LOG_ROTATION_TYPE |
size | The type of log rotation. Can be size or time . |
SIMP_LOGGER_LOG_ROTATION_WHEN |
midnight | The time of day to rotate the log file. |
SIMP_LOGGER_LOG_ROTATION_INTERVAL |
1 | The interval for log rotation. |
SIMP_LOGGER_LOG_CLEANUP_DISABLED |
False | Whether to disable logger cleanup. |
4. MCP configurations
4.1. SSE
Example endpoint: http://127.0.0.1:41106/sse
4.2. stdio
Simple command line:
uv run ragflow-knowledge-mcp-server --config=/path/to/config.yaml
JSON:
{
"ragflow-knowledge-base": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"ragflow-knowledge-mcp-server",
"--config=/path/to/config.yaml"
],
"env": {
"SIMP_LOGGER_LOG_CONSOLE_ENABLED": false,
"SIMP_LOGGER_LOG_FILE": "/path/to/mcp.log",
"SIMP_LOGGER_LOG_LEVEL": "DEBUG"
}
}
}
YAML:
ragflow-knowledge-base:
type: stdio
command: uv
args:
- run
- ragflow-knowledge-mcp-server
- "--config=/path/to/config.yaml"
env:
SIMP_LOGGER_LOG_CONSOLE_ENABLED: false
SIMP_LOGGER_LOG_FILE: /path/to/mcp.log
SIMP_LOGGER_LOG_LEVEL: DEBUG
相关推荐
🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
⛓️RULEGO est un cadre de moteur de règle d'orchestration des composants de nouvelle génération légère, intégrée, intégrée et de nouvelle génération pour GO.
Créez facilement des outils et des agents LLM à l'aide de fonctions Plain Bash / JavaScript / Python.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 QQ / 微信 (企业微信、个人微信) / 飞书 / 钉钉 / Discord / Telegram / Slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Dify 、 Claude 、 GEMINI 、 XAI 、 PPIO 、 OLLAMA 、 LM Studio 、阿里云百炼、火山方舟、 Siliconflow 、 Qwen 、 Moonshot 、 ChatGlm 、 Sillytraven 、 MCP 等 LLM 的机器人 / Agent | Plateforme de bots de messagerie instantanée basés sur LLM, prend en charge Discord, Telegram, WeChat, Lark, Dingtalk, QQ, Slack
Reviews

user_NxuE3umQ
As a loyal user of ragflow-knowledge-mcp-server by lumerix7, I am thoroughly impressed by its seamless integration and robust performance. This server has significantly optimized our processes and provided a scalable solution for our knowledge management needs. A must-have for any team looking to streamline their operations!

user_XIaokHf2
I've been using the ragflow-knowledge-mcp-server developed by lumerix7 for a while now, and it has significantly improved my workflow. The integration is seamless, and the performance is top-notch. The server provides an efficient way to manage and process data, making it an essential tool for my application needs. Highly recommended!

user_lQoviTIe
As a devoted user of the ragflow-knowledge-mcp-server by lumerix7, I have to say this product has been a game-changer. It offers reliable knowledge management solutions seamlessly integrated into our existing infrastructure. The performance is top-notch and has drastically improved our workflow efficiency. Highly recommend this server for anyone looking to optimize their data handling and knowledge base management.

user_k8P3FEn6
As a dedicated user of the ragflow-knowledge-mcp-server by lumerix7, I am extremely impressed with its capabilities. The server seamlessly integrates with my MCP applications, providing reliable and efficient performance. Its robust architecture and user-friendly interface make it a standout choice for anyone in need of a powerful knowledge management system. Highly recommended!

user_oXDLx5OS
I've been using Ragflow Knowledge MCP Server by Lumerix7 and it has significantly streamlined my workflow. The server's seamless integration and intuitive interface make managing MCP applications incredibly efficient. Highly recommend it to anyone in need of a robust and reliable MCP server solution!

user_B0fJMWcu
As a dedicated user of ragflow-knowledge-mcp-server by lumerix7, I am impressed with its seamless integration and robust performance. It provides an excellent knowledge management system with user-friendly features. The detailed welcome information and easy-to-navigate start URL make onboarding simple. I highly recommend this product to anyone looking for a reliable MCP server solution.

user_Tzisnwa3
As a dedicated user of ragflow-knowledge-mcp-server by lumerix7, I am thoroughly impressed by its seamless integration and robust performance. This product has significantly enhanced my workflow efficiency and knowledge management capabilities. The setup was straightforward, and the user interface is intuitive. Overall, I highly recommend it to anyone looking for a reliable MCP server solution.

user_uVxynary
As a dedicated user of the ragflow-knowledge-mcp-server by Lumerix7, I am thoroughly impressed with its seamless integration and robust performance. It has significantly enhanced our knowledge management capabilities, making information retrieval quicker and more efficient. Highly recommended for any organization looking to streamline their MCP applications.

user_BcdhUAuH
As a dedicated user of the ragflow-knowledge-mcp-server by lumerix7, I can attest to its exceptional functionality and efficiency. The seamless integration and user-friendly interface make managing MCP processes incredibly straightforward. Highly recommended for anyone needing robust and reliable MCP support!