npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codespar/mcp-ap2

v0.1.1

Published

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

Readme

@codespar/mcp-ap2

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

npm License: MIT

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?

With 60+ partners including Visa, Mastercard, Stripe, PayPal, and Square, AP2 is the emerging standard for agent payment governance.

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

| Tool | Description | |------|-------------| | register_agent | Register an AI agent as a trusted payer in AP2 | | get_agent | Get agent registration details and trust status | | list_agents | List registered agents with filters | | revoke_agent | Revoke an agent's payment authorization | | authorize_payment | Request payment authorization with scoped limits | | get_authorization | Get authorization details by ID | | list_authorizations | List payment authorizations with filters | | execute_payment | Execute an authorized payment | | get_audit_trail | Get full audit trail for a transaction | | list_audit_events | List audit events with filters | | list_payment_methods | List available payment methods via AP2 partners | | get_transaction | Get full transaction details | | list_transactions | List transactions with filters |

Authentication

AP2 uses a Bearer API key and requires a registered Agent ID.

Get your credentials

  1. Visit the AP2 Developer Portal
  2. Register your application
  3. Generate an API key
  4. Register your agent to get an Agent ID
  5. Set the environment variables

Sandbox / Testing

AP2 provides a sandbox environment for testing. Set AP2_SANDBOX=true to use it.

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | AP2_API_KEY | Yes | API key from AP2 | | AP2_AGENT_ID | Yes | Registered agent ID | | AP2_SANDBOX | No | Set to true for sandbox mode |

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

License

MIT