Skip to content

Commit a8776b4

Browse files
committed
fix: skip health check and verify server during MCP init
Health endpoint requires session in current server implementation. Skip preliminary health check and verify server connectivity during the actual MCP initialize request instead. If server isn't running, initialize will fail with clear error message.
1 parent a6f3c83 commit a8776b4

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

test_http_agentic_tools.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -138,29 +138,11 @@
138138

139139
def check_server():
140140
"""Check if HTTP server is running."""
141-
try:
142-
# Health endpoint requires Accept: text/event-stream header
143-
response = requests.get(
144-
f"{BASE_URL}/health",
145-
headers={"Accept": "text/event-stream"},
146-
timeout=2
147-
)
148-
# Health returns "OK" as plain text even with SSE header
149-
if response.status_code == 200 and "OK" in response.text:
150-
print(f"✓ Server is running at {BASE_URL}")
151-
return True
152-
else:
153-
print(f"\n⚠️ Server responded with status {response.status_code}")
154-
print(f"Response: {response.text}")
155-
return False
156-
except requests.exceptions.RequestException as e:
157-
print(f"\n❌ Server not running at {BASE_URL}")
158-
print(f"Error: {e}")
159-
print("\nStart server with:")
160-
print(f" codegraph start http --port {HTTP_PORT}")
161-
print(f" OR")
162-
print(f" ./start_http_server.sh")
163-
return False
141+
# Skip health check - just assume server is running and test MCP endpoint directly
142+
# Health endpoint has session requirements in current implementation
143+
print(f"Assuming server is running at {BASE_URL}")
144+
print(f"(Will verify during MCP initialization)")
145+
return True
164146

165147
class MCPHttpSession:
166148
"""Manages stateful MCP session over HTTP with SSE."""

0 commit comments

Comments
 (0)