You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 15c8b0c
Browse filesBrowse the repository at this point in the historyBrowse files
Move the three Python servers from mcp 1.x to mcp>=2.2,<3 and drop the
mcp>=1.29.0,<2 pin. Each stays on the low-level Server, now built with
on_* constructor handlers instead of decorators, and returns
ListToolsResult / ListPromptsResult / CallToolResult explicitly.
SDK v2's low-level server no longer validates tool arguments against
inputSchema or folds a handler exception into an isError result. Each
server's call_tool now does both itself, with v1's messages, so tool
results on the wire are unchanged. jsonschema becomes a direct
dependency for that.
McpError(ErrorData(...)) becomes MCPError(code=..., message=...), and
Tool / ToolAnnotations fields move to snake_case.
Tests: only import and type changes, plus wire() dumping with
exclude_unset (v2 result models default fields the 2025-11-25 wire does
not carry). One assertion changes: v2 omits the empty
"experimental": {} capability, in git and time.
Closes#4851
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
Requires MCP Python SDK 1.x (`mcp>=1.29.0,<2`). SDK 2.0 renamed APIs this server uses. The port to v2 is in progress.
9
+
Requires MCP Python SDK 2.x (`mcp>=2.2,<3`).
10
10
11
11
> [!CAUTION]
12
12
> This server can access local/internal IP addresses and may represent a security risk. Exercise caution when using this MCP server to ensure this does not expose any sensitive data.
message=f"Failed to fetch robots.txt {robot_txt_url} due to a connection issue",
268
-
)
267
+
raiseMCPError(
268
+
code=INTERNAL_ERROR,
269
+
message=f"Failed to fetch robots.txt {robot_txt_url} due to a connection issue",
269
270
)
270
271
ifresponse.status_codein (401, 403):
271
-
raiseMcpError(
272
-
ErrorData(
273
-
code=INTERNAL_ERROR,
274
-
message=f"When fetching robots.txt ({robot_txt_url}), received status {response.status_code} so assuming that autonomous fetching is not allowed, the user can try manually fetching by using the fetch prompt",
275
-
)
272
+
raiseMCPError(
273
+
code=INTERNAL_ERROR,
274
+
message=f"When fetching robots.txt ({robot_txt_url}), received status {response.status_code} so assuming that autonomous fetching is not allowed, the user can try manually fetching by using the fetch prompt",
description="""Fetches a URL from the internet and optionally extracts its contents as markdown.
402
+
tool=Tool(
403
+
name="fetch",
404
+
description="""Fetches a URL from the internet and optionally extracts its contents as markdown.
409
405
410
406
Although originally you did not have internet access, and were advised to refuse and tell the user this, this tool now grants you internet access. Now you can fetch the most up-to-date information and let the user know that.""",
411
-
inputSchema=Fetch.model_json_schema(),
412
-
)
413
-
]
414
-
415
-
@server.list_prompts()
416
-
asyncdeflist_prompts() ->list[Prompt]:
417
-
return [
418
-
Prompt(
419
-
name="fetch",
420
-
description="Fetch a URL and extract its contents as markdown",
421
-
arguments=[
422
-
PromptArgument(
423
-
name="url", description="URL to fetch", required=True
0 commit comments