From d261041a9ae8110b826f7b6d362c0c8f5a8471c5 Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Thu, 24 Sep 2026 09:57:52 +0000 Subject: [PATCH] test(mcp): import the fake server class under mcp 1.x and 2.x mcp 2.x removed mcp.server.fastmcp (the high-level server is now mcp.server.MCPServer), so the fake stdio server in this test failed to start on hosts with mcp 2.x installed and four tests failed there. CI pins mcp<2, so this only affected local runs. Try the 1.x import first and fall back to the 2.x name. --- tests/test_mcp_runtime_profile_scope.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_mcp_runtime_profile_scope.py b/tests/test_mcp_runtime_profile_scope.py index fdc3a2d0..db881428 100644 --- a/tests/test_mcp_runtime_profile_scope.py +++ b/tests/test_mcp_runtime_profile_scope.py @@ -51,7 +51,10 @@ WRITE_TOOL = "mcp__atlassian__jira_create_issue" FAKE_SERVER = textwrap.dedent(''' import os - from mcp.server.fastmcp import FastMCP + try: # mcp 1.x (CI pins mcp<2) + from mcp.server.fastmcp import FastMCP + except ImportError: # mcp 2.x renamed the high-level server to MCPServer + from mcp.server import MCPServer as FastMCP mcp = FastMCP("fake-atlassian")