Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

pympp

Latest version: v0.28.0

Overview

Last scanned
5 Dec 2026
Published
5 Dec 2026
PyPI package Publisher: tempo
44 Stars
35 Forks
15 Versions
644.0K Downloads
Python Repo language

Scan summary

pympp was last scanned on 5 Dec 2026 at version 0.28.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 15 versions; the latest 2 were published within 6 days (30 Nov – 5 Dec 2026).
  • Findings: No rules fired in version 0.28.0.
  • Downloads: 644,009 downloads.

Versions

15 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.28.0 LATEST 5 Dec 2026 No rules fired
0.27.1 30 Nov 2026 No rules fired
0.26.0 19 Nov 2026 No rules fired
0.25.0 16 Nov 2026 Not shown
0.24.0 16 Nov 2026 Not shown

No rules fired in 0.28.0

Findings

Findings for v0.28.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.28.0; other versions have their own rules, not their own score.

Known vulnerabilities

1 CVE · last 9 Nov 2026

0 CRITICAL 0 HIGH 1 MEDIUM 0 LOW

Versions

  • ≥ 0.9.1
  • < 0.9.1 1 MEDIUM

Vulnerabilities

  • CVE-2026-63634 Medium 9 Nov 2026 pympp allows excessive sponsored transaction fees through padded calldata Fixed in 0.9.1

README

The publisher’s own README, as collected from the registry.

pympp

Python SDK for the Machine Payments Protocol

PyPI License

Documentation

Full documentation, API reference, and guides are available at mpp.dev/sdk/python.

Install

pip install pympp

Quick Start

Server
from mpp import Credential, Receipt
from mpp.server import Mpp, pay
from mpp.methods.tempo import server as tempo

server = Mpp(methods=tempo.charge(recipient="0x742d35Cc6634c0532925a3b844bC9e7595F8fE00"))


@app.get("/paid")
@pay(server.charge(amount="0.50"))
async def handler(request, credential: Credential, receipt: Receipt):
    return JSONResponse({"data": "...", "payer": receipt.payer})

Without a framework decorator, call the route handler with the framework-neutral Request. It returns PaymentRequired (a 402 response to send as-is) or PaymentVerified:

from mpp.server import Request, Response


async def handle(request: Request) -> Response:
    result = await server.charge(amount="0.50")(request)
    if result.status != 200:
        return result.challenge
    if result.response is not None:
        return result.response  # the method handled it, such as a session top-up or close
    return result.with_receipt(Response.json({"data": "..."}))

A tempo.charge(fee_payer=...) server sponsors its payers' fees on every route, as mppx does; pass fee_payer=False to a route to opt out. As in mppx, a sponsored challenge must expire at least 15 seconds after it is issued, so a shorter-lived route on such a server raises unless it passes fee_payer=False (zero-amount and push-only routes are exempt). Before broadcasting a sponsored charge it simulates it with eth_call, which every public Tempo RPC serves.

If the endpoint already uses Authorization (API keys, Bearer tokens), create the server with requires_auth=True. Challenges then advertise header="Payment-Authorization", and clients send the Payment credential in that header instead of Authorization.

server = Mpp(methods=tempo.charge(recipient="0x..."), requires_auth=True)
Serve x402 clients

The evm method charges with EIP-3009 authorizations (USDC on Base and other EVM chains). It serves native MPP clients and x402 v2 exact clients from the same endpoint: unpaid responses carry PAYMENT-REQUIRED next to WWW-Authenticate, x402 clients pay with PAYMENT-SIGNATURE, and paid x402 responses carry PAYMENT-RESPONSE. An x402 facilitator settles payments.

pip install "pympp[evm]"
from mpp.methods.evm import BASE_USDC
from mpp.methods.evm import server as evm
from mpp.server import Mpp

server = Mpp(
    methods=evm.charge(
        currency=BASE_USDC,
        recipient="0x742d35Cc6634c0532925a3b844bC9e7595F8fE00",
        facilitator="https://facilitator.example.com",
    ),
)


@app.get("/paid")
@pay(server.charge(amount="0.01"))
async def handler(request, credential, receipt):
    return JSONResponse({"data": "..."})

To settle on Base mainnet through Coinbase's facilitator, install the cdp extra and pass mpp.x402.cdp.facilitator(). It reads CDP_API_KEY_ID and CDP_API_KEY_SECRET and signs a JWT for each request, as @coinbase/x402 does. Other facilitators that need per-endpoint auth take HttpFacilitator(url, create_auth_headers=...).

from mpp.x402 import cdp

method = evm.charge(currency=BASE_USDC, recipient="0x...", facilitator=cdp.facilitator())

Routes bind x402 payments the way mppx does. Routes are scoped to their HTTP method, path and query, and with the default route_binding="required" they only accept clients that sign mppx's extensions.mppx route binding. To accept standard x402 clients there, such as Coinbase's SDK, pass route_binding="resource" to evm.charge(); they're then bound by the echoed terms and resource URL.

