Skip to content

Commit e72f411

Browse files
author
Your Name
committed
v1.2.3: Strict JSON Schema compliance and connection fixes
1 parent 0718ee3 commit e72f411

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/main/java/com/cursor/mcp/McpServer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ public void start() {
5555
sessions.put(sessionId, client);
5656
client.keepAlive();
5757

58+
plugin.getLogger().info("New SSE Client connected. Session ID: " + sessionId);
59+
5860
// Send the endpoint URI event as per MCP HTTP transport
5961
// The client will use this to POST messages
60-
client.sendEvent("endpoint", "/messages?sessionId=" + sessionId);
62+
String endpoint = "/messages?sessionId=" + sessionId;
63+
client.sendEvent("endpoint", endpoint);
6164

62-
client.onClose(() -> sessions.remove(sessionId));
65+
client.onClose(() -> {
66+
sessions.remove(sessionId);
67+
plugin.getLogger().info("SSE Client disconnected. Session ID: " + sessionId);
68+
});
6369
});
6470

6571
app.post("/messages", ctx -> {

src/main/java/com/cursor/mcp/protocol/McpProtocol.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ public String handleRequest(String jsonBody) {
3535
.put("protocolVersion", "2024-11-05");
3636

3737
ObjectNode capabilities = result.putObject("capabilities");
38-
capabilities.putObject("tools");
38+
ObjectNode toolsCap = capabilities.putObject("tools");
39+
toolsCap.put("listChanged", true);
40+
3941
capabilities.putObject("resources");
4042
capabilities.putObject("prompts"); // Add prompts capability
4143

4244
ObjectNode serverInfo = result.putObject("serverInfo");
4345
serverInfo.put("name", "MCPMinecraft");
44-
serverInfo.put("version", "1.1.0");
46+
serverInfo.put("version", "1.2.3");
4547

4648
return createResponse(id, result);
4749
}

0 commit comments

Comments
 (0)