diff --git a/tests/tui_gateway/test_slash_worker_mcp_discovery.py b/tests/tui_gateway/test_slash_worker_mcp_discovery.py index 82b59fe4b8..28bb0dd15d 100644 --- a/tests/tui_gateway/test_slash_worker_mcp_discovery.py +++ b/tests/tui_gateway/test_slash_worker_mcp_discovery.py @@ -14,20 +14,29 @@ import threading import pytest import yaml -pytest.importorskip("mcp.server.fastmcp") +_mcp_server_mod = pytest.importorskip("mcp.server") + +if not hasattr(_mcp_server_mod, "MCPServer"): + # `mcp.server.MCPServer` replaced `mcp.server.fastmcp.FastMCP` in mcp 2.0. + # Skip rather than fail on a FastMCP-era SDK: the probe below is written + # against the 2.x API, and the pinned version provides it. + pytest.skip( + "profile-local MCP discovery probe requires mcp >= 2.0 (MCPServer)", + allow_module_level=True, + ) def test_profile_local_mcp_tool_is_visible_in_slash_worker(tmp_path): profile_home = tmp_path / "profile-home" profile_home.mkdir() marker = "profile-local-61922" - server = tmp_path / "fastmcp_probe.py" + server = tmp_path / "mcp_probe.py" server.write_text( textwrap.dedent( f""" - from mcp.server.fastmcp import FastMCP + from mcp.server import MCPServer - mcp = FastMCP("profileprobe") + mcp = MCPServer("profileprobe") @mcp.tool() def hermes_61922_profile_probe() -> str: