Skip to content

fix(agentic-ai): update Content-Type assertion for mcp-sdk 1.1.2#7070

Merged
chillleader merged 1 commit into
mainfrom
claude/eloquent-franklin-2155f2
Apr 28, 2026
Merged

fix(agentic-ai): update Content-Type assertion for mcp-sdk 1.1.2#7070
chillleader merged 1 commit into
mainfrom
claude/eloquent-franklin-2155f2

Conversation

@chillleader
Copy link
Copy Markdown
Member

Summary

  • mcp-sdk 1.1.2 (bumped in deps: Update all non-major dependencies (main) #7039) now appends ; charset=UTF-8 to the Content-Type header on HTTP POST requests, changing it from application/json to application/json; charset=UTF-8.
  • McpSdkClientFactoryTest.createsStreamableHttpMcpClient used a strict equalTo("application/json") WireMock assertion, causing all three parameterised test cases (/mcp, /mcp/cluster, /abc123/mcp/cluster) to fail in CI on that PR.
  • Fix: switch the assertion to containing("application/json") so it accepts both forms.

Changes

McpSdkClientFactoryTest.java — one line changed + import added.

Testing

mvn test -pl connectors/agentic-ai -Dtest=McpSdkClientFactoryTest
# Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS

This fix should be cherry-picked / merged into #7039 (or that PR rebased on top of this) to unblock the Renovate bump.

mcp-sdk 1.1.2 now appends '; charset=UTF-8' to the Content-Type header
on POST requests. Switch the WireMock assertion from equalTo() to
containing() so the test accepts both forms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chillleader chillleader marked this pull request as ready for review April 28, 2026 15:07
@chillleader chillleader requested a review from a team as a code owner April 28, 2026 15:07
Copilot AI review requested due to automatic review settings April 28, 2026 15:07
@chillleader chillleader requested a review from a team as a code owner April 28, 2026 15:07
@chillleader chillleader requested a review from ztefanie April 28, 2026 15:07
@chillleader chillleader requested review from maff and removed request for ztefanie April 28, 2026 15:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Agentic-AI MCP SDK client factory tests to tolerate the Content-Type header change introduced by mcp-sdk 1.1.2 (application/jsonapplication/json; charset=UTF-8), preventing CI failures on the dependency bump.

Changes:

  • Relax WireMock Content-Type request-header assertion from strict equality to substring matching for application/json.
  • Add WireMock containing(...) static import used by the updated assertion.

Comment on lines 129 to 131
postRequestedFor(urlPathEqualTo(endpoint))
.withHeader("Content-Type", equalTo("application/json"))
.withHeader("Content-Type", containing("application/json"))
.withHeader("Accept", equalTo("application/json, text/event-stream"))
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

Using containing("application/json") makes the assertion quite permissive (it would also pass for unexpected values like application/jsonp or other strings that happen to include that substring). Consider using a stricter matcher that still allows the optional ; charset=... parameter (e.g., a regex that matches application/json with optional parameters) so the test continues to validate the media type while remaining compatible with mcp-sdk 1.1.2+.

Copilot uses AI. Check for mistakes.
@chillleader chillleader enabled auto-merge April 28, 2026 15:29
@chillleader chillleader added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit c99eb1f Apr 28, 2026
34 of 36 checks passed
@chillleader chillleader deleted the claude/eloquent-franklin-2155f2 branch April 28, 2026 18:24
@team-connectors-int-automation
Copy link
Copy Markdown
Contributor

Successfully created backport PR for stable/8.9:

chillleader added a commit that referenced this pull request Apr 29, 2026
…) (#7073)

mcp-sdk 1.1.2 now appends '; charset=UTF-8' to the Content-Type header
on POST requests. Switch the WireMock assertion from equalTo() to
containing() so the test accepts both forms.


(cherry picked from commit c99eb1f)

Co-authored-by: Pavel Kotelevskii <38818382+chillleader@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This pull request has been included in release 8.9.2!

Thank you for your contribution! 🚀

@github-actions github-actions Bot added the version:8.9.2 Released in version 8.9.2 label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This pull request has been included in release 8.10.0-alpha1!

Thank you for your contribution! 🚀

@github-actions github-actions Bot added the version:8.10.0-alpha1 Released in version 8.10.0-alpha1 label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport stable/8.9 version:8.9.2 Released in version 8.9.2 version:8.10.0-alpha1 Released in version 8.10.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants