# MCP delivery and recovery

Connect a Streamable HTTP MCP client to `https://evidence.contact/mcp`. Read `isError` and `structuredContent` even when the transport returns HTTP 200. The machine contract is `mcp.delivery` in `/v1/capabilities` and `mcpDelivery` in `/agent.json`.

## Prepared artifacts

`buy_prepared_artifact` and `complete_prepared_artifact_transfer` return the operation ID, content type, decoded `result` and a private `delivery` object after confirmed payment:

| Field | Meaning |
|---|---|
| `delivery.bodyBase64` | Exact retained bytes, base64 encoded |
| `delivery.encoding` | `base64` |
| `delivery.byteLength` | Exact decoded byte count |
| `delivery.sha256` | SHA-256 of the exact bytes, lowercase hex |
| `delivery.artifactProof` | Private 32-byte verifier, lowercase hex; equivalent to HTTP `X-402Mob-Artifact-Proof` |
| `delivery.algorithm` | `sha256-private-proof-v1` |
| `delivery.commitment` | Commitment matching the offer's published artifact metadata |

Decode `delivery.bodyBase64`, check its size and SHA-256, then verify the commitment against the offer metadata you saved before payment. Hash UTF-8 `402mob.artifact-commitment.v1` followed by one LF byte, the raw 32 proof bytes and the exact artifact bytes. Do not reserialize the decoded `result` for this check; JSON formatting can change the bytes. See [commitment verification](/payment-links.md#commitment-verification-and-revocation).

The service checks the paid proof against its retained offer before returning success. Independently comparing against previously saved metadata protects your own delivery check. Matching bytes do not prove correctness, ownership or suitability. Keep the proof and purchased bytes private; discovery and unsigned calls do not return them.

## Work Ticket results

`read_work_ticket_result` returns the existing `resultHash`, `contentType` and decoded `result`, plus `delivery.encoding`, `bodyBase64`, `byteLength` and `sha256`. The service checks the received bytes against the result hash before reporting success. This flow has no prepared-artifact proof. Compare against the ticket result hash you retained and sign an acceptance receipt only if the result satisfies your own rules.

Result authorization permits one read. A network interruption or `invalid_result_response` (502) requires a **fresh result challenge and signature**, then another read. No additional payment is needed. The error's `nextAction` is `create_new_result_challenge`.

## Paid responses and pending operations

Invoice reports and checkout responses are validated before success is reported. The settlement receipt must name the paying wallet; direct-transfer checkout also requires the submitted payment transaction hash. A connection failure, unreadable body, or incomplete or mismatched response returns `isError: true`, `invalid_checkout_response` (502) and `nextAction: "resume_same_payment"`. A readable operation header is retained as `operationId` and `recovery`. This error does not prove payment failed. Reuse the original request, idempotency key and authorization; direct-transfer buyers reuse their original challenge and transaction hashes. Do not pay again.

A valid unresolved response carries `state: "pending"`, its operation `id`, canonical `recovery` path, `operationState` (the original `executing`, `staged`, `settling` or `pending` state), and `nextAction: "resume_same_payment"`. It has no success settlement receipt and no delivered artifact. An incomplete pending response is an error, not a successful delivery.

If the connection fails before response headers arrive, the error has no operation ID to return. Resume with the original saved request and payment proof to recover it; the missing ID is not permission to make another payment.

## Optional immutable offer terms

Use free `get_prepared_offer_terms` with `merchantId` and `offerId` to inspect seller-declared schema references, coverage, limitations and reuse terms before paying. Metadata-bearing prepared deliveries include `offerTermsHash` in their MCP `delivery` object, matching the immutable terms read. Missing or inconsistent references stop verified delivery; retain the original operation and recover it. Offers without metadata have no such field. These terms do not certify quality or establish license consent. See [purchase decisions](/purchase-decisions.md).

## Private Transaction Evidence reads

These free tools return retained signatures and observations, not result bytes: `read_transaction_evidence`, `read_merchant_transaction_evidence` and `read_transaction_record_evidence`. Work Ticket buyers first use `create_transaction_evidence_challenge`; operation/protected participants use `create_transaction_record_evidence_challenge`. Sign the exact returned message locally. Merchant Work Ticket reads instead require the selected merchant’s `merchant:work` credential.

Wallet evidence proofs are reusable for two minutes, and each read is a new snapshot. After expiry, request a fresh read challenge. This differs from the single-use Work Ticket result read above. `evidence_unavailable` is a structured tool error with status 503: preserve references and contact the operator; do not pay again. A missing current protected candidate or replica proof is reported even when older signatures verify.

Keep private exports, offer terms hashes, artifact proofs and exact bytes in your own storage. The separate offline verifier reports missing evidence explicitly; optional chain checks reject incompatible parameters before RPC. It does not certify fulfillment or execute refunds. See [Transaction Evidence](/transaction-evidence.md) and `transactionEvidence` in capabilities for schemas, access and current package availability.
