Skip to content

Commit 2bba500

Browse files
committed
Add test (no cassette or snapshot yet)
1 parent 6fb4f3c commit 2bba500

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_mcp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,3 +1489,14 @@ async def test_server_info(mcp_server: MCPServerStdio) -> None:
14891489
async with mcp_server:
14901490
assert mcp_server.server_info is not None
14911491
assert mcp_server.server_info.name == 'Pydantic AI MCP Server'
1492+
1493+
1494+
async def test_agent_run_stream_with_mcp_server_http(allow_model_requests: None):
1495+
server = MCPServerStreamableHTTP(url='https://mcp.deepwiki.com/mcp')
1496+
agent = Agent(model='openai:gpt-4o', toolsets=[server], instructions='Be concise.')
1497+
1498+
# This should not raise an error.
1499+
# See https://github.com/pydantic/pydantic-ai/issues/2818#issuecomment-3476480829
1500+
async with agent.run_stream('Who are the main contributors to the pydantic/pydantic-ai repo.') as result:
1501+
output = await result.get_output()
1502+
assert output == snapshot()

0 commit comments

Comments
 (0)