From f2a14d35eb4fc2621a22571a108487f9024ac44c Mon Sep 17 00:00:00 2001 From: Arnold Wender Date: Sun, 12 Apr 2026 21:23:34 +0200 Subject: [PATCH] fix: implement ping method in MCP server MCP clients such as AnythingLLM v1.12.0 send a ping health-check on connect. Without a handler the server returns -32601 Unknown method, which causes the client to restart the server in a loop. Respond with an empty result object as the MCP spec requires. Fixes #584 --- mempalace/mcp_server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mempalace/mcp_server.py b/mempalace/mcp_server.py index bffd3b2f2d..07267d8821 100644 --- a/mempalace/mcp_server.py +++ b/mempalace/mcp_server.py @@ -868,6 +868,8 @@ def handle_request(request): } elif method == "notifications/initialized": return None + elif method == "ping": + return {"jsonrpc": "2.0", "id": req_id, "result": {}} elif method == "tools/list": return { "jsonrpc": "2.0",