Repository navigation
test(mcp): migrate the mcp test helpers to the mcp 2.x MCPServer API - #42075
Merged
Merged
Conversation
pyproject pins mcp>=2.2.0,<3, where FastMCP was renamed to MCPServer and stateless_http, json_response, transport_security, host and port moved off the constructor onto streamable_http_app() and run(). The two helpers still imported mcp.server.fastmcp, so every module reaching them died at collection and integration-extensions went red on the release candidate. This ports the helpers verbatim from main, where the same migration already landed in 479360a after rc/1.103.0 was cut. Only the two helper files are taken; the rest of that commit restores unrelated test surface. Collection on the four affected modules: 4 errors and 0 tests before, 0 errors and 6 tests after.
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
integration-extensionsis red onrc/1.103.0mcp.server.fastmcpmcp>=2.2.0,<3, where that module is goneHow it solves it:
mainUser Flow
Not user-facing. This changes test helpers only; no runtime behavior on any route.
Relevant issues
Affected release
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Root cause:
mcp2.x renamedFastMCPtoMCPServerand movedstateless_http,json_response,transport_security,hostandportoff the constructor ontostreamable_http_app()andrun().pyproject.tomlpinsmcp>=2.2.0,<3, so the v1 import raises at collection. No product code underlitellm/orenterprise/usesFastMCP— this is test-support only.Why
mainis green and the rc is not: the same migration landed onmainin479360ae87, afterrc/1.103.0was cut atfba00f5084. The rc caught the window where an earlier revert (57c757e9d7) was in effect. Only the two helper files are taken from that commit; the rest of it restores unrelated test surface that does not belong on a release candidate.Setup, both sides:
Before (fba00f5)
ModuleNotFoundError: No module named 'mcp.server.fastmcp'on all 4 modulesno tests collected, 4 errors in 0.31sAfter (9f79a59)
mcp.server.fastmcperrors6 tests collected in 0.23sType
✅ Test
Caveats (if any)
Low
tests/mcp_tests/mcp_server.pystill importsFastMCPonmainand here