feat: add idiomatic sync client support and advanced builder options#67
Open
stenalpjolly wants to merge 2 commits into
Open
feat: add idiomatic sync client support and advanced builder options#67stenalpjolly wants to merge 2 commits into
stenalpjolly wants to merge 2 commits into
Conversation
ec18fe5 to
7b0c143
Compare
…TP transport layers
e451965 to
1115da6
Compare
1115da6 to
985b161
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a thread-safe, protocol-agnostic synchronous wrapper client (
McpToolboxSyncClient) that delegates blocking operations to the asynchronous client core. Introduces advanced configuration parameters on the client builder (connectTimeout,requestTimeout,logger), allowing users to fully customize connection handshakes, request timeouts, and telemetry logging, while maintaining strict architectural decoupling between the core client and transport layers.Expectation & Implementation
McpToolboxSyncClientand its default implementationHttpMcpToolboxSyncClient.buildSync(),connectTimeout(),requestTimeout(), andlogger()toMcpToolboxClient.Builderand implemented them inMcpToolboxClientBuilder.HttpMcpTransportconstructor, preserving a clean separation of concerns.initializeandnotifications/initialized) are isolated from tool-specific overrides by applyingclientHeaders+Authorizationoverrides, preventing tool-level headers from leaking into client handshakes.Acceptance criteria
HttpMcpToolboxSyncClient.java) and newly modified classes must be verified to be 100.00%.CompletionException/CancellationExceptionand surface protocol-specific exceptions (McpToolboxException,IllegalArgumentException) directly to the caller.Test cases
McpToolboxSyncClientTest.java: Added exhaustive unit tests ensuring 100.00% line coverage of all sync delegation methods and exception-translating branches.McpToolboxClientBuilderTest.java: AddedtestMcpTransportExceptionConstructorsto verify all constructors and status code getters onMcpTransportException.HttpMcpTransportTest.java: AddedtestInvokeTool_WithRequestTimeoutto verify client-level HTTP request timeout limits propagation.ToolTest.java: Verified recursive deep-copying of list-type parameter defaults insideTool.java.Breaking changes
None. All new methods and records are fully backward-compatible.