# AgentPay MCP server

> Enables AI agents to securely access APIs, manage credentials via a vault, and execute governed payments with human-in-the-loop approvals.

- Repository: https://github.com/Rumblingb/Agentpay
- Page: https://hostedmcp.org/servers/rumblingb/agentpay
- Transport: stdio, remote
- Stars: 2
- Latest version: 0.2.0

## Install

### Claude Code

```sh
claude mcp add --env 'AGENTPAY_API_KEY=<YOUR_AGENTPAY_API_KEY>' agentpay -- npx -y @agentpayxyz/mcp-server
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@agentpayxyz/mcp-server"
      ],
      "env": {
        "AGENTPAY_API_KEY": "<YOUR_AGENTPAY_API_KEY>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "agentpay": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@agentpayxyz/mcp-server"
      ],
      "env": {
        "AGENTPAY_API_KEY": "<YOUR_AGENTPAY_API_KEY>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"agentpay","type":"stdio","command":"npx","args":["-y","@agentpayxyz/mcp-server"],"env":{"AGENTPAY_API_KEY":"<YOUR_AGENTPAY_API_KEY>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@agentpayxyz/mcp-server"
      ],
      "env": {
        "AGENTPAY_API_KEY": "<YOUR_AGENTPAY_API_KEY>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add agentpay --env 'AGENTPAY_API_KEY=<YOUR_AGENTPAY_API_KEY>' -- npx -y @agentpayxyz/mcp-server
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.agentpay]
command = "npx"
args = ["-y", "@agentpayxyz/mcp-server"]

[mcp_servers.agentpay.env]
AGENTPAY_API_KEY = "<YOUR_AGENTPAY_API_KEY>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'AGENTPAY_API_KEY=<YOUR_AGENTPAY_API_KEY>' agentpay npx -- -y @agentpayxyz/mcp-server
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "agentpay": {
      "command": "npx",
      "args": [
        "-y",
        "@agentpayxyz/mcp-server"
      ],
      "env": {
        "AGENTPAY_API_KEY": "<YOUR_AGENTPAY_API_KEY>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `AGENTPAY_API_KEY` | yes | yes | AgentPay merchant API key used for authenticated tool calls |
| `AGENTPAY_API_URL` | no | no | Optional override for the AgentPay API base URL |
| `AGENTPAY_MERCHANT_ID` | no | no | Optional AgentPay merchant ID for intent creation and attribution |
| `BEE_CASPER_RECEIPT_ID` | no | no |  |
| `CASPER_PRIVATE_KEY_HEX` | no | no |  |
| `CASPER_RECIPIENT_PUBLIC_KEY_HEX` | no | no |  |

## FAQ

### How does AgentPay handle API credentials?

It uses a Capability Vault where users connect a provider once and the raw credential is vaulted server-side, providing the agent only with governed access.

### Can agents perform paid actions autonomously?

Agents can perform paid execution within user-defined guardrails, such as auto-approve limits and OTP policies.

### What happens if a paid API call requires human approval?

AgentPay pauses the process, collects the necessary approval or OTP, and then automatically resumes the exact call that was blocked.
