from agent_framework import ChatAgent, MCPStdioToolfrom agent_framework.openai import OpenAIResponsesClient
clickhouse_mcp_server = MCPStdioTool( name="clickhouse", command="uv", args=[ "run", "--with", "mcp-clickhouse", "--python", "3.10", "mcp-clickhouse" ], env=env)async with ChatAgent( chat_client=OpenAIResponsesClient(model_id="gpt-5-mini-2025-08-07"), name="HousePricesAgent", instructions="You are a helpful assistant that can help query a ClickHouse database", tools=clickhouse_mcp_server,) as agent: query = "Tell me about UK property prices over the last five years" print(f"User: {query}") async for chunk in agent.run_stream(query): print(chunk.text, end="", flush=True) print("\n\n")