Introducing a new way to review your PRs.

Read the announcement

solana-foundation / pay

CLI for Agentic payments (x402, MPP, AP2).

View on GitHub

30 documents · Updated Nov 11, 2026

docs / agent-payment-plugins

Agent payment plugins

The agent payment plugins are portable packages that give an agent host access to Pay payment tools and guidance for using them. They support two wallet models: a hosted Pay account or a wallet held on the local machine.

Package model

Each package joins an MCP tool definition with an Agent Skill. The MCP entry makes Pay tools available to the host. The skill guides the agent to choose a provider, plan the spend, make the smallest useful paid request, and stop when a payment is declined. Neither package contains the payment executable or code that updates itself.

The packages expose the same payment goal through different server locations:

PackagePayment serverWallet boundary
payHosted Pay MCP servicePay account managed by the hosted service
pay-cliLocal pay mcp processWallet on the user's machine

References: agent-plugins/…/README.md• L7-16 agent-plugins/…/README.md• L8-19

Payment tool guidance

The shared pay skill gives agents a safe high-level pattern for paid API use. An agent can discover priced APIs, select a provider, and send a request through Pay when the user approves the payment. A declined or unanswered confirmation stops the paid action rather than allowing an unattended spend.

Payment requests use stablecoins and can respond to HTTP 402, x402, or MPP payment challenges. The payment confirmation is part of the MCP interaction, so unattended work such as a scheduled run does not silently approve a spend.

flowchart LR
    A[Agent chooses a priced API] --> B[Pay exposes the payment request]
    B --> C{User confirms?}
    C -- Yes --> D[Pay completes the request]
    C -- No --> E[Agent stops the paid action]

References: agent-plugins/…/README.md• L3-5 agent-plugins/…/README.md• L12-14 agent-plugins/…/README.md• L63-69 agent-plugins/…/README.md• L3-6 agent-plugins/…/README.md• L13-15 agent-plugins/…/README.md• L54-59

Wallet choices

The hosted package keeps the wallet outside the agent host and connects to Pay through an authenticated remote MCP service. It suits users who want no local wallet file or payment binary. The local package starts the pay mcp server on the user's machine and uses the wallet configured by the Pay CLI. Both packages can be installed at the same time, but they represent separate wallet boundaries.

The choice affects where credentials and funds are controlled. A hosted account is shared by chats that use the same host profile. A local wallet is shared by every profile and chat on that machine that uses the local package. Users should select a personal profile or a trusted wallet boundary before enabling payment tools.

See the runtime payment plugin for the hosted model and the CLI payment plugin for the local model.

References: agent-plugins/…/README.md• L7-10 agent-plugins/…/README.md• L57-61 agent-plugins/…/README.md• L70-79 agent-plugins/…/README.md• L11-19 agent-plugins/…/README.md• L60-68

Agent host integration

The packages are designed for hosts that support Agent Plugins v1 and MCP. Installation adds the package and its skill. The host then makes the selected MCP server available in a later session or after reload, while authentication or local wallet setup remains an explicit user action.

The hosted package needs an OAuth sign-in to the Pay MCP service. The local package needs the Pay CLI installed and its wallet set up outside the plugin. In both cases, the plugin does not read credential files, and the host asks for confirmation before write-capable tool calls.

References: agent-plugins/…/README.md• L7-16 agent-plugins/…/README.md• L34-45 agent-plugins/…/README.md• L72-79 agent-plugins/…/README.md• L21-47 agent-plugins/…/README.md• L54-69

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the pay skill guidance aligned across both packages. Agents should receive the same spend and decline rules regardless of wallet model.
  • Keep each MCP server description aligned with its wallet boundary. A hosted account must not be described as local, and a local wallet must not be described as hosted.
  • Keep the child pages aligned with the package choice links when the server, authentication, or wallet setup changes.
  • Recheck the host contract when the MCP transport, server name, or tool confirmation behavior changes.

Important failure modes

TriggerConsequenceGuard
The user does not answer a payment requestThe paid action is declined, including in unattended runsRequire confirmation for each payment and stop on decline
A shared host profile uses the hosted packageChats using that profile can use the same Pay accountUse a personal host profile
Multiple local profiles use the CLI packageThey spend from the same machine walletTreat the machine as the wallet boundary
The local pay command is absent from PATHThe local MCP tools are not available to the hostInstall the Pay CLI and keep it on PATH
A local wallet is stored as an unencrypted file on an untrusted hostThe wallet key can be exposedUse the default OS keychain or a trusted wallet boundary

Key files

FileWhy to read it
agent-plugins/…/README.mdDefines the hosted package, its remote MCP service, skill purpose, host setup, and account risks.
agent-plugins/…/README.mdDefines the local package, its wallet boundary, CLI setup, and local-process risks.
docs/agent-pay-runtime-plugin.mdChild page for the hosted runtime payment plugin.
docs/agent-pay-cli-plugin.mdChild page for the local CLI payment plugin.