Skip to content

Commit a076b82

Browse files
committed
feat: Add getClientInfo and getClientCapabilities to McpServerSession.
Signed-off-by: He-Pin <hepin1989@gmail.com>
1 parent 07e7b8f commit a076b82

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mcp/src/main/java/io/modelcontextprotocol/spec/McpServerSession.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ public String getId() {
8989
return this.id;
9090
}
9191

92+
/**
93+
* Retrieve the current client info of the session.
94+
* @return the client information, such as name and version
95+
*/
96+
public McpSchema.Implementation getClientInfo() {
97+
return this.clientInfo.get();
98+
}
99+
100+
/**
101+
* Retrieve the current client capabilities of the session.
102+
* @return the client capabilities, such as supported features
103+
*/
104+
public McpSchema.ClientCapabilities getClientCapabilities() {
105+
return this.clientCapabilities.get();
106+
}
107+
92108
/**
93109
* Called upon successful initialization sequence between the client and the server
94110
* with the client capabilities and information.

0 commit comments

Comments
 (0)