diff --git a/mcp_server/docker/Dockerfile.standalone b/mcp_server/docker/Dockerfile.standalone index aecb4909..6db22d95 100644 --- a/mcp_server/docker/Dockerfile.standalone +++ b/mcp_server/docker/Dockerfile.standalone @@ -71,7 +71,7 @@ EXPOSE 8000 # Health check - verify MCP server is responding HEALTHCHECK --interval=10s --timeout=5s --start-period=15s --retries=3 \ - CMD curl -f http://localhost:8000/ || exit 1 + CMD curl -f http://localhost:8000/health || exit 1 # Run the MCP server CMD ["uv", "run", "main.py"] diff --git a/mcp_server/src/graphiti_mcp_server.py b/mcp_server/src/graphiti_mcp_server.py index 4c442e0e..b75d2c54 100644 --- a/mcp_server/src/graphiti_mcp_server.py +++ b/mcp_server/src/graphiti_mcp_server.py @@ -738,6 +738,12 @@ async def get_status() -> StatusResponse: ) +@mcp.custom_route('/health', methods=['GET']) +async def health_check(request) -> dict: + """Health check endpoint for Docker and load balancers.""" + return {'status': 'healthy', 'service': 'graphiti-mcp'} + + async def initialize_server() -> ServerConfig: """Parse CLI arguments and initialize the Graphiti server configuration.""" global config, graphiti_service, queue_service, graphiti_client, semaphore