From a076b823e04fff5ae416e58bac50c71806205c69 Mon Sep 17 00:00:00 2001 From: He-Pin Date: Thu, 29 May 2025 16:21:09 +0800 Subject: [PATCH] feat: Add getClientInfo and getClientCapabilities to McpServerSession. Signed-off-by: He-Pin --- .../spec/McpServerSession.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java b/mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java index 86906d859..73acf84be 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java +++ b/mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java @@ -89,6 +89,22 @@ public String getId() { return this.id; } + /** + * Retrieve the current client info of the session. + * @return the client information, such as name and version + */ + public McpSchema.Implementation getClientInfo() { + return this.clientInfo.get(); + } + + /** + * Retrieve the current client capabilities of the session. + * @return the client capabilities, such as supported features + */ + public McpSchema.ClientCapabilities getClientCapabilities() { + return this.clientCapabilities.get(); + } + /** * Called upon successful initialization sequence between the client and the server * with the client capabilities and information.