Ragflow Mcp ragflow-mcp
Connect an agent to RAGFlow over MCP and use its tools: ragflow_retrieval, ragflow_list_datasets and ragflow_list_chats. Covers the /api/v1/mcp endpoint vs the optional MCP listener, host vs self-host authentication, Docker exposure, and retrieval parameters.
Use it when an agent should search RAGFlow datasets for grounded context.
- Our test
- 8/10✓ Verified
- tested Dec 6, 2026
- GitHub stars
- 95k
- infiniflow/ragflow
- Added by
- 0
- members
- Updated
- Dec 6
- commit ab0327f
- Content
- 1 file
- no scripts · 3 KB
- License
- Apache 2.0
- free to use
What our test found
Le skill fournit des consignes concrètes de connexion et de recherche, avec de bons garde-fous pour les clés et l’exposition réseau.
Limits spotted
- Documentation references are provided without links or versions, so details may become outdated.
- It does not explain how to handle errors or verify that MCP tools are actually accessible.
name: ragflow-mcp description: >- Connect an agent to RAGFlow over MCP and use its tools: ragflow_retrieval, ragflow_list_datasets and ragflow_list_chats. Covers the /api/v1/mcp endpoint vs the optional MCP listener, host vs self-host authentication, Docker exposure, and retrieval parameters. Use when an agent should search RAGFlow datasets for grounded context.
RAGFlow over MCP
References: docs/develop/mcp/use_ragflow_as_mcp_server.md, docs/develop/mcp/mcp_tools.md, docs/develop/mcp/mcp_client_example.md.
Endpoints
| Endpoint | Notes | |----------|-------| | POST http://<host>:9380/api/v1/mcp | Always on with the Go API. Streamable HTTP. Each client sends Authorization: Bearer <RAGFlow API key>. No SSE. | | http://<host>:9382/mcp (optional listener) | Enable with mcp.enabled / RAGFLOW_MCP_ENABLED=true. Legacy SSE at /sse + /messages/ if enabled. |
The plugin's .mcp.json points at http://127.0.0.1:9380/api/v1/mcp and reads the key from RAGFLOW_API_KEY. Change the URL for a remote server.
Listener auth modes
host: every request authenticates as its own client (Bearer,X-API-Key,Api-Keyorapi_keyheaders). Prefer this when several people connect.self-host(default): all clients act as the user ofRAGFLOW_MCP_HOST_API_KEY; startup fails if it is empty. Only for trusted clients.
In Docker, setting RAGFLOW_MCP_HOST=0.0.0.0 alone does not publish the listener. Ensure SVR_MCP_PORT=9382 is set in docker/.env (it is in the shipped file), then uncomment the MCP port mapping in docker/docker-compose.yml (127.0.0.1:${SVR_MCP_PORT}:${RAGFLOW_MCP_PORT:-9382}) so host port 9382 binds to localhost, and recreate the container (docker compose up -d --force-recreate). Connect locally at http://127.0.0.1:9382/mcp. In default self-host mode any client that can reach the published port acts as the configured user; a TLS proxy does not block that HTTP port. Only publish beyond localhost with network restrictions, and for remote clients terminate TLS with a reverse proxy or tunnel and point .mcp.json at an https:// URL. Keep keys out of command lines and committed files.
Tools
ragflow_list_datasets(page=1, page_size<=100): one JSON object per line withid,name,description.ragflow_list_chats(page=1, page_size<=100): same shape for chat assistants.ragflow_retrieval(question, dataset_ids?, document_ids?, page, page_size, similarity_threshold=0.2, vector_similarity_weight=0.3, keyword=false, top_k=1024, rerank_id?): omittingdataset_idssearches every accessible dataset. Returns JSON withchunks,paginationandquery_info.
Using retrieval well
- List datasets first and pass
dataset_idsto keep results focused. - Keep
page_sizeat 50 or less;page × page_sizemust stay within the 512-candidate rerank window. - Raise
similarity_thresholdif results are noisy; turn onkeywordfor exact identifiers. - Cite the document names from each chunk when answering.
Calls time out after 60 seconds on the server.