Skip to main content

Stripe Mpp

@magistr/stripe-mppv2026.07.21.2beta· 1d agoMODELSSKILLS
01README

Stripe Machine Payments Protocol (MPP) — agent buyer (probe/mint/pay over HTTP-402 Payment auth), consumer buyer (grant a Shared Payment Token from a Link wallet via link-cli, spend by reference), and full seller API (challenge/verify/charge/receipt/reconcile/refund) for fiat Shared Payment Tokens, built on mppx and the Stripe preview SDK

02Release Notes

2026.07.21.2

Dependency bump: mppx@0.8.6 → 0.8.12 (patch, preview channel). No breaking changes to the Challenge / Credential / Receipt codecs or the Mppx / Stripe server APIs.

  • Wire format unchanged, on durable evidence: the crypto primitives are byte-identical in the regenerated lock (@noble/hashes@1.8.0 backs the HMAC-SHA256 id-binding, @noble/curves@1.9.1, @scure/* all unmoved), and the upstream review of the 0.8.6..0.8.12 releases (0.8.7, 0.8.8, 0.8.9, 0.8.11, 0.8.12 — 0.8.10 was never published) found no change to the HMAC challenge-id binding, key derivation, domain separators, or the challenge/credential/receipt serialization. The 0.8.7..0.8.12 deltas are Celo/Tempo/session-voucher and mppx validate-command code this fiat/SPT model does not import.
  • Transitive drift from the lockfile regeneration: viem 2.54.2 → 2.55.4, ox 0.14.29 → 0.14.30, @stripe/stripe-js 9.8.0 → 9.9.0, and a prerelease inversion @modelcontextprotocol/server 2.0.0-beta.2 → 2.0.0-alpha.4 (pulled via incur, off the crypto/wire path), plus test-only dedupes. stripe stays 22.4.0-beta.1 (unchanged — still the current public-preview dist-tag); every dep keeps its sha512 integrity hash.
  • Re-bundle republishes with 0.8.12 inlined (extension deps are bundled at build time). Regression coverage: the full suite (120 offline tests) + the 10000-run property soak re-run green against 0.8.12, and the spec-fixture contract (stripe_mpp_test.ts) and adversarial/tamper (stripe_mpp_adversarial_test.ts) suites pass UNMODIFIED.
03Models1
@magistr/stripe-mppv2026.07.21.2extensions/models/stripe_mpp.ts

Global Arguments

ArgumentTypeDescription
secretKeystringStripe secret key (sk_test_... / sk_live_...). Use a vault reference:
serverSecret?stringSeller-side HMAC secret (>=32 chars) binding challenge ids
networkId?stringStripe Business Network Profile id (profile_test_... / profile_...).
realmstringProtection-space identifier advertised in seller challenges (RFC 9110).
stripeVersionstringStripe-Version header. SPT endpoints need the preview channel.
testModebooleanGates test helpers (createTestGrantedToken). Must match the key mode.
allowInsecurebooleanTest-fixture escape: permit plain http:// to loopback, allow private/
timeoutMsnumberPer-request timeout for resource fetches and Stripe calls.
paymentMethodTypesarrayPayment method types advertised in seller challenges.
linkCliPath?stringABSOLUTE path to the installed @stripe/link-cli binary (a non-writable
linkCliVersionstringPinned link-cli version. The MCP initialize serverInfo.version is
allowLiveGrantsbooleanConsumer-grant live-money opt-in. Default false forces link-cli test
fn probe()
Request a resource WITHOUT paying and record the parsed payment
fn mintToken(paymentMethodId: string, maxAmount: string, currency: string, expiresAt?: number, sellerNetworkId?: string, externalId?: string)
Mint a fiat Shared Payment Token from an existing payment method
ArgumentTypeDescription
paymentMethodIdstringExisting payment method (pm_...). Raw-PAN creation is PCI-gated in
maxAmountstringUsage-limit ceiling, minor units string.
currencystringUsage-limit currency (ISO, lowercase).
expiresAt?numberUnix timestamp for usage_limits.expires_at.
sellerNetworkId?stringSeller network profile the token is granted to (defaults to networkId).
externalId?stringCorrelation id; also drives the Idempotency-Key.
fn pay(sptId: string, maxAmount: string, currency: string, expectedNetworkId?: string, expectedRealm?: string, externalId?: string)
Pay for a resource end-to-end: request it, parse the 402 stripe
ArgumentTypeDescription
sptIdstringShared Payment Token (spt_...) to present.
maxAmountstringSpend ceiling, minor units string. The challenge amount must not
currencystringExpected challenge currency. Mismatch blocks the payment.
expectedNetworkId?stringPin the payee: the Stripe Business Network Profile (profile_...) the
expectedRealm?stringPin the challenge realm (issuing authority); mismatch blocks the payment.
externalId?stringCorrelation id.
fn getIssuedToken(sptId: string)
Retrieve an issued Shared Payment Token
ArgumentTypeDescription
sptIdstringShared Payment Token id (spt_...).
fn revokeToken(sptId: string)
Revoke an issued Shared Payment Token
ArgumentTypeDescription
sptIdstringShared Payment Token id (spt_...).
fn createChallenge(amount: string, currency: string, description?: string, externalId?: string, expiresInSeconds?: number, networkId?: string, scope?: string)
Produce seller challenge material for a payment-gated resource:
ArgumentTypeDescription
amountstringAmount demanded, minor units string.
currencystringCurrency (ISO, lowercase).
description?string
externalId?string
expiresInSeconds?numberChallenge validity window; recommended to keep challenges short-lived.
networkId?stringOverride the global networkId.
scope?stringBind the challenge to a specific resource/route. Carried inside the
fn verifyCredential(authorizationHeader: string, expectedAmount?: string, expectedCurrency?: string, expectedScope?: string)
Verify a received Authorization: Payment credential — HMAC-bound
ArgumentTypeDescription
authorizationHeaderstringThe received Authorization value ("Payment <base64url>").
expectedAmount?string
expectedCurrency?string
expectedScope?stringRequire the credential's challenge `opaque` to equal this route scope
fn chargeToken(sptId?: string, amount?: string, currency?: string, authorizationHeader?: string, expectedScope?: string, description?: string, externalId?: string)
Settle a granted Shared Payment Token via a confirmed
ArgumentTypeDescription
sptId?stringGranted token to settle (or pass authorizationHeader).
amount?stringMinor units string.
currency?string
authorizationHeader?stringFull received credential; verified (HMAC + expiry) before settling.
expectedScope?stringWhen settling from an authorizationHeader, require the challenge
description?string
externalId?string
fn issueReceipt(chargeId: string, externalId?: string)
Produce the Payment-Receipt header value for a SETTLED charge
ArgumentTypeDescription
chargeIdstringSettled PaymentIntent id (pi_...).
externalId?string
fn getCharge(chargeId: string)
Retrieve a charge (GET /v1/payment_intents/{id}).
ArgumentTypeDescription
chargeIdstringPaymentIntent id (pi_...).
fn listCharges(externalId?: string, createdGte?: number, createdLte?: number, maxResults: number, pageSize: number)
Reconciliation fan-out: list charges by created range
ArgumentTypeDescription
externalId?stringFilter by metadata externalId (uses /v1/payment_intents/search).
createdGte?numberUnix lower bound.
createdLte?numberUnix upper bound.
maxResultsnumber
pageSizenumber
fn refundCharge(chargeId: string, amount: string, reason?: enum, externalId?: string)
Refund a settled charge (POST /v1/refunds) with
ArgumentTypeDescription
chargeIdstringPaymentIntent id (pi_...) to refund.
amountstringRefund amount, minor units string. Must not exceed the remaining
reason?enum
externalId?string
fn getGrantedToken(sptId: string)
Retrieve a granted Shared Payment Token (seller view). Card
ArgumentTypeDescription
sptIdstringShared Payment Token id (spt_...).
fn createTestGrantedToken(maxAmount: string, currency: string, paymentMethodId: string, expiresAt?: number)
TEST MODE ONLY: fabricate a granted Shared Payment Token via
ArgumentTypeDescription
maxAmountstringUsage-limit ceiling, minor units string.
currencystringUsage-limit currency.
paymentMethodIdstringPayment method the fabricated granted token draws on (required by the
expiresAt?number
fn listConsumerPaymentMethods()
List the consumer's Link wallet payment methods (csmrpd_). Fan-out:
fn getSpendRequest(id: string)
Retrieve a consumer spend request by lsrq_ (single-shot; interval 0).
ArgumentTypeDescription
idstringSpend request id (lsrq_...).
fn cancelSpendRequest(id: string)
Cancel a PENDING consumer spend request (read-before-cancel). Note:
ArgumentTypeDescription
idstringSpend request id (lsrq_...).
fn createSpendRequest(amount: string, currency: string, context: string, networkId?: string, paymentMethodId?: string, externalId?: string)
Create a consumer Link spend request — the PRIMARY (binding) guard
ArgumentTypeDescription
amountstringAmount to authorise, minor-units STRING (e.g. "500" = $5.00).
currencystringCurrency (ISO, lowercase). US-only Link; default usd.
contextstringPurchase description + rationale the consumer READS when approving.
networkId?stringPayee Business Network Profile (profile_...). Defaults to the global
paymentMethodId?stringConsumer Link payment method (csmrpd_...). Omit to let the consumer pick
externalId?stringCorrelation id; also anchors the deterministic intent key persisted on
fn paySpendRequest(id: string, maxAmount: string, currency: string, expectedNetworkId?: string, expectedRealm?: string, externalId?: string)
Spend an APPROVED consumer grant against an MPP-protected URL, by
ArgumentTypeDescription
idstringApproved spend request id (lsrq_...) to spend.
maxAmountstringADVISORY pre-flight ceiling (minor units). NOTE: the binding cap is the
currencystringExpected challenge currency (advisory).
expectedNetworkId?stringAdvisory payee pin for the pre-flight challenge.
expectedRealm?stringAdvisory realm pin.
externalId?stringCorrelation id.

Resources

challenge(infinite)— Probe result: HTTP status + parsed payment challenges.
payment(infinite)— Buyer payment attempt — written on EVERY pay outcome (audit trail).
issuedToken(infinite)— Issued Shared Payment Token (buyer view).
challengeSpec(infinite)— Seller challenge material: WWW-Authenticate value + problem+json body.
credential(infinite)— Seller-side credential verification verdict.
charge(infinite)— Seller charge (PaymentIntent) state.
receipt(infinite)— Issued Payment-Receipt header value for a settled charge.
refund(infinite)— Refund outcome — written on every refundCharge attempt (audit trail).
grantedToken(infinite)— Granted Shared Payment Token (seller view; card details trimmed).
summary(infinite)— Fan-out listing summary.
spendRequest(infinite)— Consumer Link spend-request lifecycle — written on EVERY outcome
consumerPaymentMethod(infinite)— Consumer Link payment method (csmrpd_; display as link-cli returns
04Skills1
stripe-mpp2 files
05Previous Versions4
2026.07.21.1Jul 21, 2026

2026.07.21.1

Consumer buyer (Link grant): a human WITHOUT a Stripe account can now fund agent payments from their Link wallet. Five methods behind a new lib/link_cli.ts anti-corruption layer that drives Stripe's link-cli as an MCP server over stdio (link-cli --mcp) — deliberately NOT its HTTP serve mode, which binds all interfaces with Access-Control-Allow-Origin: * and no auth (see SPIKE-link-cli.md).

  • listConsumerPaymentMethods, createSpendRequest, getSpendRequest, cancelSpendRequest, paySpendRequest.
  • The grant is spent BY REFERENCE (mpp_pay --spendRequestId); the model never holds a raw spt_ (persists lsrq_ only, strictObject resources). No Link token custody — link-cli owns its device-flow session on disk; the subprocess is spawned clearEnv.
  • createSpendRequest is the PRIMARY binding guard (anchored payee, amount cap ≤500000 + $0.50 USD floor, context≥100, response-echo) before the consumer is prompted; paySpendRequest's pre-flight is advisory only.
  • New non-secret globals: linkCliPath (absolute, fail-closed), linkCliVersion (drift-detection preflight), allowLiveGrants (default false → test mode).
  • Extracted pay's spend-guard into the shared challengeGuardViolation() helper (behaviour-preserving).
  • US-only (Stripe Link) and inert without an authenticated co-located link-cli session; the four consumer methods fail closed, the existing 14 are unaffected. Not live-verified (Link is US-only; the maintainer is EU) — built on the observed v0.9.0 tool contract, pinned by fixtures.

Modified 1 models. Modified 1 skills

2026.07.16.2Jul 16, 2026

Release 2026.07.16.2 — align model versions with manifests

Maintenance release across the @magistr extensions. For most packages this carries no functional change: the only edit is the model's version: field, brought back in line with its manifest version so the published model type version and the package version no longer drift.

Functional changes in this release are limited to:

  • anime-cron: normalizeTitle now strips a ": subtitle" suffix and a trailing parenthesized year before comparison, fixing dedup false-misses where the torrent title carries a subtitle or year that the AniList romaji does not.

  • arckit: first publish. Standalone ArcKit port — a 12-phase architecture governance state machine with 65 bundled templates, driven by a bundled skill.

Also tracks three extensions (kaiten, observability-agent, music-library) that previously existed only as untracked working-tree directories, recovered from stashes.

2026.07.13.1Jul 13, 2026

2026.07.13.1

Dependency bump: mppx@0.8.5 → 0.8.6 (patch). No breaking changes to the Challenge / Credential / Receipt codecs or the Mppx / Stripe server APIs.

  • Upstream 0.8.6 relevant to this model: preserved method-specific extension fields on receipts per the Payment-Receipt spec. The remaining 0.8.6 fixes are Tempo/crypto-path only (not exercised — this model is fiat/SPT).
  • Re-bundle republishes with 0.8.6 inlined (extension deps are bundled at build time). Spec-fixture contract tests (stripe_mpp_test.ts) re-run green against 0.8.6; full 97-test suite + property soak unchanged.
2026.07.03.1Jul 7, 2026

2026.07.03.1

Initial beta release of @magistr/stripe-mpp — buyer and full seller sides of Stripe's Machine Payments Protocol (HTTP-402 "Payment" auth, draft-ryan-httpauth-payment-01), fiat via Shared Payment Tokens.

  • 14 methods: probe, mintToken, pay, getIssuedToken, revokeToken, createChallenge, verifyCredential, chargeToken, issueReceipt, getCharge, listCharges, refundCharge, getGrantedToken, createTestGrantedToken.
  • Built on mppx@0.8.5 (MPP protocol) + stripe@22.4.0-beta.1 preview SDK (SPT lifecycle). Swamp-native layer: audit trail, amount+currency+payee+realm+ scope spend guard, SHA-256 idempotency keys, SSRF-hardened resource fetches (IPv4/IPv6 literals + DNS resolution), error redaction, test-mode gates.
  • 97 offline tests + env-overridable property soak (FC_NUM_RUNS) validated at 10000 cases; seller settle path live-verified in Stripe test mode.

Beta: rides Stripe preview API channels (exact-pinned deps); interfaces may shift with the drafts. US-only (Stripe SPT). Fiat only; Tempo deferred.

06Stats
B
85 / 100
Downloads
0
Archive size
244.0 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit0/2missing
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
07Platforms
08Labels