Skip to content
MCP server
Registry

x402ai-mcp MCP Server

Pay-per-call AI tools (embed, summarize, ask, policy-check) from x402ai, paid in USDC on Base.

x402ai-mcp scores 66 (Good), licensed MIT and written in TypeScript. It installs as a local process. It declares 1 tool. Filed under AI and memory. GitHub shows 0 stars. Package registries report about 85 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by ukenalMITTypeScript0 stars
Trust score
66Good
Trust score 66 of 100, Good

Good trust

66 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 66 comes from

22 + 20 + 0 + 10 + 4 + 10 = 66. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity0 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 0 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "ukenal-x402ai-mcp": {      "command": "npx",      "args": [        "-y",        "x402ai-mcp@0.1.3"      ],      "env": {        "X402AI_BUYER_PRIVATE_KEY": "YOUR_X402AI_BUYER_PRIVATE_KEY",        "X402AI_MAX_SESSION_USD": "0.25",        "X402AI_DRY_RUN": ""      }    }  }}

Environment variables

NameRequiredNotes
X402AI_BUYER_PRIVATE_KEYSecretOptionalBuyer wallet private key (hex), used only to sign payments locally. Needed only for the paid tools. Use a wallet holding only what you are willing to lose.
X402AI_MAX_SESSION_USDOptionalSpending cap per server process in USD (default 0.25).
X402AI_DRY_RUNOptionalSet to 1 to quote prices without signing or paying.

Tools1Tool docs quality grade F

All capabilities

About

x402ai-mcp

A local MCP server that lets AI clients (Claude Desktop, Claude Code, Cursor and others) call the paid x402ai endpoints, paying per call in USDC on Base through the x402 protocol, plus a free inspector for any x402 endpoint.

It runs on your machine over stdio. You give it a buyer key; it answers each HTTP 402 payment challenge by signing a USDC authorization, and returns the result. Nothing is hosted for you and no account is needed.

Tools

ToolCostWhat it does
embed$0.01768-dimension text embedding (nomic-embed-text)
summarize$0.02Summary of the input text (small local LLM)
ask$0.04Short answer, 2-3 sentences; no web access, no memory, can be wrong
policy_check$0.01Checks up to 20 proposed agent actions against a baseline or strict policy; checks only, enforces nothing
healthfreex402ai service status, plus this session's spend and remaining cap
inspectfreeTakes a URL: decodes its 402 challenge, runs Coinbase's x402 validator and a Bazaar merchant lookup

embed, summarize and ask take one input string of up to 3,000 characters. health and inspect need no key.

policy_check takes a profile, the agent's context and 1-20 actions (read, write, delete, exec, network, pay, self_modify), and returns x402ai's policy engine JSON (policy, results, summary, checked_rules) unchanged as result. It only reports; nothing is blocked. A request looks like this:

{
  "profile": "baseline",
  "context": { "workdir": "/home/dev/project", "home": "/home/dev", "sandboxed": true },
  "actions": [
    { "type": "write", "target": "~/.ssh/config" },
    { "type": "exec", "command": "npm test" }
  ]
}

Fields per action type: read/write/delete take target; exec takes command; network takes host; pay takes amount_usd, recipient and network; self_modify takes control (sandbox, network_allowlist, hooks, permissions, audit_log) and change (lower or raise). A missing or wrong field comes back as needs_review. Strings are limited to 2,048 characters.

Before you start: use a dedicated wallet

This server holds a private key that can spend money. Use a new wallet that exists only for this, funded with a few dollars of USDC on Base at most. Payments are gasless for the payer (EIP-3009), so the wallet needs USDC only, no ETH. Never use a wallet that holds anything you can't afford to lose. The wallet balance is your real spending limit.

Can you trust this package?

This server asks for a key that can spend money, and fake "x402 MCP" packages that steal keys have been reported. Don't take this README's word for it: the claims below are meant to be checked.

  • The package never sends or logs your key. It is read once from X402AI_BUYER_PRIVATE_KEY and used only to sign payment authorizations locally, and it is scrubbed from error messages. It stays in this process's environment and memory while the server runs, so anything that can read those (other code in this process, other programs running as your user, your client's config file) can read the key. Clearing the variable inside the process would not change that, because Linux keeps a process's starting environment readable under /proc.
  • Every host it contacts. No request follows a redirect; a redirect is refused and the call fails.
    • https://api.x402ai.dev: the paid tools and health. Signed authorizations go only here, only for the calling tool's own route and price, and expire within 300 seconds.
    • https://api.cdp.coinbase.com: only when you run inspect (Coinbase's validator and merchant lookup).
    • The URL you pass to inspect: one unpaid request (with a fixed body for POST). Nothing is signed.
  • No telemetry, analytics or update checks.
  • Small and readable. Five source files in src/ (about 710 lines), built with tsc into dist/. The published package contains only dist/, this README, LICENSE and package.json.
  • Pinned dependencies. Direct dependencies are pinned to exact versions. npm resolves their dependencies fresh, within the ranges they declare, when you install, so those aren't frozen; the repository's package-lock.json records the exact set that was tested. No dependency runs an install script. All dependencies have verified npm registry signatures (npm audit signatures). The x402 client is @x402/fetch 2.29.0, with a per-payment cap set in code.
  • The spend safeguards stop honest code from overspending; they do nothing against a malicious package. That is why the points above are checkable.

