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 all 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
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.sh text eol=lf
*.sh text eol=lf
docker/entrypoint.sh text eol=lf executable
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ 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:/ragflow/entrypoint.sh

env_file: .env
environment:
Expand Down
Empty file modified docker/entrypoint.sh
100644 → 100755
Empty file.
22 changes: 19 additions & 3 deletions docs/develop/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Here are three augments required, the first two,`host` and `port`, are self-expl

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
#### Alongside RAGFlow {#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.
To enable it, simply find `docker/docker-compose.yml` to uncomment `services.ragflow.command` section.
Expand All @@ -81,10 +81,26 @@ 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` and use bare string without quotation marks here.
```

Then launch it normally `docker compose -f docker-compose.yml`.
To troubleshoot, launch the service in the foreground using `docker compose -f docker-compose.yml`.

### For those upgrading from versions before v0.18.0

1. Get all MCP related files ready.
1. copy `mcp/` directory to local.
1. copy `docker/docker-compose.yml` to local.
1. copy `docker/entrypoint.sh` to local.
1. resolve necessary dependencies via `uv`.
- simply run `uv add mcp` if it works for you. Or:
- copy `pyproject.toml` and run `uv sync --python 3.10 --all-extras`.
1. Change `docker-compose.yml` to enable MCP as it is disable by default, [see last section](#alongside_ragflow).
1. Launch the service with `docker compose -f docker-compose.yml up -d`

### Check the MCP server status

Checking logs of RAGFlow server with `docker logs ragflow-server`. If you see the MCP server ASCII art there, it means all is OK!

```bash
ragflow-server | Starting MCP Server on 0.0.0.0:9382 with base URL http://127.0.0.1:9380...
Expand Down