Skip to content

Commit 67de84b

Browse files
ilayaperumalgtzolov
authored andcommitted
Expose the client initialization result
- Add getters for both MCP Sync/Async clients Signed-off-by: Ilayaperumal Gopinathan <[email protected]>
1 parent ee2c891 commit 67de84b

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
@@ -278,6 +278,14 @@ public class McpAsyncClient {
278278
this.transport.setExceptionHandler(this.initializer::handleException);
279279
}
280280

281+
/**
282+
* Get the current initialization result.
283+
* @return the initialization result.
284+
*/
285+
public McpSchema.InitializeResult getCurrentInitializationResult() {
286+
return this.initializer.currentInitializationResult();
287+
}
288+
281289
/**
282290
* Get the server capabilities that define the supported features and functionality.
283291
* @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)