Google's Agent-to-Agent Payment Protocol. Authorization, audit, trust establishment between autonomous payment agents.
AP2 gives your agent 22 tools it calls directly β pick the ones it needs, in Claude, Cursor, or any MCP client.
register_agent β Register an AI agent as a trusted payer in the AP2 network. Defines the agent's identity, capabilities, and spending limits.get_agent β Get agent registration details, trust status, and current spend usagelist_agents β List registered agents with optional filters// Your agent calls a tool directly β no glue code.
// CodeSpar's managed tier handles OAuth2, token rotation and rate limits.
const result = await session.call("register_agent", { /* ... */ });$ npm install @codespar/mcp-ap2@alphaAdd this entry to your claude_desktop_config.json (or any MCP-compatible client config).
{
"mcpServers": {
"ap2": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-ap2@alpha"
],
"env": {
"AP2_API_KEY": "<your_ap2_api_key>"
}
}
}
}After restart, your agent can call any of the 22 tools below β try register_agent first.
Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.
AP2_API_KEYAPI key for ap2
Each tool is independent β your agent loads only what it needs to reduce context and response time.
register_agentget_agentlist_agentsrevoke_agentauthorize_paymentget_authorizationlist_authorizationsexecute_paymentMCP is a protocol β any framework that speaks it can mount this server.