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): don't reply to JSON-RPC notifications; correct Linux client paths (#32)

haidang1810f05e86cd555b
diff --git a/linux/src/Presentation/Views/MCP/MCPSetupView.cpp b/linux/src/Presentation/Views/MCP/MCPSetupView.cpp
index 04c19d4..680a428 100644
--- a/linux/src/Presentation/Views/MCP/MCPSetupView.cpp
+++ b/linux/src/Presentation/Views/MCP/MCPSetupView.cpp
@@ -33,12 +33,12 @@ struct ClientSpec {
const char* pathTemplate; // ~/ is expanded
};
+// Linux-only clients. Claude Desktop has no Linux build, so it's omitted.
static const ClientSpec kClients[] = {
- {"claude_desktop", "Claude Desktop",
- "~/.config/Claude/claude_desktop_config.json"},
- {"cursor", "Cursor", "~/.cursor/mcp.json"},
- {"windsurf", "Windsurf", "~/.windsurf/mcp.json"},
- {"claude_code", "Claude Code", "~/.claude/settings.json"},
+ {"claude_code", "Claude Code", "~/.claude.json"},
+ {"cursor", "Cursor", "~/.cursor/mcp.json"},
+ {"windsurf", "Windsurf", "~/.codeium/windsurf/mcp_config.json"},
+ {"gemini_cli", "Gemini CLI", "~/.gemini/settings.json"},
};
QString expand(const QString& p) {
diff --git a/linux/src/Services/MCP/MCPServer.cpp b/linux/src/Services/MCP/MCPServer.cpp
index 51e7fc4..6196f66 100644
--- a/linux/src/Services/MCP/MCPServer.cpp
+++ b/linux/src/Services/MCP/MCPServer.cpp
@@ -61,8 +61,12 @@ void MCPServer::start() {
startTime_ = std::chrono::system_clock::now();
if (transport_) {
transport_->setHandler([this](const JSONRPCRequest& req) {
+ // JSON-RPC 2.0: notifications have no `id` and MUST NOT receive a
+ // response. Claude Code drops the connection if it gets an
+ // unsolicited response (zod validation rejects id=null).
+ const bool isNotification = req.id.is_null();
auto resp = handleRequest(req);
- transport_->send(resp);
+ if (!isNotification) transport_->send(resp);
});
transport_->start();
}