Skip to content

Commit 019d40c

Browse files
cliffhallclaude
andcommitted
Add purpose headers and rename two tests after the SDK v2 port
Each server.py's handler and transport layer was rewritten for SDK v2, so it now opens with a purpose header stating what the file is for and the legacy-wire constraint. Two test names that pointed at the old component now name the one they exercise: call_tool's schema check, and serve_loop. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent d13408d commit 019d40c

5 files changed

Lines changed: 35 additions & 2 deletions

File tree

‎src/fetch/src/mcp_server_fetch/server.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# The fetch MCP server: one `fetch` tool and one `fetch` prompt that retrieve a
2+
# URL and convert HTML to Markdown for a model. The network policy lives here
3+
# beside the handlers because every request path (tool, prompt and robots.txt
4+
# check) must go through it: the private-address guard on each request and
5+
# redirect hop, robots.txt for autonomous fetches, and proxy normalization.
6+
#
7+
# Built on the MCP Python SDK v2's low-level `Server` (#4851). That SDK no
8+
# longer validates tool arguments or folds tool exceptions into `isError`
9+
# results, so `call_tool` does both with SDK v1's messages, and `serve()` runs
10+
# the legacy (2025-11-25) handshake loop only, keeping the wire as it was on v1.
11+
# Serving 2026-07-28 is #4853.
12+
113
import asyncio
214
import ipaddress
315
import os

‎src/fetch/tests/test_protocol.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ async def test_call_with_only_url_applies_defaults(web: FakeWeb) -> None:
202202
({"url": PAGE, "raw": "yes"}, "'yes'"),
203203
],
204204
)
205-
async def test_schema_violations_are_rejected_by_the_sdk(
205+
async def test_schema_violations_are_rejected_by_call_tool(
206206
web: FakeWeb, arguments: dict[str, Any], offending: str
207207
) -> None:
208208
# call_tool validates against inputSchema before the tool runs. The rest

‎src/git/src/mcp_server_git/server.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# The git MCP server: tools that read and change a Git repository through
2+
# GitPython. Repository confinement (`--repository`, `validate_repo_path`) and
3+
# the flag-injection guards live beside the handlers because every tool call
4+
# must pass them before any git command runs.
5+
#
6+
# Built on the MCP Python SDK v2's low-level `Server` (#4851). That SDK no
7+
# longer validates tool arguments or folds tool exceptions into `isError`
8+
# results, so `call_tool` does both with SDK v1's messages, and `serve()` runs
9+
# the legacy (2025-11-25) handshake loop only, keeping the wire as it was on v1.
10+
# Serving 2026-07-28 is #4853.
11+
112
import logging
213
from importlib.metadata import version
314
from pathlib import Path

‎src/git/tests/test_server.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ def test_git_log_date_filtering(test_repository):
852852
assert len(valid_result) == 1
853853

854854

855-
async def test_serve_run_does_not_raise_exceptions(tmp_path: Path):
855+
async def test_serve_loop_does_not_raise_exceptions(tmp_path: Path):
856856
"""Verify that serve() runs the server loop without raise_exceptions=True.
857857
858858
serve() drives SDK v2's legacy-only serve_loop rather than Server.run

‎src/time/src/mcp_server_time/server.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# The time MCP server: `get_current_time` and `convert_time` over IANA
2+
# timezones, with the local timezone detected (or set with --local-timezone)
3+
# and named in the tool descriptions so a model can default to it.
4+
#
5+
# Built on the MCP Python SDK v2's low-level `Server` (#4851). That SDK no
6+
# longer validates tool arguments or folds tool exceptions into `isError`
7+
# results, so `call_tool` does both with SDK v1's messages, and `serve()` runs
8+
# the legacy (2025-11-25) handshake loop only, keeping the wire as it was on v1.
9+
# Serving 2026-07-28 is #4853.
10+
111
from datetime import datetime, timedelta
212
from importlib.metadata import version
313
from enum import Enum

0 commit comments

Comments
 (0)