Skip to content

Commit 6611489

Browse files
committed
fix: Resolve import order and formatting issues
- Move mcp.types.Tool import to proper location - Apply Ruff formatting fixes - Ensure all pre-commit hooks pass
1 parent 50fecda commit 6611489

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

tests/server/fastmcp/test_integration.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@
1515
import uvicorn
1616
from pydantic import AnyUrl
1717

18-
from examples.snippets.servers import (
19-
basic_prompt,
20-
basic_resource,
21-
basic_tool,
22-
completion,
23-
elicitation,
24-
fastmcp_quickstart,
25-
notifications,
26-
sampling,
27-
structured_output,
28-
tool_progress,
29-
)
3018
from mcp.client.session import ClientSession
3119
from mcp.client.sse import sse_client
3220
from mcp.client.streamable_http import streamablehttp_client
@@ -88,25 +76,25 @@ def server_url(server_port: int) -> str:
8876

8977
def run_server_with_transport(module_name: str, port: int, transport: str) -> None:
9078
"""Run server with specified transport."""
91-
import sys
9279
import os
80+
import sys
9381

9482
# Add examples/snippets to Python path for multiprocessing context
9583
snippets_path = os.path.join(os.path.dirname(__file__), "..", "..", "..", "examples", "snippets")
9684
sys.path.insert(0, os.path.abspath(snippets_path))
9785

9886
# Import the servers module in the multiprocessing context
9987
from servers import (
100-
basic_tool,
101-
basic_resource,
10288
basic_prompt,
103-
tool_progress,
104-
sampling,
105-
elicitation,
89+
basic_resource,
90+
basic_tool,
10691
completion,
107-
notifications,
92+
elicitation,
10893
fastmcp_quickstart,
94+
notifications,
95+
sampling,
10996
structured_output,
97+
tool_progress,
11098
)
11199

112100
# Get the MCP instance based on module name

tests/server/test_streamable_http_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
from mcp.server import Server
1818
from mcp.server.streamable_http_manager import StreamableHTTPSessionManager
1919
from mcp.server.transport_security import TransportSecuritySettings
20+
from mcp.types import Tool
2021

2122
# Mark all tests in this file as integration tests (spawn subprocesses)
2223
pytestmark = [pytest.mark.integration]
23-
from mcp.types import Tool
2424

2525
logger = logging.getLogger(__name__)
2626
SERVER_NAME = "test_streamable_http_security_server"

0 commit comments

Comments
 (0)