Expose the client initialization result

- Add getters for both MCP Sync/Async clients

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
This commit is contained in:
Ilayaperumal Gopinathan 2025-07-25 19:06:02 +01:00 • committed by Christian Tzolov
commit 67de84b300
2 changed files with 16 additions and 0 deletions

View file

@ -278,6 +278,14 @@ public class McpAsyncClient {
this.transport.setExceptionHandler(this.initializer::handleException);
}
/**
* Get the current initialization result.
* @return the initialization result.
*/
public McpSchema.InitializeResult getCurrentInitializationResult() {
return this.initializer.currentInitializationResult();
}
/**
* Get the server capabilities that define the supported features and functionality.
* @return The server capabilities

View file

@ -73,6 +73,14 @@ public class McpSyncClient implements AutoCloseable {
this.delegate = delegate;
}
/**
* Get the current initialization result.
* @return the initialization result.
*/
public McpSchema.InitializeResult getCurrentInitializationResult() {
return this.delegate.getCurrentInitializationResult();
}
/**
* Get the server capabilities that define the supported features and functionality.
* @return The server capabilities