diff --git a/docker/.env b/docker/.env index fec0b927ba..30c7d535c2 100644 --- a/docker/.env +++ b/docker/.env @@ -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 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1a278e40dd..530a7832b1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -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 diff --git a/docs/develop/mcp/use_ragflow_as_mcp_server.md b/docs/develop/mcp/use_ragflow_as_mcp_server.md index 0a9744152f..eb0c58ba28 100644 --- a/docs/develop/mcp/use_ragflow_as_mcp_server.md +++ b/docs/develop/mcp/use_ragflow_as_mcp_server.md @@ -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://:${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