feat: add McpClient wrapper for MCP client transport parity#96
feat: add McpClient wrapper for MCP client transport parity#96brendanjryan wants to merge 1 commit intomainfrom
Conversation
Mark Python MCP Client as supported (MCP SDK transport) following tempoxyz/pympp#96 which adds the McpClient wrapper.
Mark Python MCP Client as supported (MCP SDK transport) following tempoxyz/pympp#96 which adds the McpClient wrapper.
6cd584c to
9111fcd
Compare
💡 Codex Reviewpympp/src/mpp/methods/tempo/intents.py Lines 242 to 245 in 6cd584c With replay protection enabled, this marks the hash as used before any RPC or log checks run. If Lines 18 to 22 in 6cd584c
pympp/src/mpp/extensions/mcp/client.py Lines 109 to 113 in 6cd584c
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Add McpClient that wraps an MCP SDK ClientSession with automatic payment handling - matching the TypeScript McpClient.wrap API. When call_tool gets a -32042 error, McpClient: 1. Parses challenges from error.data 2. Matches to an installed payment method by name+intent 3. Creates a credential and retries with it in _meta 4. Extracts receipts from the result - New: src/mpp/extensions/mcp/client.py (McpClient, McpToolResult) - Export McpClient and McpToolResult from mpp.extensions.mcp - 22 new tests covering free/paid tools, method matching, receipt extraction, error propagation, meta forwarding - Updated example client to use McpClient instead of manual flow - Updated example README
9111fcd to
31a5de2
Compare
Summary
Adds
McpClient, a payment-aware MCP client wrapper that brings Python to parity with the TypeScriptMcpClient.wrapAPI on the SDK features table.What it does
McpClientwraps an MCP SDKClientSessionand overridescall_toolwith automatic payment handling:-32042(Payment Required), parses the challenges_meta_metaUsage