diff --git a/.gitattributes b/.gitattributes index 526c8a38d4a..199ea9a55b6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -*.sh text eol=lf \ No newline at end of file +*.sh text eol=lf +docker/entrypoint.sh text eol=lf executable diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b9e41df394e..f73d7c031d9 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -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: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh old mode 100644 new mode 100755 diff --git a/docs/develop/mcp.md b/docs/develop/mcp.md index e13ac15fc51..82e624050ce 100644 --- a/docs/develop/mcp.md +++ b/docs/develop/mcp.md @@ -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. @@ -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...