Return a response object so pympp can add PAYMENT-RESPONSE. Pass methods=[tempo.charge(...), evm.charge(...)] to offer both on one route. The 402 response of a route handler already carries PAYMENT-REQUIRED. Send paid responses with Cache-Control: private so shared caches can't serve them to callers who didn't pay. with_receipt() adds it, and PAYMENT-RESPONSE, when the handler returns a response object rather than plain data.

Client
from mpp.client import Mpp
from mpp.methods.tempo import TempoAccount
from mpp.methods.tempo import client as tempo

account = TempoAccount.from_key("0x...")

async with Mpp(methods=[tempo.charge(account=account)]) as mpp:
    response = await mpp.fetch("https://mpp.dev/api/ping/paid")

To use your own httpx.AsyncClient, pass it transport=mpp.payment_transport, or call mpp.client().

A 402 with no challenge a configured method can pay raises NoMethodFoundError (a PaymentError), as mppx does; a 402 answering a paid retry is returned. To choose among payable challenges, pass order_challenges: it gets the ChallengeCandidates (challenge, method, index) in default order and returns them in preference order, and the first is paid.

mpp = Mpp(
    methods=[tempo.charge(account=account)],
    order_challenges=lambda candidates: [
        c for c in candidates if c.challenge.request.get("currency") == USDC
    ],
)
Identity

A route can require who is calling, not only payment, as mppx's identity primitives do. Its identity option takes verifiers (from mpp.identity), all of which must pass before the 402 is issued, and an optional payment check that runs on the paid retry before the credential settles. A rejection gets a fixed status (401 missing or invalid, 403 forbidden, 503 unavailable), never a fresh 402.

from mpp import identity
from mpp.extensions.identity import tempo

mpp = Mpp(methods=tempo_method, requires_auth=True)  # Authorization is the identity's
tempo_id = tempo.server.create(client_id="app_...", store=store)

handler = mpp.charge(amount="0.01", identity=identity.Route(payment=tempo_id.payment_check))
result = await handler(request)
if result.status != 200:
    return result.challenge  # a 402 listing Identity-Required, or the identity rejection
payer = result.identity.get(tempo_id.payment_check)  # tempo.Payer: user, accounts, email

identity.from_fn builds a verifier from your own lookup (return the identity, None when the request carries none, or raise identity.RejectionError), and identity.any_of accepts the first of several. Tempo ID's payment check requires a tempo payment from an account the user's token grants to the app; install it with pip install "pympp[tempo-id]".

On the client, provers add identity proofs to requests to their scope:

prover = tempo.client.prover(
    access_token=session.access_token,
    dpop=tempo.client.DpopKey(session_key),  # omit to send a Bearer token
    scope=["https://api.example.com"],
)
async with Mpp(methods=[tempo_client_method], identity=[prover]) as mpp:
    response = await mpp.fetch("https://api.example.com/paid")
Pay x402 servers

The evm client method also pays x402 v2 exact servers (EIP-3009 USDC), such as ones built with Coinbase's x402 SDK, as mppx's client does. On a 402 carrying PAYMENT-REQUIRED, the client picks an offer in its currency and chain within max_amount, signs it and retries with PAYMENT-SIGNATURE. When a server offers both an MPP challenge the client can pay and x402, it pays MPP.

from mpp.client import Mpp
from mpp.methods.evm import BASE_USDC
from mpp.methods.evm import client as evm
from mpp.x402 import payment_response

method = evm.charge(currency=BASE_USDC, account=account, max_amount="0.01")
async with Mpp(methods=[method]) as mpp:
    response = await mpp.fetch("https://api.example.com/x402/paid")
    receipt = payment_response(response)  # PAYMENT-RESPONSE: transaction, payer, network

Permit2 offers are not paid.

Custom transports can reuse method matching and credential creation without depending on HTTPX:

from mpp.client import PaymentTransport
from mpp.runtime import PaymentRuntime

payments = PaymentRuntime([method])
challenge, method = payments.match_challenge(challenges)
credential = await payments.create_credential(challenge, method)

transport = PaymentTransport(runtime=payments)

Examples

Stripe charges verify Shared Payment Tokens:

from mpp.methods.stripe import server as stripe

server = Mpp(methods=stripe.charge(secret_key="sk_...", network_id="bn_...", currency="usd"))

Stripe charge and composed-offer inputs accept payment_intent_options as a mapping or a sync/async callable receiving PaymentIntentContext. The supported fields are customer, receipt_email, metadata, and hooks.inputs.tax.calculation. The input stays out of the signed challenge. Resolvers run in the terminal payment operation, after available credential validation; validate_credential() never invokes them.

async def options(context):
    return {"metadata": {"order_id": "order_123"}}


handler = server.charge(amount="0.50", payment_intent_options=options)
# Also supported in compose offer mappings.

