File tree Expand file tree Collapse file tree
src/main/java/com/cursor/mcp Expand file tree Collapse file tree Original file line number Diff line number Diff 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 -> {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments