three.ws Agent Payments — Claude Code MCP server: setup
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.
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-mcpWhat three.ws Agent Payments 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.
What it helps with
- 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 for the agent
- Create a payment session with a 10.00 USD budget and allow
api.example.com. - Pay for
https://api.example.com/datausing my session. - List my active payment sessions and show their remaining budgets.
How to install three.ws Agent Payments
Platform CLI
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-mcpReplace <…> with your own values
Platform CLI
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-mcpReplace <…> with your own values
Config file
{
"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
Config file
{
"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
Platform CLI
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-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about three.ws Agent Payments
How do I install three.ws Agent Payments in Claude Code?
Run `claude mcp add agentcore-payments-mcp -e THREE_WS_SESSION=<THREE_WS_SESSION> -e PAYMENT_SESSION_TOKEN=<PAYMENT_SESSION_TOKEN> -- npx -y @three-ws/agentcore-payments-mcp`. Provide your three.ws session value and payment session token.
What does three.ws Agent Payments do?
It lets an agent pay x402 endpoints through sessions governed by a budget and access rules. The platform wallet signs payments, so the agent does not handle a private key.
Which networks can payment sessions use?
Sessions support solana and base. Each payment is also subject to the session’s rules, such as its allowed hosts and per-transaction limit.