Ap2

Finance and commerce

DEPRECATED: no live endpoint (AP2 is a spec; ap2.googleapis.com serves no API).

Your AI app calls the Ap2 MCP server, which does the finance and commerce work and sends the result back to the chat.

About Ap2

Ap2 is a community MCP server from codespar, filed in our directory under finance and commerce. DEPRECATED: no live endpoint (AP2 is a spec; ap2.googleapis.com serves no API).

Ap2 runs on your own machine: your AI app starts it with the command npx -y @codespar/mcp-ap2@0.2.0-alpha.4 and talks to it over standard input and output. It needs AP2_API_KEY set before Ap2 starts.

Ap2 is listed in the official MCP registry as io.github.codespar/mcp-ap2, version 0.2.0-alpha.4.

At a glance

Publisher
codespar (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @codespar/mcp-ap2
Written in
TypeScript
License
MIT
GitHub stars
278
Official MCP registry
io.github.codespar/mcp-ap2

How to set up Ap2

  1. Install Node.js on the machine that runs your AI app, because Ap2 starts with npx and downloads its package on first run.
  2. Create AP2_API_KEY for Ap2 in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Ap2 to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Ap2 tools to confirm the connection.
  5. Run one read-only task with Ap2 first, and keep your app asking before each tool call until the results look right.

Ap2 compared with similar servers

  • Asaas by codespar has fewer GitHub stars than Ap2 (278 against 278); both are community servers, and both run locally.
  • Andreani by codespar has fewer GitHub stars than Ap2 (278 against 278); both are community servers, and both run locally.
  • Banco Do Brasil by codespar has fewer GitHub stars than Ap2 (278 against 278); both are community servers, and both run locally.

Before you connect Ap2

  • Give Ap2 its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Ap2 tool call until you trust what it does with them.
  • Treat text that Ap2 fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Ap2 on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Ap2

How marketing and sales teams put Ap2 to work, by company size. Pick the size closest to yours and start Ap2 on one use case.

Small business

  • A small business can ask Ap2 which products and customers drive margin, then plan promotions around them.
  • Owners can use Ap2 to check refunds, failed payments and churn reasons without opening three dashboards.
  • Ap2 runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Ecommerce teams can connect Ap2 to tie campaigns to orders and revenue, not just clicks.
  • Marketing and finance can use Ap2 to check spend against budget each week and move money to what's working.
  • Start Ap2 on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should keep Ap2 read-only for agents, with any money movement handled by people and existing approvals.
  • Large commerce teams can use Ap2 to answer revenue questions by channel and region with figures finance signs off on.
  • Ap2 is a community server, so have security review the code and pin a version before Ap2 touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Ap2 README

From codespar/mcp-dev-latam on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

@codespar/mcp-ap2

Deprecated: no live endpoint. Measured on 2026-09-27: ap2.googleapis.com answers every path with Google's generic Error 404 (Not Found) page, and sandbox.ap2.googleapis.com (used with AP2_SANDBOX=true) fails the TLS handshake, because the certificate served there covers *.googleapis.com and not the extra label. AP2 is an open specification, not an API Google hosts. No tool in this server reaches a service. The package is deprecated on npm and stays in this repository for reference only. If you have a working endpoint, point the server at it with AP2_BASE_URL. To bring the package back, open an issue in mcp-dev-latam with the provider's documented base URL.

Alpha release, published under the alpha npm dist-tag. Pin exact versions during 0.x.x-alpha. Install with npm install <pkg>@alpha.

MCP server for AP2, Google's Agent-to-Agent Payment Protocol (authorization, audit, and trust for agentic payments)

What is AP2?

AP2 (Agent-to-Agent Payment Protocol) is Google's open framework for authorization, audit, and trust in agentic payments. It answers the critical questions: Who authorized this payment? What limits apply? What's the full audit trail?

The specification is published at ap2-protocol.org.

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "ap2": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-ap2"],
      "env": {
        "AP2_API_KEY": "your-key",
        "AP2_AGENT_ID": "your-agent-id"
      }
    }
  }
}
Claude Code
claude mcp add ap2 -- npx @codespar/mcp-ap2
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "servers": {
    "ap2": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-ap2"],
      "env": {
        "AP2_API_KEY": "your-key",
        "AP2_AGENT_ID": "your-agent-id"
      }
    }
  }
}

