@@ -77,6 +77,21 @@ public class McpAsyncClient {
77
77
*/
78
78
private final McpSchema .ClientCapabilities clientCapabilities ;
79
79
80
+ /**
81
+ * Client implementation information.
82
+ */
83
+ private final McpSchema .Implementation clientInfo ;
84
+
85
+ /**
86
+ * Server capabilities.
87
+ */
88
+ private McpSchema .ServerCapabilities serverCapabilities ;
89
+
90
+ /**
91
+ * Server implementation information.
92
+ */
93
+ private McpSchema .Implementation serverInfo ;
94
+
80
95
/**
81
96
* Roots define the boundaries of where servers can operate within the filesystem,
82
97
* allowing them to understand which directories and files they have access to.
@@ -100,11 +115,6 @@ public class McpAsyncClient {
100
115
*/
101
116
private final McpTransport transport ;
102
117
103
- /**
104
- * Client implementation information.
105
- */
106
- private Implementation clientInfo ;
107
-
108
118
/**
109
119
* Create a new McpAsyncClient with the given transport and session request-response
110
120
* timeout.
@@ -241,6 +251,9 @@ public Mono<McpSchema.InitializeResult> initialize() {
241
251
242
252
return result .flatMap (initializeResult -> {
243
253
254
+ this .serverCapabilities = initializeResult .capabilities ();
255
+ this .serverInfo = initializeResult .serverInfo ();
256
+
244
257
logger .info ("Server response with Protocol: {}, Capabilities: {}, Info: {} and Instructions {}" ,
245
258
initializeResult .protocolVersion (), initializeResult .capabilities (), initializeResult .serverInfo (),
246
259
initializeResult .instructions ());
@@ -256,6 +269,38 @@ public Mono<McpSchema.InitializeResult> initialize() {
256
269
});
257
270
}
258
271
272
+ /**
273
+ * Get the server capabilities that define the supported features and functionality.
274
+ * @return The server capabilities
275
+ */
276
+ public McpSchema .ServerCapabilities getServerCapabilities () {
277
+ return this .serverCapabilities ;
278
+ }
279
+
280
+ /**
281
+ * Get the server implementation information.
282
+ * @return The server implementation details
283
+ */
284
+ public McpSchema .Implementation getServerInfo () {
285
+ return this .serverInfo ;
286
+ }
287
+
288
+ /**
289
+ * Get the client capabilities that define the supported features and functionality.
290
+ * @return The client capabilities
291
+ */
292
+ public ClientCapabilities getClientCapabilities () {
293
+ return this .clientCapabilities ;
294
+ }
295
+
296
+ /**
297
+ * Get the client implementation information.
298
+ * @return The client implementation details
299
+ */
300
+ public McpSchema .Implementation getClientInfo () {
301
+ return this .clientInfo ;
302
+ }
303
+
259
304
/**
260
305
* Closes the client connection immediately.
261
306
*/
0 commit comments