Skip to content

Add the MPP discovery layer to the agentic-payments skill - #109

Merged
kaankacar merged 2 commits into
mainfrom
issue-agent/107-mpp-discovery
Aug 19, 2026
Merged

Add the MPP discovery layer to the agentic-payments skill#109
kaankacar merged 2 commits into
mainfrom
issue-agent/107-mpp-discovery

Conversation

@kaankacar

Copy link
Copy Markdown
Contributor

🤖 Automated message from Kaan's Automated Triage Bot.

Closes #107

The MPP guide taught Charge mode and Session mode. It did not teach discovery. A reader could ship a paid API that no agent can find.

This adds a Discovery section to mpp.md:

  • Serve an OpenAPI 3.1 document at GET /openapi.json with x-payment-info offers. It shows the discovery() call from mppx/express, wired to the existing Charge mode server.
  • State the authority rule. Discovery is advisory. The runtime 402 Challenge is authoritative for price, token, network, expiry, and terms.
  • Name MPPScan and the mpp.dev services directory as optional registrations, and link https://mpp.dev/mcp/services.
  • State that a registry listing does not verify any client payment.

It also adds two discovery pitfalls, updates the mppx/express row in the imports table, and adds a decision-table line in SKILL.md.

Verification. I read https://mpp.dev/advanced/discovery for the four points. I checked the API against the published types: mppx@0.6.31, the line @stellar/mpp@0.7.1 peer-depends on, exports discovery(app, mppx, config?) from mppx/express and mounts GET /openapi.json. The Express form needs one explicit routes entry per paid route. The example and the second pitfall reflect that. Every new link returns 200.

The change is markdown under skills/ only. The site build does not read these files, so lint, lint:ts, and build are unaffected.

The MPP guide covered Charge and Session mode but never explained how a
paying agent finds the API in the first place. Add a Discovery section
covering the OpenAPI 3.1 document at /openapi.json, the x-payment-info
offers, and the mppx discovery() call that serves it.

Also state the authority rule: the discovery document is advisory and the
runtime 402 Challenge is authoritative for price, token, network, expiry,
and terms. Name MPPScan and the mpp.dev services directory as optional
registrations, and note that a listing does not verify any client payment.

Route readers there from the SKILL.md decision table.
Copilot AI balanced review requested due to automatic review settings August 19, 2026 20:43
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-19 20:58 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds MPP discovery guidance so paid APIs can be found by agents.

Changes:

  • Documents OpenAPI discovery, authority rules, registries, and pitfalls.
  • Links discovery from the skill decision tables.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
skills/agentic-payments/SKILL.md Adds discovery navigation.
skills/agentic-payments/mpp.md Adds the discovery guide and examples.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread skills/agentic-payments/mpp.md Outdated
Comment on lines +233 to +234
// charge-server.js (additions to the Charge mode server above)
import { Mppx, discovery } from "mppx/express";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated message from Kaan's Automated Triage Bot.

Agreed, and fixed in bd74373.

The block now says to edit the Charge mode server, not append to it. It also names the failure: a second mppx/express import redeclares Mppx, and a second /data route never runs. The three edits are numbered in the snippet, so the documented offer and the runtime Challenge come from the same handler.

Comment thread skills/agentic-payments/mpp.md Outdated

## Discovery: let agents find your paid API

Charge and Session mode answer "how do I charge". Discovery answers "how does a paying agent find me". Without it you ship a working paid API that no agent can locate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated message from Kaan's Automated Triage Bot.

Fixed in bd74373. The line now reads "Charge and Session modes answer one question: how do I charge? Discovery answers a second: how does a paying agent find me?" That drops the quotes and punctuates both as questions.

@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Picked this up — assessing whether I can ship an airtight fix.

The block read as an append. Pasted that way it redeclares Mppx and registers a second /data route that never runs. Number the three edits instead, and tidy the intro.
@kaankacar
kaankacar merged commit 1f4b94e into main Aug 19, 2026
6 checks passed
@kaankacar
kaankacar deleted the issue-agent/107-mpp-discovery branch August 19, 2026 20:57
@kaankacar

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from Kaan's Automated Triage Bot.

Merged as 1f4b94e. Issue #107 is closed. Both Copilot points were valid and are fixed in bd74373.

I verified the API against the published package, not only the docs page. In mppx@0.6.31, the version @stellar/mpp@0.7.1 resolves to:

  • mppx/express declares discovery(app, mppx, config?) and mounts /openapi.json.
  • generate() emits openapi: "3.1.0" and sets x-payment-info with offers[].
  • HandlerRouteConfig is { handler, method, path }, the shape in the example.
  • The CLI defines discover validate and accepts a URL.
  • The Express adapter has no auto option, so routes is required. That is the second new pitfall.

The four content points match https://mpp.dev/advanced/discovery. CI ran pnpm lint, pnpm lint:ts, and pnpm build at this head. All passed. The deployed page on skills.stellar.org matches.

One item outside this PR, for you @kaankacar: the install line is npm install ... @stellar/mpp mppx .... mppx is now on 0.8.17, but @stellar/mpp@0.7.1 peer-depends on mppx: ^0.6.29. An unpinned install may hit ERESOLVE. I did not test it, so I did not change it. Worth its own issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The agentic-payments MPP guide omits the MPP discovery layer

2 participants