|
|
@@ -23,4 +23,51 @@ public class KprMcpCenterServiceApplication {
|
|
|
//.toolObjects(new MathMcpTool())
|
|
|
.build();
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 1) 现在cmd终点调用:curl -N -i -X GET "http://127.0.0.1:9100/kpr-mcp-center/sse"
|
|
|
+ * 以获取sessionId并保持连接
|
|
|
+ * 2) 以post方法调用:http://127.0.0.1:9100/kpr-mcp-center/sse/message?sessionId=xxx
|
|
|
+ * ```
|
|
|
+ * {
|
|
|
+ * "jsonrpc": "2.0",
|
|
|
+ * "id": 1,
|
|
|
+ * "method": "initialize",
|
|
|
+ * "params": {
|
|
|
+ * "protocolVersion": "2025-06-18",
|
|
|
+ * "capabilities": {},
|
|
|
+ * "clientInfo": {
|
|
|
+ * "name": "postman-client",
|
|
|
+ * "version": "1.0.0"
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ * ```
|
|
|
+ * 3) 以post方法调用:http://127.0.0.1:9100/kpr-mcp-center/sse/message?sessionId=xxx
|
|
|
+ * ```
|
|
|
+ * {
|
|
|
+ * "jsonrpc": "2.0",
|
|
|
+ * "method": "notifications/initialized"
|
|
|
+ * }
|
|
|
+ * ```
|
|
|
+ * 4) 以post方法调用:http://127.0.0.1:9100/kpr-mcp-center/sse/message?sessionId=xxx
|
|
|
+ * ```
|
|
|
+ * {
|
|
|
+ * "jsonrpc": "2.0",
|
|
|
+ * "id": 2,
|
|
|
+ * "method": "tools/list"
|
|
|
+ * }
|
|
|
+ * ```
|
|
|
+ * 5) 以post方法调用:http://127.0.0.1:9100/kpr-mcp-center/sse/message?sessionId=xxx
|
|
|
+ * ```
|
|
|
+ * {
|
|
|
+ * "jsonrpc": "2.0",
|
|
|
+ * "id": 2,
|
|
|
+ * "method": "tools/call",
|
|
|
+ * "params": {
|
|
|
+ * "name": "add",
|
|
|
+ * "arguments": {"a":10,"b":10}
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ * ```
|
|
|
+ */
|
|
|
}
|