# MPP

The `doma-mpp` skill teaches an AI agent how to call **HTTP 402 payment-gated APIs** for domain registration, using the [Machine Payments Protocol](https://github.com/tempoxyz/mpp-specs) and the `mppx` client library.

## At a glance

|                       |                                                                                             |
| --------------------- | ------------------------------------------------------------------------------------------- |
| Manifest URL          | `https://doma.xyz/.agents/skills/doma-mpp/SKILL.md`                                         |
| Backing protocol      | [Machine Payments Protocol](https://github.com/tempoxyz/mpp-specs) (HTTP 402)               |
| Backing CLI / library | `mppx` client                                                                               |
| Trigger phrases       | `MPP`, `paid API`, `payment-gated`, `register domain via MPP`, `HTTP 402`, `Doma /register` |

## What MPP is (briefly)

MPP is a protocol for **micropayments to APIs**. A service exposes endpoints that respond with HTTP `402 Payment Required` until the caller attaches a valid payment receipt. The receipt is computed against a payment endpoint advertised in the response headers.

Doma exposes one such endpoint at `https://mpp.doma.xyz/register` for tokenized domain registration. The skill wraps the HTTP 402 dance: detect the response, request a quote, generate a payment, attach the receipt, retry.

## What the skill does

1. Resolves the MPP endpoint and its supported payment options (currencies, chains).
2. Asks the user which option to use (e.g. `USDC` on `Base`).
3. Computes the price for the requested registration.
4. Confirms with the user before paying.
5. Submits the payment, receives a receipt.
6. Retries the registration request with the receipt attached.
7. Reports the registration result.

## Prerequisites

* Node.js ≥ 20
* `@doma-protocol/cli` for ancillary domain operations (optional)
* `mppx` client (the skill installs / invokes it as needed)
* A wallet with a balance in one of the supported payment currencies on a supported chain

## Example prompt

After installing the skill:

> "Register `<your-domain>.io` via MPP on Base using USDC."

The agent:

1. Hits `https://mpp.doma.xyz/register` to discover supported payment options.
2. Confirms the price and currency with you.
3. Submits the payment via `mppx`.
4. Retries the registration with the receipt and reports success / failure.

## Cross-references

* [Doma Marketplace](/doma-marketplace.md): alternative path for buying already-tokenized domains.
* [Building on Doma](/building-on-doma.md): broader integration overview.
* [MPP specification](https://github.com/tempoxyz/mpp-specs): protocol-level details.

{% hint style="info" %}
The MPP skill is served at `.agents/skills/` (not `.well-known/skills/` like Doma's other skills) because it predates the standard AgentRoot location. It ships as a git submodule under Doma's published skills tree at `apps/doma-xyz/public/.agents/skills/doma-mpp/`.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.doma.xyz/agentic-commerce/skills/mpp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
