Skip to content

fix(python): export MCP client factories#2330

Open
EfeDurmaz16 wants to merge 1 commit into
x402-foundation:mainfrom
EfeDurmaz16:fix/python-mcp-client-exports
Open

fix(python): export MCP client factories#2330
EfeDurmaz16 wants to merge 1 commit into
x402-foundation:mainfrom
EfeDurmaz16:fix/python-mcp-client-exports

Conversation

@EfeDurmaz16
Copy link
Copy Markdown

Summary

  • export the documented Python MCP client factory helpers from x402.mcp
  • keep imports lazy so importing x402.mcp still does not eagerly load optional MCP client code
  • add a Python changelog fragment

Why

client_async.py implements wrap_mcp_client_with_payment, wrap_mcp_client_with_payment_from_config, and create_x402_mcp_client_from_config, and the MCP README documents importing these helpers from x402.mcp. The package-level lazy exports did not expose them, so the documented import path raised ImportError.

Verification

  • cd python/x402 && uv run pytest mcp/tests/test_client_async.py::test_wrap_mcp_client_with_payment_async -q failed before the fix
  • cd python/x402 && uv run pytest mcp/tests/test_client_async.py::test_wrap_mcp_client_with_payment_async -q
  • uv --project python/x402 run ruff check python/x402/mcp/__init__.py
  • uv --project python/x402 run ruff format --check python/x402/mcp/__init__.py
  • cd python/x402 && uv run pytest -q

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

@EfeDurmaz16 is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added sdk Changes to core v2 packages python labels May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python sdk Changes to core v2 packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant