MPP payment discovery detected

low

agent_commerce_mpp

Checks if Machine Payment Protocol (MPP) payment discovery is available.

What does this rule check?

MPP extends OpenAPI with x-payment-info extensions that declare how AI agents can pay for API operations. This enables automated discovery of payment requirements alongside API capabilities.

Why is this important?

Without MPP, agents cannot discover payment requirements programmatically. They need manual configuration for each paid API, limiting scalability of agent-to-service commerce.

How to fix

Publish an OpenAPI document at /openapi.json with x-payment-info extensions on payable operations declaring intent, method, amount, and currency.

Examples

Incorrect
GET /openapi.json

HTTP/1.1 404 Not Found

<!-- Or OpenAPI exists but has no x-payment-info extensions -->
Correct
GET /openapi.json

HTTP/1.1 200 OK

{"paths": {"/api/data": {"get": {"x-payment-info": {"intent": "charge", "method": "stripe", "amount": 0.01, "currency": "USD"}}}}}

Agent fix snippet

Copy this snippet and paste it into your AI coding agent to fix this issue automatically.

Add x-payment-info to your OpenAPI spec:

paths:
  /api/data:
    get:
      x-payment-info:
        intent: charge
        method: stripe
        amount: 0.01
        currency: USD