Skip to content

Fix mcp server startup failure #7329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ services:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ../history_data_agent:/ragflow/history_data_agent
- ./service_conf.yaml.template:/ragflow/conf/service_conf.yaml.template
# 添加新的卷挂载来覆盖entrypoint.sh,老的不生效。
- ./entrypoint.sh:/ragflow/entrypoint.sh

env_file: .env
environment:
Expand Down
39 changes: 34 additions & 5 deletions docs/develop/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ For testing purposes, there is an [MCP client example](#example_mcp_client) prov

Here are three augments required, the first two,`host` and `port`, are self-explained. The`base_url` is the address of the ready-to-serve RAGFlow server to actually perform the task.

### Launching from Docker
### Launching from Docker(new install)

Building a standalone MCP server image is straightforward and easy, so we just proposed a way to launch it with RAGFlow server here.

#### Alongside RAGFlow

As MCP server is an extra and optional component of RAGFlow server, we consume that not everybody going to use it. Thus, it is disable by default.
1.As MCP server is an extra and optional component of RAGFlow server, we consume that not everybody going to use it. Thus, it is disable by default.
To enable it, simply find `docker/docker-compose.yml` to uncomment `services.ragflow.command` section.

```yaml
Expand All @@ -81,11 +81,40 @@ services:
- --mcp-base-url=http://127.0.0.1:9380
- --mcp-script-path=/ragflow/mcp/server/server.py
- --mcp-mode=self-host # `self-host` or `host`
- --mcp-host-api-key="ragflow-xxxxxxx" # only need to privide when mode is `self-host`
```
- --mcp-host-api-key=ragflow-xxxxxxx # only need to privide when mode is `self-host`& !!! do not add "" or it says:"api-key is wrong"!!!

2.docker compose -f docker-compose.yml up -d

### Launching from Docker(upgrade from old version)

Then launch it normally `docker compose -f docker-compose.yml`.
Building a standalone MCP server image is straightforward and easy, so we just proposed a way to launch it with RAGFlow server here.

#### Alongside RAGFlow

1.As MCP server is an extra and optional component of RAGFlow server, we consume that not everybody going to use it. Thus, it is disable by default.
To enable it, simply find `docker/docker-compose.yml` to uncomment `services.ragflow.command` section.

```yaml
services:
ragflow:
...
image: ${RAGFLOW_IMAGE}
# example to setup MCP server
command:
- --enable-mcpserver
- --mcp-host=0.0.0.0
- --mcp-port=9382
- --mcp-base-url=http://127.0.0.1:9380
- --mcp-script-path=/ragflow/mcp/server/server.py
- --mcp-mode=self-host # `self-host` or `host`
- --mcp-host-api-key=ragflow-xxxxxxx # only need to privide when mode is `self-host`& !!! do not add "" or it says:"api-key is wrong"!!!
2.cp mcp directory to local
3.cp docker/docker-compose.yml to local
4.cp docker/entrypoint.sh to local
5.docker compose -f docker-compose.yml up -d

### check mcp server status
docker logs ragflow-server(if see mcp server ,it means all ok!)
```bash
ragflow-server | Starting MCP Server on 0.0.0.0:9382 with base URL http://127.0.0.1:9380...
ragflow-server | Starting 1 task executor(s) on host 'dd0b5e07e76f'...
Expand Down
Loading