From 3463cbf58b1674f8765f111da6002e7f7cee768c Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:30:51 -0700 Subject: [PATCH] fix: Return JSONResponse from health check endpoint Fixed TypeError in health check endpoint by returning a proper Starlette JSONResponse object instead of a plain dict. Starlette custom routes require ASGI-compatible response objects. Error was: TypeError: 'dict' object is not callable --- mcp_server/src/graphiti_mcp_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mcp_server/src/graphiti_mcp_server.py b/mcp_server/src/graphiti_mcp_server.py index 21f5e0a2..1fcb746f 100644 --- a/mcp_server/src/graphiti_mcp_server.py +++ b/mcp_server/src/graphiti_mcp_server.py @@ -19,6 +19,7 @@ from graphiti_core.search.search_filters import SearchFilters from graphiti_core.utils.maintenance.graph_data_operations import clear_data from mcp.server.fastmcp import FastMCP from pydantic import BaseModel +from starlette.responses import JSONResponse from config.schema import GraphitiConfig, ServerConfig from models.response_types import ( @@ -745,9 +746,9 @@ async def get_status() -> StatusResponse: @mcp.custom_route('/health', methods=['GET']) -async def health_check(request) -> dict: +async def health_check(request) -> JSONResponse: """Health check endpoint for Docker and load balancers.""" - return {'status': 'healthy', 'service': 'graphiti-mcp'} + return JSONResponse({'status': 'healthy', 'service': 'graphiti-mcp'}) async def initialize_server() -> ServerConfig: