-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I first run the MCP server in streamable HTTP mode using:
uvx mcp-run-python --port 3001 streamable-httpThen test the Pydantic AI client code as below:
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPServerStreamableHTTP
server_http = MCPServerStreamableHTTP(url="http://localhost:3001/mcp")
agent_http = Agent(m.default, toolsets=[server_http])
async def run(agent):
async with agent.run_mcp_servers():
result = await agent.run(f"How many days between 2000-01-01 and 2025-12-01?")
print(result.output)
if __name__ == "__main__":
import asyncio
asyncio.run(run(agent_http))It runs into error:
httpx.HTTPStatusError: Client error '426 Upgrade Required' for url 'http://localhost:3001/mcp'Anything wrong here?
Metadata
Metadata
Assignees
Labels
No labels