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

@p402/mcp-server

v1.0.0

Published

MCP server for P402 AI Payment Router — route 300+ AI models with per-request USDC micropayments on Base L2

Readme

@p402/mcp-server

MCP server for the P402 AI Payment Router — route 300+ AI models with per-request USDC micropayments on Base L2.

P402 sits between your AI agent and every major LLM provider. It intelligently selects the best model for each request based on cost, quality, or latency, and settles payment on-chain via the x402 protocol — 1% flat fee, no per-transaction minimums.

Installation

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "p402": {
      "command": "npx",
      "args": ["-y", "@p402/mcp-server"],
      "env": {
        "P402_API_KEY": "your-api-key-here"
      }
    }
  }
}

VS Code / Cursor / JetBrains AI

Search for p402 in the MCP server browser, or add the same configuration above to your editor's MCP settings.

Configuration

| Variable | Required | Description | |---|---|---| | P402_API_KEY | Yes | Your P402 API key — get one at p402.io/dashboard/settings | | P402_ROUTER_URL | No | Override the router URL (default: https://p402.io) |

Tools

p402_chat

Route a chat completion through P402's multi-provider router.

message        string   The user message
mode           string   cost | quality | speed | balanced (default: balanced)
model          string   Pin a specific model (optional)
session_id     string   Attach to a session budget (optional)
system         string   System prompt (optional)

Returns: The model's response plus p402_metadata (provider, model used, cost in USD, latency).

p402_create_session

Create a budget-capped session for cost-controlled agent runs.

budget_usd          number   Budget in USD (e.g. 1.00)
agent_id            string   Agent identifier for attribution (optional)
expires_in_hours    number   Session TTL (default: 24)

Returns: Session object with id — pass this as session_id to p402_chat.

p402_get_session

Check remaining budget and status for a session.

session_id    string   The session ID to query

p402_list_models

List all available models with pricing and provider details.

p402_compare_providers

Compare providers side-by-side for a given task type.

task_type    string   chat | embedding | code | reasoning (optional)

p402_health

Check router and on-chain facilitator health.

Example workflow

1. Call p402_create_session with budget_usd: 0.50
2. Use the returned session id in all p402_chat calls
3. Call p402_get_session to monitor remaining budget
4. The session auto-deactivates when budget is exhausted

Links

License

MIT