Skip to content

Commit d7f845d

Browse files
committed
Expose the client initialization result
- Add getters for both MCP Sync/Async clients Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
1 parent c3a0b18 commit d7f845d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

mcp/src/main/java/io/modelcontextprotocol/client/McpAsyncClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ public class McpAsyncClient {
273273
this.transport.setExceptionHandler(this.initializer::handleException);
274274
}
275275

276+
/**
277+
* Get the current initialization result.
278+
* @return the initialization result.
279+
*/
280+
public McpSchema.InitializeResult getCurrentInitializationResult() {
281+
return this.initializer.currentInitializationResult();
282+
}
283+
276284
/**
277285
* Get the server capabilities that define the supported features and functionality.
278286
* @return The server capabilities

mcp/src/main/java/io/modelcontextprotocol/client/McpSyncClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ public class McpSyncClient implements AutoCloseable {
7373
this.delegate = delegate;
7474
}
7575

76+
/**
77+
* Get the current initialization result.
78+
* @return the initialization result.
79+
*/
80+
public McpSchema.InitializeResult getCurrentInitializationResult() {
81+
return this.delegate.getCurrentInitializationResult();
82+
}
83+
7684
/**
7785
* Get the server capabilities that define the supported features and functionality.
7886
* @return The server capabilities

0 commit comments

Comments
 (0)