Skip to main content
AP

AP2

v20260413_01OAuth2

Google's Agent-to-Agent Payment Protocol. Authorization, audit, trust establishment between autonomous payment agents.

10 tools0 triggers๐ŸŒ GLOBALbeta

Install

terminal
$ npm install @codespar/mcp-ap2

Quickstart

quickstart.ts
// your agent can now call any AP2 tool via MCP
import { CodeSpar } from "@codespar/sdk";

const cs = new CodeSpar();
const session = await cs.create("user_123");
const tools = await session.tools("@codespar/mcp-ap2");

Why this toolkit

Built for production AI commerce workflows

โ†’ MANAGED AUTH

OAuth2 without the pain

We handle token refresh, rotation, and multi-tenant credential storage. Your agent never touches raw secrets.

โ†’ LLM-FRIENDLY

Optimized schemas

Every tool has a JSON Schema tuned for LLM function-calling. Fewer hallucinations, fewer retries.

โ†’ SLA 99.9%

Running in production

Managed hosting with auto-scaling, circuit breakers, and retry logic. Battle-tested in real commerce loops.

Available tools ยท 10

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

10 tools available. Detailed tool list coming soon.

Compatible frameworks

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Usage patterns

Pattern #1

Autonomous collections

Agent monitors overdue invoices, sends WhatsApp reminders via send_message, generates Pix charges with create_pix_charge, and reconciles payments -- fully autonomous.

Pattern #2

Overnight fiscal reconciliation

Scheduled agent cross-references ERP orders with NF-e emissions using list_receivables, flags mismatches, and auto-corrects when confidence is high.

Frequently asked questions

All credentials are encrypted at rest with AES-256 and stored in an isolated vault per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets -- it receives scoped, short-lived session tokens.
CodeSpar โ€” Commerce Infrastructure for AI Agents