mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 12:32:30 +08:00
Feat: add mcp self-host mode (#7157)
### What problem does this PR solve? Add mcp self-host mode, a complement of #7084. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -15,6 +15,8 @@ services:
|
||||
# - --mcp-port=9382
|
||||
# - --mcp-base-url=http://127.0.0.1:9380
|
||||
# - --mcp-script-path=/ragflow/mcp/server/server.py
|
||||
# - --mcp-mode=self-host
|
||||
# - --mcp--host-api-key="ragflow-xxxxxxx"
|
||||
container_name: ragflow-server
|
||||
ports:
|
||||
- ${SVR_HTTP_PORT}:9380
|
||||
|
||||
@ -35,6 +35,8 @@ MCP_HOST="127.0.0.1"
|
||||
MCP_PORT=9382
|
||||
MCP_BASE_URL="http://127.0.0.1:9380"
|
||||
MCP_SCRIPT_PATH="/ragflow/mcp/server/server.py"
|
||||
MCP_MODE="self-host"
|
||||
MCP_HOST_API_KEY=""
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Host ID logic:
|
||||
@ -77,6 +79,14 @@ for arg in "$@"; do
|
||||
MCP_BASE_URL="${arg#*=}"
|
||||
shift
|
||||
;;
|
||||
--mcp-mode=*)
|
||||
MCP_MODE="${arg#*=}"
|
||||
shift
|
||||
;;
|
||||
--mcp-host-api-key=*)
|
||||
MCP_HOST_API_KEY="${arg#*=}"
|
||||
shift
|
||||
;;
|
||||
--mcp-script-path=*)
|
||||
MCP_SCRIPT_PATH="${arg#*=}"
|
||||
shift
|
||||
@ -138,7 +148,9 @@ function start_mcp_server() {
|
||||
"$PY" "${MCP_SCRIPT_PATH}" \
|
||||
--host="${MCP_HOST}" \
|
||||
--port="${MCP_PORT}" \
|
||||
--base_url="${MCP_BASE_URL}" &
|
||||
--base_url="${MCP_BASE_URL}" \
|
||||
--mode="${MCP_MODE}" \
|
||||
--api_key="${MCP_HOST_API_KEY}" \ &
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user