# p402 [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/Z333Q/p402-protocol  
**GitHub Stars:** 0  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/p402

## Description
Multi-provider AI router with x402 micropayment settlement on Base L2. 1% flat fee.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "p402": {
    "command": "npx",
    "args": ["-y","p402"],
    "env": {
      "P402_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `P402_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the p402 MCP server does

The p402 MCP server gives MCP-compatible clients access to P402, an AI payment router that can select among more than 300 models. Instead of integrating each provider separately, an agent sends requests through P402 and chooses a routing objective: lowest cost, highest quality, lowest latency, or a balanced result.

P402 also handles per-request payment settlement. Its payment flow uses x402 and supports USDC on Base, with the broader protocol material also describing USDC.e on Tempo through the available payment-method package. The service is designed for applications and agents that need to combine model access with machine-readable payments.

The p402 MCP server exposes six MCP tools.

## How it works

The server runs as a stdio process from the `@p402/mcp-server` npm package. An MCP client starts it with `npx`, passes the API key through the process environment, and then discovers the available tools. The server forwards authenticated operations to P402's service rather than requiring each client to implement provider-specific APIs.

Routing supports four modes. `cost` favors lower-priced providers, `quality` favors output quality, `speed` favors lower latency, and `balanced` combines those considerations.

For autonomous workflows, P402 supports sessions with hard dollar budgets. Requests associated with a session reduce its remaining allowance, and clients can query the session to inspect the balance. Payment settlement uses the x402 protocol and gasless EIP-3009 USDC transfers on Base, where the facilitator verifies and settles signed authorizations.

## Setup and configuration

For Claude Desktop or another MCP client, configure a server named `p402` with `npx -y @p402/mcp-server` as the command and set `P402_API_KEY` in its environment. The key is required to authenticate requests. The repository points to P402's MCP documentation and registry entry for client-specific configuration details.

VS Code, Cursor, and Windsurf can use the published `p402` extension instead. The extension embeds the MCP server and provides a command-palette action for configuring the API key, so this path does not require a separate MCP configuration file.

## Tools and capabilities

- Route AI requests across more than 300 models.
- Select cost, quality, speed, or balanced routing.
- Use one service instead of separate provider API integrations.
- Create and inspect sessions with spending budgets.
- Support x402 micropayment verification and settlement on Base.
- Access six MCP tools through the stdio package.

The p402 MCP server is a fit for agents that need provider choice and spend controls in the same workflow. It is less suitable if the application requires a specifically named model provider API without P402's routing layer, or if it needs tool schemas not documented by the package.

## Limitations and notes

The README identifies the server as stdio-based and does not document a separate HTTP transport for MCP. Base Mainnet is specified for the x402 USDC flow, including chain ID 8453 and the USDC contract address in the project documentation. P402 also documents an A2A JSON-RPC interface, but that is a separate protocol surface from the MCP server.

_Full upstream README: https://allmcps.com/mcp/p402/readme_

