Skip to content

Conversation

@bedrin
Copy link
Contributor

@bedrin bedrin commented Oct 30, 2025

Replace invocation of org.springframework.web.reactive.function.server.ServerRequest.headers().asHttpHeaders().containsKey() with !org.springframework.web.reactive.function.server.ServerRequest.headers().header().isEmpty() to support Spring Framework 7.x

Motivation and Context

Spring Boot 4.0 and Spring Framework 7.0 release candidates are now available
Spring AI will use them as a baseline in version 2.0

There's a breaking change in Spring Framework 7.0 with few APIs removed from class org.springframework.http.HttpHeaders

One of removed methods is containsKey() which is used by modelcontextprotocol/java-sdk

This changed replaces it with !org.springframework.web.reactive.function.server.ServerRequest.headers().header().isEmpty() which would work both with Spring Framework 6.x and 7.x and thus enable the migration and early adoption of new framework versions.

How Has This Been Tested?

all tests are green

Breaking Changes

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

N/A

@tzolov tzolov added this to the 0.15.0 milestone Oct 30, 2025
@tzolov
Copy link
Contributor

tzolov commented Oct 30, 2025

Thanks @bedrin

@tzolov tzolov merged commit 14ff4a3 into modelcontextprotocol:main Oct 30, 2025
1 check passed
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