From 53f12fe8186a94d1821d697586ccaf5df53805fc Mon Sep 17 00:00:00 2001 From: aifanatic Date: Thu, 22 Oct 2026 07:34:31 -0500 Subject: [PATCH] Python: Fix claw step 3 Foundry Toolbox connection for MCP 2.x mcp 2.x's streamable_http_client yields (read, write) instead of (read, write, get_session_id), so the three-way unpack raised ValueError whenever FOUNDRY_TOOLBOX_ENDPOINT was set. Also build the client with httpx2, which is the type mcp 2.x accepts. Co-Authored-By: Claude Opus 5.5 --- .../build_your_own_claw/claw_step03_scaling_capabilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/samples/02-agents/harness/build_your_own_claw/claw_step03_scaling_capabilities.py b/python/samples/02-agents/harness/build_your_own_claw/claw_step03_scaling_capabilities.py index 78d3a590739..53654b12c8b 100644 --- a/python/samples/02-agents/harness/build_your_own_claw/claw_step03_scaling_capabilities.py +++ b/python/samples/02-agents/harness/build_your_own_claw/claw_step03_scaling_capabilities.py @@ -5,7 +5,7 @@ # "agent-framework-tools", # "agent-framework-monty", # "mcp", -# "httpx", +# "httpx2", # "textual>=6.2.1", # "rich>=13.7.1", # "python-dotenv", @@ -55,7 +55,7 @@ from pathlib import Path from typing import Annotated, Any, Literal -import httpx +import httpx2 as httpx from agent_framework import ( Agent, AgentModeProvider, @@ -225,7 +225,7 @@ async def _connect_foundry_toolbox(stack: AsyncExitStack, url: str) -> ClientSes follow_redirects=True, ) ) - read, write, _ = await stack.enter_async_context(streamable_http_client(url=url, http_client=http_client)) + read, write = await stack.enter_async_context(streamable_http_client(url=url, http_client=http_client)) session = await stack.enter_async_context(ClientSession(read, write)) await session.initialize() return session