# three.ws Agent Payments

This MCP server lets an agent pay x402 endpoints through budgeted sessions with access rules. The agent submits requests; the platform wallet signs the transactions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 249
- Author: nirholas
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/nirholas/three.ws/tree/HEAD/packages/agentcore-payments-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/threews-agent-payments

## What it does

The server exposes tools to create, inspect, list, and cancel payment sessions, as well as to pay x402 endpoints. A session draws its budget from three.ws credits and can restrict destinations with an allowed-host list and a per-transaction ceiling. Its token is returned once, so save it when the session is created.

The agent sends payment requests without receiving a private key; the platform wallet signs each transaction, while the server applies the session rules. The supported networks are `solana` and `base`. Configure `THREE_WS_SESSION` and `PAYMENT_SESSION_TOKEN` first. When an `allowed_hosts` list is set, requests to other hosts are rejected.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `THREE_WS_SESSION`, `PAYMENT_SESSION_TOKEN`, `THREE_WS_BASE`, `THREE_WS_TIMEOUT_MS` — 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 THREE_WS_SESSION=<THREE_WS_SESSION> --env PAYMENT_SESSION_TOKEN=<PAYMENT_SESSION_TOKEN> --env THREE_WS_BASE=<THREE_WS_BASE> --env THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> --transport stdio agentcore-payments-mcp -- npx -y @three-ws/agentcore-payments-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add agentcore-payments-mcp --env THREE_WS_SESSION=<THREE_WS_SESSION> --env PAYMENT_SESSION_TOKEN=<PAYMENT_SESSION_TOKEN> --env THREE_WS_BASE=<THREE_WS_BASE> --env THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> -- npx -y @three-ws/agentcore-payments-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "agentcore-payments-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@three-ws/agentcore-payments-mcp"
            ],
            "env": {
                "THREE_WS_SESSION": "<THREE_WS_SESSION>",
                "PAYMENT_SESSION_TOKEN": "<PAYMENT_SESSION_TOKEN>",
                "THREE_WS_BASE": "<THREE_WS_BASE>",
                "THREE_WS_TIMEOUT_MS": "<THREE_WS_TIMEOUT_MS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "agentcore-payments-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@three-ws/agentcore-payments-mcp"
            ],
            "env": {
                "THREE_WS_SESSION": "<THREE_WS_SESSION>",
                "PAYMENT_SESSION_TOKEN": "<PAYMENT_SESSION_TOKEN>",
                "THREE_WS_BASE": "<THREE_WS_BASE>",
                "THREE_WS_TIMEOUT_MS": "<THREE_WS_TIMEOUT_MS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e THREE_WS_SESSION=<THREE_WS_SESSION> -e PAYMENT_SESSION_TOKEN=<PAYMENT_SESSION_TOKEN> -e THREE_WS_BASE=<THREE_WS_BASE> -e THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> agentcore-payments-mcp npx -y @three-ws/agentcore-payments-mcp
```
Replace <…> with your own values

## When to use it
- cap an agent’s total payment budget
- restrict payments to approved hosts
- set a ceiling for each transaction
- inspect remaining funds and recent payments
- cancel a session and refund its unused budget

## Example prompts
- Create a payment session with a 10.00 USD budget and allow `api.example.com`.
- Pay for `https://api.example.com/data` using my session.
- List my active payment sessions and show their remaining budgets.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [CCXT](https://affpapa.org/en/nevibecode/mcp/ccxt.md) — MCP server · ★ 44583
- [Finance Toolkit](https://affpapa.org/en/nevibecode/mcp/finance-toolkit.md) — MCP server · ★ 5458
- [EdgarTools](https://affpapa.org/en/nevibecode/mcp/edgartools.md) — MCP server · ★ 2814
- [LetsFG — Flights & Hotels](https://affpapa.org/en/nevibecode/mcp/letsfg-flights-hotels.md) — MCP server · ★ 2188
- [AutoTS](https://affpapa.org/en/nevibecode/mcp/autots.md) — MCP server · ★ 1434

From the same set: [nirholas/three.ws](https://affpapa.org/en/nevibecode/by/nirholas/three.ws.md) — 43 cards

---
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