Both Stripe rails include SDK/challenge analytics. Existing configured metadata retains its precedence, including the forced machine_payment="true" flag; the new options' metadata overrides all generated/configured metadata. Crypto recording retries a definitive optional-field rejection once without optional fields, and remains best-effort after settlement.

Custom methods define a mpp.methods.Method (wire name, intent and pydantic request and payload models) and wrap it in a mpp.server.ServerMethod (verify, or validate and broadcast hooks) or a mpp.client.ClientMethod (create_credential). A request model may consume private route input, such as payment_intent_options, by leaving it out of the wire request.

Example Description
api-server Payment-gated API server
fetch CLI tool for fetching URLs with automatic payment handling
mcp-server MCP server with payment-protected tools
x402-client pympp client paying an official x402 server
session-metered-api Sub-cent metered API and an agent paying 500 calls through one session (Docker Compose)

Protocol

Built on the "Payment" HTTP Authentication Scheme. See mpp-specs for the full specification.

License

MIT OR Apache-2.0

Restrict automatic payment origins

When fetching URLs from untrusted sources, configure exact origins before enabling payments. Origins include the scheme and port; paths and credentials are rejected. An empty allowlist disables automatic payments. Omitting it preserves the default of allowing payments to any directly requested origin.

async with Mpp(
    methods=[tempo.charge(account=account)],
    allowed_origins=["https://api.example.com"],
) as mpp:
    response = await mpp.fetch("https://api.example.com/paid")

Use method-level amount, currency, and recipient limits as well. A challenge realm is a protection-space name, not an authenticated origin. This policy prevents payments to unapproved origins; it cannot identify a relayed challenge served by an origin you have already approved.

Hosted fee-payer services

tempo.charge(fee_payer=...) also takes a hosted fee payer: its URL, or {"url": ..., "headers": ...} (or a RemoteFeePayer), where headers may be a sync or async callable returning them per request. Hosted sponsorship is on by default. Local account sponsorship requires route-level fee_payer=True; otherwise access-key clients retain an unsponsored payment path. The server enforces its sponsor policy and simulates the calls before asking the service to co-sign with eth_fillTransaction, keeps only the returned feePayerSignature and feeToken (allowed_fee_tokens restricts it), simulates the final transaction with the recovered sponsor, and broadcasts it itself. Challenges never name the service; a feePayerUrl in an old challenge is ignored.

server = Mpp(
    methods=tempo.charge(
        recipient="0x...",
        fee_payer={
            "url": "https://sponsor.example/rpc",
            "headers": {"Authorization": "Bearer ..."},
        },
    )
)

Treat the returned signature as a spending capability: callers can broadcast it without passing through pympp. Before signing, the service must validate the complete transaction and caller authorization, simulate execution, and enforce gas-price, gas-limit, per-caller, and aggregate spending budgets. Simulation is a point-in-time check; state can change before inclusion, so it does not replace hard spending limits. pympp's checks cannot protect a sponsor that also accepts direct signing requests.

Sponsored recovery records

Sponsored charge recovery records now retain the original signed transaction. Legacy records containing only a fee-token address can recover confirmed receipts while the original sponsor key is available. A missing receipt for a reconstructed transaction is not proof that the original payment failed, so these records remain non-payable until reconciled.

Before rotating sponsor keys, drain outstanding sponsored submissions. To migrate a remaining legacy record, pause payment traffic and replace its value under the existing mpp:charge-broadcast:<client-envelope-hash> key with the original canonical signed 0x76 transaction from your submission log. Keep the key unchanged and use the actual submitted bytes, not a transaction signed with a replacement key. Resume traffic after the migration; retries will reconcile the stored transaction. If the original bytes or key are unavailable, retain the record for operator reconciliation rather than deleting an unknown payment.

Recovery records created by MemoryStore, SQLiteStore, and RedisStore expire after both the authenticated challenge's expiry and the signed transaction's valid_before plus the inclusion grace period. Retries do not extend this deadline, and a store-wide TTL does not shorten it. Replay reservations retain their existing retention policy. Memory and SQLite reclaim abandoned expired records during subsequent store activity; Redis expires them automatically. Redis-backed sponsored recovery requires Redis 6.2 or later for atomic SET NX PXAT absolute expiry. Custom stores can implement mpp.store.ExpiringStore.put_if_absent_until(key, value, expires_at) with an atomic insert and absolute Unix timestamp to support this cleanup. Stores without that method, and challenges without an expiry, retain durable recovery records. Existing records keep their original retention.

Payment request context

Route handlers bind meta into their signed challenges:

handler = server.charge(amount="1.00", meta={"account": authenticated_account_id})

Derive authenticated_account_id from trusted session authentication, not an unverified request field. Route handlers also bind the HTTP method, path and query, and the route template that framework decorators report. Configured _mppx_scope is preserved in full under the signed scope’s custom key, alongside trusted framework fields. Custom request objects should expose their HTTP method.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases pympp

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229