From 3906ddd83d95a541db401c279156a0fa62650d53 Mon Sep 17 00:00:00 2001 From: EfeDurmaz16 Date: Fri, 15 May 2026 22:57:56 +0300 Subject: [PATCH] fix(python): export MCP client factories --- .../changelog.d/export-mcp-client-factories.bugfix.md | 1 + python/x402/mcp/__init__.py | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 python/x402/changelog.d/export-mcp-client-factories.bugfix.md diff --git a/python/x402/changelog.d/export-mcp-client-factories.bugfix.md b/python/x402/changelog.d/export-mcp-client-factories.bugfix.md new file mode 100644 index 0000000000..fa6ec16641 --- /dev/null +++ b/python/x402/changelog.d/export-mcp-client-factories.bugfix.md @@ -0,0 +1 @@ +Export documented Python MCP client factory helpers from ``x402.mcp``. diff --git a/python/x402/mcp/__init__.py b/python/x402/mcp/__init__.py index deda0d1251..e96fad25ad 100644 --- a/python/x402/mcp/__init__.py +++ b/python/x402/mcp/__init__.py @@ -48,6 +48,9 @@ async def get_weather(city: str) -> str: "SyncPaymentWrapperConfig", # Client "create_x402_mcp_client", + "create_x402_mcp_client_from_config", + "wrap_mcp_client_with_payment", + "wrap_mcp_client_with_payment_from_config", "x402MCPSession", "x402MCPClient", "x402MCPClientSync", @@ -90,6 +93,14 @@ def __getattr__(name: str): from . import client as _client return getattr(_client, name) + if name in ( + "create_x402_mcp_client_from_config", + "wrap_mcp_client_with_payment", + "wrap_mcp_client_with_payment_from_config", + ): + from . import client_async as _client_async + + return getattr(_client_async, name) if name == "MCPToolResult": from .types import MCPToolResult