Tools (22)

Tool Purpose
register_agent Register an AI agent as a trusted payer in the AP2 network.
get_agent Get agent registration details, trust status, and current spend usage
list_agents List registered agents with optional filters
revoke_agent Revoke an agent's payment authorization.
authorize_payment Request payment authorization with scoped limits.
get_authorization Get authorization details including status, limits, and expiry
list_authorizations List payment authorizations with optional filters
execute_payment Execute an authorized payment.
get_audit_trail Get the complete audit trail for a transaction, every authorization, approval, execution, and settlement e..
list_audit_events List audit events across all transactions with filters
list_payment_methods List payment methods offered by the AP2 partner network
get_transaction Get full transaction details including authorization, execution, and settlement status
list_transactions List transactions with optional filters
create_intent_mandate Create an AP2 intent mandate, a Verifiable Credential expressing the user's intent to delegate a transacti..
create_cart_mandate Create an AP2 cart mandate, a signed, locked-cart commitment from a merchant binding line items, totals, a..
create_payment_mandate Create an AP2 payment mandate, the final Verifiable Credential authorizing settlement against a cart mandate.
verify_credential Verify a Verifiable Credential (intent, cart, or payment mandate).
create_presentation Create a Verifiable Presentation bundling one or more credentials (e.g.
verify_presentation Verify a Verifiable Presentation and all embedded credentials, including holder binding and challenge nonce.
resolve_did Resolve a Decentralized Identifier (DID) to its DID document via the AP2 universal resolver.
create_receipt Create a signed receipt for a settled payment, a tamper-evident record linking transaction, mandates, and..
verify_receipt Verify a receipt's signature, issuer, and chain back to the originating mandates.

Authentication

The server sends AP2_API_KEY as an Authorization: Bearer header and AP2_AGENT_ID as an X-Agent-Id header on every request (src/index.ts:69-73).

There is no portal issuing those credentials. The developer portal this README used to link, developers.google.com/ap2, answers HTTP 404, as does the ap2-spec repository it pointed at. The published specification is at ap2-protocol.org.

Environment Variables

Variable Required Description
AP2_API_KEY Yes Sent as Authorization: Bearer
AP2_AGENT_ID Yes Sent as the X-Agent-Id header
AP2_SANDBOX No true switches BASE_URL to https://sandbox.ap2.googleapis.com/v1, which fails TLS

Use Cases

  • Authorized agent purchases, Agent requests spend authorization, gets approval with limits, then executes payment
  • Multi-agent commerce, Agent A authorizes Agent B to make payments on its behalf with scoped limits
  • Compliance & audit, Full audit trail of every authorization, approval, execution, and settlement
  • Cross-rail payments, AP2 bridges card payments, bank transfers, wallets, and x402 micropayments

Roadmap

v0.2 (planned)
  • create_policy, Define reusable authorization policies
  • delegate_authority, Allow agent-to-agent authorization delegation
  • get_spend_report, Get spend analytics and reports
  • OAuth 2.0 authentication flow
v0.3 (planned)
  • Webhook support for real-time authorization events
  • Multi-currency support with automatic FX
  • Integration with x402 as payment method

Want to contribute? Open a PR or request a tool.

Links

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Questions about Ap2

What is the Ap2 MCP server?

DEPRECATED: no live endpoint (AP2 is a spec; ap2.googleapis.com serves no API). Ap2 is maintained by codespar on GitHub at codespar/mcp-dev-latam, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Ap2 MCP server?

Add Ap2 to your AI app's MCP config with the command npx -y @codespar/mcp-ap2@0.2.0-alpha.4. In Claude Code, run claude mcp add --transport stdio codespar-ap2 -- npx -y @codespar/mcp-ap2@0.2.0-alpha.4. To run Ap2 this way you need Node.js installed.

Does Ap2 need an API key?

Yes. Ap2 expects AP2_API_KEY to be set. Create the key for Ap2 in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Ap2 an official MCP server?

No. Ap2 is a community server maintained by codespar. Community servers can be excellent; read the code and the open issues before you give Ap2 access to company data.

What license is Ap2 under?

Ap2 is released under the MIT license, according to its GitHub repository. The license covers the code of Ap2; the service it connects to has its own terms.