From 1f6abb29259b092f62fb53c28449fedb638392c5 Mon Sep 17 00:00:00 2001 From: Ke Sun Date: Wed, 24 Dec 2025 10:39:13 +0800 Subject: [PATCH 1/2] fix(docker-compose): update image names and restore container name usage for MCP server URL --- .../memory/agent/mcp_server/mcp_instance.py | 5 ++- api/docker-compose.yml | 44 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/api/app/core/memory/agent/mcp_server/mcp_instance.py b/api/app/core/memory/agent/mcp_server/mcp_instance.py index 3a2eeb78..c072a438 100644 --- a/api/app/core/memory/agent/mcp_server/mcp_instance.py +++ b/api/app/core/memory/agent/mcp_server/mcp_instance.py @@ -8,4 +8,7 @@ from mcp.server.fastmcp import FastMCP # Initialize FastMCP server instance # This instance is shared across all tool modules -mcp = FastMCP('data_flow') +mcp = FastMCP( + 'data_flow', + allowed_hosts=["mcp-server", "localhost"] +) \ No newline at end of file diff --git a/api/docker-compose.yml b/api/docker-compose.yml index 48ec137d..e0919c3b 100644 --- a/api/docker-compose.yml +++ b/api/docker-compose.yml @@ -26,9 +26,35 @@ services: - default - celery + # FastAPI application - connects to MCP server + # MCP Server - standalone service + mcp-server: + image: redbear-mem-open:latest + container_name: mcp-server + ports: + - "8081:8081" # MCP server port + env_file: + - .env + environment: + - SERVER_IP=0.0.0.0 # Bind to all interfaces + volumes: + - ./files:/files + - /etc/localtime:/etc/localtime:ro + command: python -m app.core.memory.agent.mcp_server.server + healthcheck: + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8081/sse')"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s + restart: unless-stopped + networks: + - default + - celery + # FastAPI application - connects to MCP server api: - image: redbear-mem:latest + image: redbear-mem-open:latest container_name: api ports: - "8002:8000" @@ -37,6 +63,9 @@ services: environment: - MCP_SERVER_URL=http://mcp-server:8081 - SERVER_IP=0.0.0.0 # Ensure MCP server binds to all interfaces + environment: + - MCP_SERVER_URL=http://mcp-server:8081 # Back to using container name + - SERVER_IP=0.0.0.0 # Ensure MCP server binds to all interfaces volumes: - ./files:/files - /etc/localtime:/etc/localtime:ro @@ -51,15 +80,16 @@ services: # Celery worker - connects to MCP server worker: - image: redbear-mem:latest + image: redbear-mem-open:latest container_name: worker env_file: - .env environment: - - MCP_SERVER_URL=http://mcp-server:8081 + - MCP_SERVER_URL=http://mcp-server:8081 # Back to using container name volumes: - ./files:/files - /etc/localtime:/etc/localtime:ro + - /etc/localtime:/etc/localtime:ro command: celery -A app.celery_worker.celery_app worker --loglevel=info depends_on: mcp-server: @@ -67,5 +97,13 @@ services: restart: unless-stopped networks: - celery +networks: + celery: + depends_on: + mcp-server: + condition: service_healthy + restart: unless-stopped + networks: + - celery networks: celery: \ No newline at end of file From 11dc66960c27312105d2f218d49dd3e73acbd96d Mon Sep 17 00:00:00 2001 From: Ke Sun Date: Wed, 24 Dec 2025 10:40:34 +0800 Subject: [PATCH 2/2] mcp quick fix --- api/docker-compose.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/api/docker-compose.yml b/api/docker-compose.yml index e0919c3b..8470a5d1 100644 --- a/api/docker-compose.yml +++ b/api/docker-compose.yml @@ -1,32 +1,6 @@ version: '3.9' services: - # MCP Server - standalone service - mcp-server: - image: redbear-mem:latest - container_name: mcp-server - ports: - - "8081:8081" # MCP server port - env_file: - - .env - environment: - - SERVER_IP=0.0.0.0 # Bind to all interfaces - volumes: - - ./files:/files - - /etc/localtime:/etc/localtime:ro - command: python -m app.core.memory.agent.mcp_server.server - healthcheck: - test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8081/sse')"] - interval: 10s - timeout: 5s - retries: 5 - start_period: 30s - restart: unless-stopped - networks: - - default - - celery - - # FastAPI application - connects to MCP server # MCP Server - standalone service mcp-server: image: redbear-mem-open:latest @@ -60,9 +34,6 @@ services: - "8002:8000" env_file: - .env - environment: - - MCP_SERVER_URL=http://mcp-server:8081 - - SERVER_IP=0.0.0.0 # Ensure MCP server binds to all interfaces environment: - MCP_SERVER_URL=http://mcp-server:8081 # Back to using container name - SERVER_IP=0.0.0.0 # Ensure MCP server binds to all interfaces @@ -89,7 +60,6 @@ services: volumes: - ./files:/files - /etc/localtime:/etc/localtime:ro - - /etc/localtime:/etc/localtime:ro command: celery -A app.celery_worker.celery_app worker --loglevel=info depends_on: mcp-server: @@ -97,13 +67,5 @@ services: restart: unless-stopped networks: - celery -networks: - celery: - depends_on: - mcp-server: - condition: service_healthy - restart: unless-stopped - networks: - - celery networks: celery: \ No newline at end of file