How to check: compare the published files with the source (npm pack x402ai-mcp@<version> downloads the exact tarball for inspection), confirm the package name is exactly x402ai-mcp, and read src/.

Don't run unvetted MCP servers in the same client as a funded key. Any other program running as your user, including another MCP server, can typically read this process's environment and your client's config file, which holds the key in plain text.

Install

Requires Node.js 20 or later. Add it to your MCP client's configuration, for example:

{
  "mcpServers": {
    "x402ai": {
      "command": "npx",
      "args": ["-y", "x402ai-mcp"],
      "env": {
        "X402AI_BUYER_PRIVATE_KEY": "0x...",
        "X402AI_MAX_SESSION_USD": "0.25"
      }
    }
  }
}

Note that most clients store this file in plain text, so the key sits on disk unencrypted. That is one more reason to use a dedicated low-balance wallet.

To try it without a key or any spending, set X402AI_DRY_RUN=1: paid tools then return the price quote they would pay, and never sign anything.

Configuration

VariableDefaultMeaning
X402AI_BUYER_PRIVATE_KEYnoneBuyer key (hex). Needed only for paid tools. Never logged; scrubbed from error messages.
X402AI_MAX_SESSION_USD0.25Total the server may spend per process. An invalid value stops it at startup.
X402AI_DRY_RUNoff1 = quote only, never sign. No key needed.

The server logs to stderr only (stdout carries the MCP protocol). At startup it prints whether a key is configured, the buyer address and the session cap.

Spending safeguards

  • Per payment: before signing, each paid tool checks that the challenge is for Base mainnet, USDC, x402ai's payment address, and that tool's own route, at or below that route's price. Anything else is refused. A per-payment maximum of $0.04 is enforced as a second check.
  • Short-lived authorizations. A challenge that asks for an authorization valid longer than 300 seconds is refused before signing, so a leaked authorization cannot stay usable for long.
  • Per session: each payment attempt is reserved against X402AI_MAX_SESSION_USD before signing. Once the cap is reached, paid tools refuse until the server restarts.
  • The session cap is per process. It is counted in memory, resets when the server restarts, and each running copy of the server gets its own cap, even with the same wallet. The wallet balance is the only hard limit: fund it with only what you are willing to lose.
  • The cap has no upper limit. A typo such as 250 means $250. The wallet balance is the backstop that always holds.

Things to know

  • A failed call can still count. If the server returns an error after the payment was signed, the reservation is kept, because a signed authorization can still settle. You are not charged when x402ai's handler fails, but the session cap treats the attempt as spent.
  • inspect sends the URL you give it to Coinbase's CDP (validator and merchant lookup). Don't inspect URLs you want to keep private.
  • inspect refuses local and private addresses (loopback, private ranges, link-local, CGNAT, IPv6 ULA, and IPv4 addresses wrapped in IPv6 forms), checked after DNS resolution. It allows https only. The request to the inspected URL checks the resolved addresses at connect time, in the same lookup the socket uses, so a DNS answer that changes after the early check cannot reach a local or private address. It follows no redirects and verifies the TLS hostname. This covers the request to the inspected URL; inspect's calls to Coinbase go to a fixed host.
  • Treat tool output as untrusted data. Answers and summaries come from a small model and may be wrong; responses from inspected endpoints are third-party content. Don't let them act as instructions to your agent.
  • Latency: embed is usually under a second; summarize and ask take about 5-15 seconds (CPU inference).
  • Claude Code may load tool schemas late. Claude Code defers MCP tool schemas by default, so the first call to a tool can go out with wrong or empty arguments. Starting Claude Code with ENABLE_TOOL_SEARCH=false loads them up front.

License

MIT. Not affiliated with Coinbase or the x402 Foundation.

Frequently asked questions

What is x402ai-mcp MCP Server?

Pay-per-call AI tools (embed, summarize, ask, policy-check) from x402ai, paid in USDC on Base.

How do I install x402ai-mcp MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. x402ai-mcp MCP Server runs locally from the npm package x402ai-mcp with the command npx -y x402ai-mcp@0.1.3.

Is x402ai-mcp MCP Server free and open source?

Yes. x402ai-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does x402ai-mcp MCP Server support remote (HTTP) connections?

No remote endpoint is listed for x402ai-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does x402ai-mcp MCP Server provide?

x402ai-mcp MCP Server provides 1 tool: policy_check. See the full tool list for descriptions and parameters.

How is x402ai-mcp MCP Server's trust score calculated?

x402ai-mcp MCP Server scores 66 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server