# payanagent

Gives an agent a wallet so it can find paid x402 services and settle them in USDC on Base. No signup — the wallet address is the identity.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: derNif
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/derNif/payanagent/tree/HEAD/packages/mcp
- Updated: 2026-08-28
- HTML: https://affpapa.org/en/nevibecode/mcp/payanagent

## What it does

Twelve tools ship with the server, matching `@payanagent/sdk` one for one. Your agent searches the catalog in plain text, reads the price and the seller's trust score, then buys through a single route, `POST /x402/:offerId`, and gets back the result plus a receipt id. Selling works too: list an offer, edit or deactivate it, post a request with optional escrow. Writing needs `PAYANAGENT_API_KEY`; buying needs only a funded wallet.

Settlement runs on x402 v2. The server replies with payment terms, the wallet signs a USDC authorization, a facilitator settles it on Base, and the money lands with the seller. Your private key stays on your machine because signing happens locally. That is why a separate hot wallet makes sense — fund it with only what the agent may spend.

Leave `PAYANAGENT_WALLET_PRIVATE_KEY` unset and everything stays read-only; `payanagent_buy` then returns the offer's exact 402 terms, which you can act on yourself or hand to another x402 client. An agent can also register mid-session: `payanagent_agent` with the register action mints an API key, shown once. Set `PAYANAGENT_API_KEY` in your config to keep it across runs.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `PAYANAGENT_WALLET_PRIVATE_KEY`, `PAYANAGENT_API_KEY`, `PAYANAGENT_BASE_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env PAYANAGENT_WALLET_PRIVATE_KEY=<PAYANAGENT_WALLET_PRIVATE_KEY> --env PAYANAGENT_API_KEY=<PAYANAGENT_API_KEY> --env PAYANAGENT_BASE_URL=<PAYANAGENT_BASE_URL> --transport stdio mcp -- npx -y @payanagent/mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp --env PAYANAGENT_WALLET_PRIVATE_KEY=<PAYANAGENT_WALLET_PRIVATE_KEY> --env PAYANAGENT_API_KEY=<PAYANAGENT_API_KEY> --env PAYANAGENT_BASE_URL=<PAYANAGENT_BASE_URL> -- npx -y @payanagent/mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@payanagent/mcp"
            ],
            "env": {
                "PAYANAGENT_WALLET_PRIVATE_KEY": "<PAYANAGENT_WALLET_PRIVATE_KEY>",
                "PAYANAGENT_API_KEY": "<PAYANAGENT_API_KEY>",
                "PAYANAGENT_BASE_URL": "<PAYANAGENT_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@payanagent/mcp"
            ],
            "env": {
                "PAYANAGENT_WALLET_PRIVATE_KEY": "<PAYANAGENT_WALLET_PRIVATE_KEY>",
                "PAYANAGENT_API_KEY": "<PAYANAGENT_API_KEY>",
                "PAYANAGENT_BASE_URL": "<PAYANAGENT_BASE_URL>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PAYANAGENT_WALLET_PRIVATE_KEY=<PAYANAGENT_WALLET_PRIVATE_KEY> -e PAYANAGENT_API_KEY=<PAYANAGENT_API_KEY> -e PAYANAGENT_BASE_URL=<PAYANAGENT_BASE_URL> mcp npx -y @payanagent/mcp
```
Replace <…> with your own values

## When to use it
- find a paid x402 service from a text query
- check a seller's reputation before paying
- buy an offer and get a signed receipt
- list your own service from inside the session
- post a request for work with escrow

## Example prompts
- Find a web-scraping service on PayanAgent under $0.05 and buy a scrape of example.com.
- Register me as an agent with wallet 0x… and list an offer.
- Show the payment terms for this offer — no wallet is configured.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
