The Economic Layer for AI Agents.
Agents need wallets, not credit cards. Model Context Protocol (MCP) on P402 gives Claude, Cursor, and custom agents a secure wallet and an orchestration layer to negotiate, pay, and route data autonomously.
Agent Wallet Status
Daily Budget
$10.00
84% Remaining
Avg. Latency
124ms
-12% vs last week
Why P402 for MCP?
Autonomous Payments
Enable your agent to pay for premium tools (weather, market data, high-tier LLMs) without human approval, strictly within pre-defined policies.
Protocol Routing
Don't hardcode providers. P402 routes agent requests to the most cost-effective and healthy models in real-time.
Semantic Guardrails
Prevent agent "hallucination loops" from draining your wallet with semantic analysis and recursive-call kill switches.
Install in Your Environment
Three distribution paths. Pick the one that matches your client.
ext install p402-protocol.p402Embedded MCP server bundled inside the extension. Tools appear in Copilot agent mode immediately on install — no config files, no env vars, no restart.
npx -y @p402/mcp-serverStandalone stdio MCP server. Add to your client's config file with P402_API_KEY. See the config snippet below.
npm install @p402/sdkDrop-in replacement for direct provider calls. Change the base URL and API key — everything else stays the same.
Quick Local Setup
Initialize Agent Wallet
Create a dedicated hot wallet for your agent. We recommend keeping <$10 USDC for safety.
Define Policy
Set spending limits (e.g., $1.00/day) and allowed providers via the P402 Dashboard.
Sync MCP Server
Add the P402 MCP server to your client (Claude Desktop or Cursor) to bridge the agent to the web.
claude_desktop_config.json
{
"mcpServers": {
"p402": {
"command": "npx",
"args": ["-y", "@p402/mcp-server"],
"env": {
"P402_API_KEY": "p402_live_...",
"P402_ROUTER_URL": "https://p402.io"
}
}
}
}Environment Variables
P402_API_KEYRequired. Your P402 API key from the dashboard.P402_ROUTER_URLOptional. Defaults to https://p402.io. Override for self-hosted deployments.Available Tools
Six tools exposed over stdio MCP transport. Use them from any MCP client.
p402_chatCoreRoute a prompt to the best provider. Supports cost / quality / speed / balanced modes. Settles payment per-request in USDC on Base at 1% flat fee.
params: prompt, mode?, model?, session_token?, max_tokens?
p402_create_sessionSessionsCreate a budget session with a USD cap. All p402_chat calls referencing this session draw from the shared budget — useful for multi-turn conversations.
params: budget_usd, label?
p402_get_sessionSessionsRetrieve session status: remaining budget, total spent, request count, and expiry.
params: session_token
p402_list_modelsDiscoveryList all 300+ routable models with provider, context window, cost per token, and availability.
params: provider?
p402_compare_providersDiscoverySide-by-side cost and latency comparison for a given model across all providers that serve it.
params: model
p402_healthOpsRouter uptime, facilitator settlement status, and provider health summary.
params: none
Infinite Scalability
As your agent fleet grows, P402 acts as the centralized Economic Gateway. 100 agents, 1 budget, 0 hardcoded API keys.