P402 MCP server
io.github.Z333Q/p402·v1.0.0Multi-provider AI router with x402 micropayment settlement on Base L2. 1% flat fee.
0 stars43 downloads/wk
Reviews
Write oneNobody has reviewed P402 yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
P402 tools (6, 2 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
p402_chatwrite actionSend a chat completion through P402's AI router. Automatically selects the best provider based on routing mode (cost / quality / speed / balanced).
p402_compare_providersCompare AI provider pricing and capabilities side-by-side. Helps identify the cheapest or fastest provider for a given task type.
p402_create_sessionwrite actionCreate a budget-capped agent session. All chat completions using the returned session_id are charged against this budget. Returns the session object including id and budget details.
p402_get_sessionGet session details including remaining budget, status, and expiry. Use this to check how much budget a session has left before sending requests.
p402_healthCheck P402 router and x402 facilitator health. Returns status for both the routing layer and the on-chain settlement layer.
p402_list_modelsList all AI models available through the P402 router with their pricing, capabilities, and provider information.
Public scan report
scanner v0.1.10 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan4 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 62 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How P402 compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 78/100
- higher than 57% of 48,255 servers
- Tools
- 6
- the typical server has 7
- Tools that change things
- 33%
- typical: 0%. Fewer write tools means less an agent can break
- Downloads a week
- 43
- more than 35% of 12,191 servers with a package
What its tools let an agent do: 4 read · 2 change
Install P402 in Claude Code, Cursor or VS Code
Runs npx -y @p402/mcp-server on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add p402 -- npx -y @p402/mcp-server
What the publisher says
From the P402 repository's README, as published. We do not edit it. Read it on GitHub
P402 Protocol
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:
ext install p402-protocol.p402Then run P402: Configure API Key from the command palette.
→ VS Code Marketplace · Open VSX
Quick Start (Claude Desktop / any MCP client)
{
"mcpServers": {
"p402": {
"command": "npx",
"args": ["-y", "@p402/mcp-server"],
"env": { "P402_API_KEY": "p402_live_..." }
}
}
}→ MCP docs · MCP Registry
Quick Start (SDK)
npm install @p402/sdkimport P402Client from '@p402/sdk';
const p402 = new P402Client({ apiKey: process.env.P402_API_KEY });
// Drop-in OpenAI replacement — P402 picks the best provider
const response = await p402.chat({
messages: [{ role: 'user', content: 'Explain x402 payments in one sentence.' }],
p402: { mode: 'cost' } // cost | quality | speed | balanced
});
console.log(response.choices[0].message.content);
// p402_metadata: { provider: 'deepseek', cost_usd: 0.00031, latency_ms: 412 }Quick Start (CLI)
# Authenticate once
npx p402 login
# Chat using the cheapest provider
npx p402 chat "What is x402?" --mode cost
# Check facilitator health
npx p402 healthRouting Modes
Session Budgets
Enforce hard spending caps for autonomous agents:
// Create a $10 session — agent cannot spend a cent more
const session = await p402.createSession({ budget_usd: 10 });Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
P402: common questions
- Is P402 MCP server safe?
- Mostly: it is graded B (78/100). Read the P402 safety report
- How do I install P402?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does P402 need an API key?
- Yes. The registry entry asks for
P402_API_KEY. - Is P402 maintained?
- The last commit was 100 days ago (2026-07-27). The latest release is v1.0.0.
- How does P402 compare with other MCP servers?
- safety score 78/100 (higher than 57% of 48,255 servers); tools 6 (the typical server has 7); tools that change things 33% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.