fix: restore dict-at-boundary MCP source API for SDK v2

This commit is contained in:
lda
2026-09-06 11:43:24 +07:00 Verified
parent 28017648f6
commit 01e6be5d11
7 changed files with 120 additions and 142 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ from __future__ import annotations
from pathlib import Path
import pytest
from mcp import McpError
from mcp import MCPError
from mcp.types import ErrorData
from wf_mcp.broker import WfMcpService
@@ -33,10 +33,10 @@ class _ToolsOnlyAdapter:
]
async def list_resources(self, connection, auth):
raise McpError(ErrorData(code=-32601, message="Method not found"))
raise MCPError.from_error_data(ErrorData(code=-32601, message="Method not found"))
async def list_prompts(self, connection, auth):
raise McpError(ErrorData(code=-32601, message="Method not found"))
raise MCPError.from_error_data(ErrorData(code=-32601, message="Method not found"))
async def get_connection_metadata(self, connection, auth):
return {
@@ -65,7 +65,7 @@ class _WrappedToolsOnlyAdapter(_ToolsOnlyAdapter):
async def list_resources(self, connection, auth):
raise ExceptionGroup(
"unhandled errors in a TaskGroup",
[McpError(ErrorData(code=-32601, message="Method not found"))],
[MCPError.from_error_data(ErrorData(code=-32601, message="Method not found"))],
)
+4
View File
@@ -50,10 +50,14 @@ def finalize_tool(
@deprecated("Use pytests tmp_path fixture instead")
@overload
def local_temp_root() -> Path: ...
@overload
def local_temp_root(root_path: Path) -> Path: ...