Skip to content

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Jun 21, 2025

  • Move session setup, completion, and error callbacks into doInitialize method
  • Rename variables in McpClientSession for better clarity (sink -> responseSink/resultSink)

- Move session setup, completion, and error callbacks into doInitialize method
- Rename variables in McpClientSession for better clarity (sink -> responseSink/resultSink)

Signed-off-by: Christian Tzolov <[email protected]>
Copy link
Member

@chemicL chemicL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement, thanks. Left suggestions.

String requestId = this.generateRequestId();

return Mono.deferContextual(ctx -> Mono.<McpSchema.JSONRPCResponse>create(sink -> {
return Mono.deferContextual(ctx -> Mono.<McpSchema.JSONRPCResponse>create(responseSink -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responseSink vs resultSink still feel quite similar. I have a different proposal.
Sink from Mono.create shall be called pendingResponseSink.
Sink for handle operator shall be called deliveredResponseSink.
WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it

}

private Mono<McpSchema.InitializeResult> doInitialize(McpClientSession mcpClientSession) {
private Mono<McpSchema.InitializeResult> doInitialize(Initialization initializaiton) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in "initializaiton" -> should be initialization.

tzolov added a commit that referenced this pull request Jun 24, 2025
- Move session setup, completion, and error callbacks into doInitialize method
- Rename variables in McpClientSession for better clarity (sink -> pendingResponseSink/deliveredResponseSink)

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov
Copy link
Contributor Author

tzolov commented Jun 24, 2025

Addressed review comments, rebased and merged at be719f5

@tzolov tzolov closed this Jun 24, 2025
@tzolov tzolov deleted the improve-mcp-client-structure branch June 24, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants