feat(mcp): expose configurable listener transport settings (#21547)

This commit is contained in:
Sbaaoui Idriss authored and GitHub committed 2026-10-27 16:36:57 +08:00
1 parent 0cfa864cc6
commit 076d428396
3 files changed
+7 -8

No files matched your search

+3
View File
@@ -564,3 +564,6 @@ OAUTH_AUTO_REGISTER=true
# RAGFLOW_MCP_PORT=9382
# RAGFLOW_MCP_LAUNCH_MODE=self-host
# RAGFLOW_MCP_HOST_API_KEY=
# RAGFLOW_MCP_TRANSPORT_STREAMABLE_ENABLED=true
# RAGFLOW_MCP_TRANSPORT_SSE_ENABLED=true
# RAGFLOW_MCP_JSON_RESPONSE=true
+2 -1
View File
@@ -18,7 +18,7 @@ services:
nproc:
soft: 65535
hard: 65535
# MCP is served in-process by the API server (POST /mcp on the 9380 port).
# Go API also serves POST /api/v1/mcp on 9380; the optional listener is separate.
# Example configuration to start Admin server:
command:
@@ -30,6 +30,7 @@ services:
- ${SVR_WEB_HTTPS_PORT}:443
- ${SVR_HTTP_PORT}:9380
- ${ADMIN_SVR_HTTP_PORT}:9381
# - 0.0.0.0:${SVR_MCP_PORT}:${RAGFLOW_MCP_PORT:-9382}
volumes:
- ./ragflow-logs:/ragflow/logs
# - ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf
@@ -71,14 +71,9 @@ Enabling the listener with its default `self-host` mode requires `mcp.host_api_k
For the Go deployment, use `docker/docker-compose.yml` with `docker/.env`. Uncomment the `mcp` example in `docker/service_conf.yaml.template` or set the equivalent `RAGFLOW_MCP_*` values in `docker/.env`. The Go entrypoint generates the runtime configuration from that template.
To connect to the optional listener from outside the container, set its host to `0.0.0.0` and add this mapping under the `ragflow-cpu` service's `ports` in `docker/docker-compose.yml`:
Set `RAGFLOW_MCP_HOST=0.0.0.0` and connect to `http://<docker-host-ip>:${SVR_MCP_PORT}/mcp`. Compose publishes `SVR_MCP_PORT` (default `9382`) on all host IPv4 interfaces to the configured `RAGFLOW_MCP_PORT` (default `9382`) inside the container. Recreate the container after changing these settings.
```yaml
ports:
- ${SVR_MCP_PORT}:9382
```
The checked-in Go Compose file does not publish port `9382` by default. `SVR_MCP_PORT` is defined in `docker/.env`. Adjust the container-side port if you change `mcp.port`. Use `host` mode when external clients must authenticate individually.
This exposes the listener to any network that can reach the host port. In `self-host` mode, every client reaching it shares the configured user's identity. Restrict access with a firewall and use `host` mode when clients should authenticate with their own RAGFlow credentials.
## Verify the endpoint