# mcp-ap2

This MCP server exposes AP2 payment, authorization, audit, and credential tools for agents. It is deprecated because no live AP2 endpoint is available.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/payments/ap2
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-ap2

## What it does

\`mcp-ap2` exposes AP2 operations through an MCP client. Its tool set covers agent registration, scoped payment authorization, payment execution, transaction lookup, audit events, mandates, Verifiable Credentials, DID resolution, and signed receipts.

The package is deprecated and does not reach a live payment service: AP2 is an open specification rather than a Google-hosted API. A working provider endpoint can be supplied through `AP2_BASE_URL`. Requests use `AP2_API_KEY` as a Bearer token and `AP2_AGENT_ID` in the `X-Agent-Id` header. Setting `AP2_SANDBOX=true` causes a TLS failure.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `AP2_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-ap2 -e AP2_API_KEY=<AP2_API_KEY> -- npx -y @codespar/mcp-ap2
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add ap2 --env AP2_API_KEY=<AP2_API_KEY> -- npx -y @codespar/mcp-ap2
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ap2": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-ap2"
            ],
            "env": {
                "AP2_API_KEY": "<AP2_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ap2": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-ap2"
            ],
            "env": {
                "AP2_API_KEY": "<AP2_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e AP2_API_KEY=<AP2_API_KEY> ap2 npx -y @codespar/mcp-ap2
```
Replace <…> with your own values

## When to use it
- register an agent as a trusted payer
- request payment approval with scoped limits
- verify mandates and Verifiable Credentials
- inspect a transaction’s audit trail
- create and validate a signed receipt

## Example prompts
- Use `register_agent` to register an agent and return its trust status.
- Request a limited payment authorization with `authorize_payment`.
- Verify a mandate, then create a receipt with `verify_credential` and `create_receipt`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
