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.
This commit is contained in:
1 parent
3b7b5cbe7c
commit
d261041a9a
1 file changed
+4
-1
@@ -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")
|
||||
|
||||
|
||||
Reference in new issue
Block a user