
P402
io.github.Z333QPublished by GitHub account Z333Qv1.0.0Updated Nov 10, 2026
Multi-provider AI router with x402 micropayment settlement on Base L2. 1% flat fee.
Overview
P402 is a local MCP server that routes assistant requests across 300+ LLM providers and settles each request in USDC on Base via x402 micropayments.
- What you can do
- Send chat requests through one OpenAI-compatible endpoint that picks a provider by cost, quality, speed or balanced mode
- Create and inspect session budgets that cap what an autonomous agent can spend
- Settle per-request payments on-chain through the x402 facilitator, with gasless USDC transfers on Base
- Exchange structured tasks with other agents over the A2A JSON-RPC protocol
- Review real-time spend analytics and cost optimization suggestions
- When to use it
- Use it when you want an assistant to call many LLM providers through a single key, to steer requests toward cheaper or faster models, or to give an autonomous agent a hard spending cap with on-chain settlement.
- Requirements
- Runs locally over stdio, typically via npx with the @p402/mcp-server package, so Node.js is needed. Requires a P402 account and an API key supplied in the P402_API_KEY environment variable. Network access to the P402 router is required; the base URL can be overridden with P402_ROUTER_URL. A VS Code extension bundles the same server.
Installation
In SourceWeft
- Open P402 in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
P402 Protocol
[npm @p402/sdk] [npm @p402/cli] [npm @p402/mcp-server] [npm @p402/mpp-method] [VS Code Marketplace] [License: MIT] [Docs]
AI payment router. Route across 300+ models, settle per request in USDC on Base or USDC.e on Tempo.
P402 sits between your AI application and every LLM provider. It handles intelligent multi-provider routing (cost / quality / speed / balanced), on-chain micropayment settlement via the x402 protocol and mppx on Base and Tempo, and spending guardrails for autonomous agents.
Why P402
Quick Start (VS Code / Cursor / Windsurf)
Install the extension — the MCP server is embedded, tools appear in Copilot agent mode immediately, no config files required:
Then run P402: Configure API Key from the command palette.
→ VS Code Marketplace · Open VSX
Quick Start (Claude Desktop / any MCP client)
→ MCP docs · MCP Registry
Quick Start (SDK)
Quick Start (CLI)
Routing Modes
Session Budgets
Enforce hard spending caps for autonomous agents:
x402 Payments
x402 is a machine-native payment protocol using HTTP 402. AI agents pay for resources using gasless EIP-3009 USDC transfers on Base L2.
Network: Base Mainnet (Chain ID: 8453) · Asset: USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
A2A Protocol
P402 implements the Google A2A spec over JSON-RPC 2.0. Agents communicate through structured tasks, discover capabilities via /.well-known/agent.json, and settle payments via the x402 extension.
Packages
Examples
Docs
Community
- Dashboard: p402.io/dashboard
- Docs: p402.io/docs
- Issues: GitHub Issues
- Security: See SECURITY.md for responsible disclosure
- Contributing: See CONTRIBUTING.md
License
MIT © P402 Protocol
Source: README.md at commit 94c8cc9
Tools
0Version history
1- v1.0.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts