Skip to content

Conversation

Kehrlann
Copy link
Contributor

This PR adds McpTransportContext to MCP Clients, and makes it available to (Async|Sync)HttpRequestCustomizers.

Motivation and Context

The motivation is twofold:

  • It creates a unified API for reading the "context" in which an MCP Client request is issued, regardless of sync/async. It can be consumed by HttpClient-based transports through HttpRequestCustomizer, or through the reactor context in WebClient-based transports.
  • It also addresses limitations with thread local usage in request customizers, see TransportContext for Client side #479

How Has This Been Tested?

TODO

Breaking Changes

n/a

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
  • 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

@Kehrlann Kehrlann force-pushed the dgarnier/client-mcptransportcontext branch from a293207 to b111a86 Compare August 27, 2025 16:27
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.

1 participant