Skip to content

feat(client): add WebFluxStreamableClientTransport.java #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Yeaury
Copy link

@Yeaury Yeaury commented Apr 16, 2025

add WebFluxStreamableClientTransport.java

Motivation and Context

Add client support for 2025-03-26 protocol version

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the [MCP Documentation](https://modelcontextprotocol.io)
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Copy link

@edwardcapriolo edwardcapriolo left a comment

Choose a reason for hiding this comment

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

All just nitpicky comments.

import java.util.function.BiConsumer;
import java.util.function.Function;

public class WebFluxStreamableClientTransport implements McpClientTransport {

Choose a reason for hiding this comment

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

Just from an outsider it is hard to understand what all this does without a test of some sort. Maybe at least some javaadoc.

Copy link
Author

Choose a reason for hiding this comment

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

First of all thank you for your guidance

This PR primarily aims to support streaming HTTP transport for the 2025-03-26 protocol version.

The main changes are as follows:
The client sends an initialization POST request to the /message endpoint, and the server may optionally generate and return a session ID to the client.
All messages are sent via HTTP POST requests to the /message endpoint. If a session ID exists, it MUST be included in the request.
The client handles responses from the server accordingly based on the protocol specifications.

I have verified the changes locally, and test cases or Javadoc will be added in subsequent updates.

Choose a reason for hiding this comment

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

It's better to add a UT for the code, demonstrating both how it works and it can work as expected.

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.

3 participants