Draft
Conversation
Adds optional MPP payment support alongside the existing x402 protocol. Agent builders configure which protocol(s) they want via aixyz.config.ts — the presence of an x402 or mpp block (or both) determines what's active. ## Changes ### packages/aixyz-config - is now optional (was required) - New config block: recipient, currency, methods (tempo/stripe/lightning), stripeSecretKey, feePayerKey, optimistic - Zod validation: at least one of x402 or mpp must be present - MppMethod type exported ### packages/aixyz - New (app/payment/mpp.ts): wraps mppx/server, dynamically imported so mppx stays an optional peer dependency - now holds instead of a bare AcceptsX402 - initializes both gateways based on config; dispatch routes payments by inspecting the incoming Authorization header: - → MPP path - → x402 path - neither + both configured → 402 with both challenges - A2APlugin passes both x402 and mppAmount on the agent route - MCPPlugin guards against undefined config.x402 - CLI build banner updated to show MPP config when present ### examples/with-mpp - aixyz.config.ts: MPP-only example (Tempo + Stripe) - aixyz-both.config.ts: x402 + MPP dual-protocol example ## Notes - mppx is an optional peer dependency; a clear error is thrown if mpp is configured but mppx is not installed - Existing x402-only agents require no changes (zero breaking changes) - Both protocols can be active simultaneously for maximum client compat See: https://mpp.dev
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional MPP (Machine Payments Protocol) payment support alongside the existing x402 protocol. Agent builders configure which protocol(s) to accept via
aixyz.config.ts— the presence of anx402ormppblock determines what's active. Both can coexist.Design
Config shape drives the choice — no extra flags needed:
The
acceptsexport on agents/tools is unchanged — still justprice. The framework handles the rest.Protocol Dispatch (when both are active)
Authorization: Payment ...X-Payment: .../PAYMENT-SIGNATURE: ...Files Changed
packages/aixyz-config/index.tsx402now optional; newmppconfig block with Zod schemapackages/aixyz/app/payment/mpp.tsMppPaymentGatewaywrappingmppx/server(dynamic import)packages/aixyz/app/index.tsAixyzApppackages/aixyz/app/types.tsRoutePaymentOptionsreplaces bareAcceptsX402onRouteEntrypackages/aixyz/app/plugins/a2a.tsx402andmppAmounton the agent routepackages/aixyz/app/plugins/mcp.tsconfig.x402packages/aixyz-cli/build/AixyzConfigPlugin.tspackages/aixyz/package.jsonmppxadded as optional peer dependencyexamples/with-mpp/Notes
mppxis an optional peer dependency — a clear error is thrown at startup ifmppis configured butmppxisn't installedCloses #