Skip to content

feat: MPP machine payments — agent-native pay-per-tool-call #16

@stackbilt-admin

Description

@stackbilt-admin

Context

Stripe launched Machine Payments Protocol (MPP) on 2026-03-18. mppx SDK is installed. Foundation code stashed on main.

What's Ready (git stash)

  • src/mpp.ts — pricing map (18 tools priced), server factory
  • src/rest-mpp.ts — REST endpoint handler skeleton
  • src/types.ts — MPP_SECRET_KEY + STRIPE_SECRET_KEY in GatewayEnv
  • src/index.ts — /api/pay/:toolName + /api/pay catalog routes
  • mppx installed in package.json

What Needs Building

  1. Wire mppx server with Stripe SPT method (stripe.charge() from mppx/server)
  2. MCP-native path using Transport.Mcp (JSON-RPC error -32042 for payment required)
  3. Test with a real agent client
  4. Deploy with MPP_SECRET_KEY + STRIPE_SECRET_KEY as Worker secrets

Key Discovery

mppx has native MCP support:

  • `Transport.Mcp` type for JSON-RPC payment flow
  • Error code `-32042` (payment required)
  • `_meta["org.paymentauth/credential"]` for credentials
  • `_meta["org.paymentauth/receipt"]` for receipts

This means we can do MPP inside MCP JSON-RPC — agents using our MCP server get native payment flow without a separate REST surface.

References

Estimated Effort

2-3 focused hours with mppx docs loaded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions