mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
Add automatic MCP list change notifications and client message handling
Implements comprehensive notification system for tools, resources, and prompts with automatic client updates and flexible message handlers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c8da2432c3
commit
38036b1f42
22 changed files with 1013 additions and 58 deletions
|
|
@ -499,7 +499,7 @@ class TestCallTools:
|
|||
mcp = FastMCP()
|
||||
context = Context(fastmcp=mcp)
|
||||
|
||||
with context:
|
||||
async with context:
|
||||
result = await manager.call_tool(
|
||||
"name_shrimp",
|
||||
{
|
||||
|
|
@ -639,7 +639,7 @@ class TestContextHandling:
|
|||
mcp = FastMCP()
|
||||
context = Context(fastmcp=mcp)
|
||||
|
||||
with context:
|
||||
async with context:
|
||||
result = await manager.call_tool("tool_with_context", {"x": 42})
|
||||
assert result[0].text == "42" # type: ignore[attr-defined]
|
||||
|
||||
|
|
@ -657,7 +657,7 @@ class TestContextHandling:
|
|||
mcp = FastMCP()
|
||||
context = Context(fastmcp=mcp)
|
||||
|
||||
with context:
|
||||
async with context:
|
||||
result = await manager.call_tool("async_tool", {"x": 42})
|
||||
assert result[0].text == "42" # type: ignore[attr-defined]
|
||||
|
||||
|
|
@ -675,7 +675,7 @@ class TestContextHandling:
|
|||
mcp = FastMCP()
|
||||
context = Context(fastmcp=mcp)
|
||||
|
||||
with context:
|
||||
async with context:
|
||||
result = await manager.call_tool("tool_with_context", {"x": 42})
|
||||
assert result[0].text == "42" # type: ignore[attr-defined]
|
||||
|
||||
|
|
@ -722,7 +722,7 @@ class TestContextHandling:
|
|||
mcp = FastMCP()
|
||||
context = Context(fastmcp=mcp)
|
||||
|
||||
with context:
|
||||
async with context:
|
||||
with pytest.raises(
|
||||
ToolError, match="Error calling tool 'tool_with_context'"
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue