Skip to content

A native macOS / windows / Linux database IDE built with Swift and AppKit. Connect to PostgreSQL, MySQL, SQLite, and Redis from a single app with a fast, keyboard-driven interface.

C++

fix(mcp): stop lying about prompts/resources capabilities — Claude CLI rejects

DangHuynh46f64055fe9d
diff --git a/windows/Gridex/Models/MCP/MCPServerInfo.h b/windows/Gridex/Models/MCP/MCPServerInfo.h
index 98e4d1f..1636041 100644
--- a/windows/Gridex/Models/MCP/MCPServerInfo.h
+++ b/windows/Gridex/Models/MCP/MCPServerInfo.h
@@ -29,16 +29,18 @@ namespace DBModels
}
};
- // Capabilities advertised in `initialize` result. Matches
- // macOS handleInitialize() — exposes tools + resources +
- // prompts + logging capability flags.
+ // Capabilities advertised in `initialize` result. We only
+ // implement `tools` right now — advertising `resources` /
+ // `prompts` the way macOS does would be a protocol lie since
+ // we return methodNotFound on their list endpoints, and
+ // Claude CLI drops the connection when the server contradicts
+ // its own capability manifest. Expose tools only; prompts +
+ // resources land when their handlers do.
inline nlohmann::json mcpDefaultCapabilities()
{
return {
- {"tools", {{"listChanged", true}}},
- {"resources", {{"subscribe", true}, {"listChanged", true}}},
- {"prompts", {{"listChanged", true}}},
- {"logging", nlohmann::json::object()}
+ {"tools", {{"listChanged", true}}},
+ {"logging", nlohmann::json::object()}
};
}
}
diff --git a/windows/Gridex/Services/MCP/MCPServer.cpp b/windows/Gridex/Services/MCP/MCPServer.cpp
index 09e5372..5795b5c 100644
--- a/windows/Gridex/Services/MCP/MCPServer.cpp
+++ b/windows/Gridex/Services/MCP/MCPServer.cpp
@@ -145,9 +145,21 @@ namespace DBModels
try
{
if (m == "initialize") resp = handleInitialize(req);
- else if (m == "initialized") return; // notification — no response
+ // MCP notifications — client fire-and-forget, no response.
+ else if (m == "initialized") return;
+ else if (m == "notifications/initialized") return;
else if (m == "tools/list") resp = handleToolsList(req);
else if (m == "tools/call") resp = handleToolsCall(req);
+ // Claude CLI probes these even when our initialize
+ // doesn't advertise prompts/resources — return empty
+ // lists so the client treats the server as healthy
+ // instead of disconnecting on methodNotFound.
+ else if (m == "prompts/list")
+ resp = JSONRPCResponse::ok(req.id, nlohmann::json{{"prompts", nlohmann::json::array()}});
+ else if (m == "resources/list")
+ resp = JSONRPCResponse::ok(req.id, nlohmann::json{{"resources", nlohmann::json::array()}});
+ else if (m == "resources/templates/list")
+ resp = JSONRPCResponse::ok(req.id, nlohmann::json{{"resourceTemplates", nlohmann::json::array()}});
else if (m == "ping")
resp = JSONRPCResponse::ok(req.id, nlohmann::json{{"pong", true}});
else if (m == "shutdown")