@agentpay-run/mcp-server
v0.2.1
Published
Official MCP server for AgentPay. Lets agents charge vendors, check budgets, and inspect quota through any MCP-compatible client (Claude Desktop, Cursor, etc.).
Maintainers
Readme
@agentpay-run/mcp-server
Official MCP server for AgentPay.
Lets agents running through any MCP-compatible client (Claude Desktop, Cursor, Continue, your own MCP host) charge vendors, check budgets, and inspect tier quota through your AgentPay wallet — with all of AgentPay's policy gates, anomaly detection, and audit logging in front.
Why
The state of the art for giving an agent a budget is "share your Stripe key and pray." AgentPay puts a real spend-control layer between the agent and the payment rail. This MCP server exposes that layer as standard MCP tools so any agent can use it without a vendor-specific integration.
Tools exposed
| Tool | What it does |
|--------------|-----------------------------------------------------------------------------------------------|
| charge | Charge a vendor. Returns approved/denied + which policy matched + remaining budget. |
| get_wallet | Read-only wallet snapshot: budget, spent, per-tx cap, vendor allowlist, active state. |
| get_quota | Read-only tier + remaining quota: wallets, today's charges, audit retention. |
Install in Claude Desktop
- Get a wallet API key at agentpay.run/dashboard (use a
ap_test_...key while you wire things up). - Open
claude_desktop_config.json(Claude Desktop → Settings → Developer → Edit Config). - Add:
{
"mcpServers": {
"agentpay": {
"command": "npx",
"args": ["-y", "@agentpay-run/mcp-server"],
"env": {
"AGENTPAY_API_KEY": "ap_test_..."
}
}
}
}- Restart Claude Desktop. You'll see the
agentpayserver in the MCP indicator (bottom right of the chat).
Install in Cursor / other MCP hosts
Anywhere that accepts an MCP server config, point it at npx -y @agentpay-run/mcp-server with the same AGENTPAY_API_KEY env var.
Usage
Once installed, just talk to your agent like you would otherwise:
"Charge openai.com $12 against my dev wallet, then tell me what's left."
The agent picks charge, reads back the response, and decides what to do based on the policy verdict.
Configuration
| Env var | Required | Default | Notes |
|----------------------|----------|------------------------|--------------------------------------------------------------------------------------|
| AGENTPAY_API_KEY | yes | — | Wallet API key. ap_test_... for development, ap_live_... for production wallets. |
| AGENTPAY_BASE_URL | no | https://agentpay.run | Override for self-hosted or local dev (e.g. http://localhost:3000). |
Local development
git clone https://github.com/sdeanesh-png/agentpay
cd agentpay/sdk/mcp
npm install
npm run build
AGENTPAY_API_KEY=ap_test_... node dist/index.jsThe server speaks MCP over stdio. To smoke-test it manually, pipe a JSON-RPC tools/list request:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | AGENTPAY_API_KEY=ap_test_dummy node dist/index.jsSecurity
- The wallet API key is the only secret. It's wallet-scoped — even if compromised, the blast radius is bounded by the policy you set on that wallet (per-tx cap, monthly budget, vendor allowlist).
- The server is stateless. Every call re-queries AgentPay; nothing is cached locally.
- For production, use
ap_live_...keys with strict per-tx caps and a vendor allowlist. Treat them like API tokens: rotate via the dashboard if exposed.
License
MIT.
