x402-mcp
This server turns any AI agent into an autonomous x402 buyer, capable of discovering, inspecting, and paying for services on the x402 network using USDC on Solana — with a self-custodial wallet or a session token.
x402_wallet: View any Solana wallet's address and its live SOL and USDC balances. Defaults to the configured signer wallet.find_services: Search the live x402 bazaar (PayAI + Coinbase CDP) for paid HTTP APIs and MCP tools. Filter by query, service type, network (CAIP-2), and maximum USDC price.inspect_endpoint: Probe any x402 endpoint to read its full payment requirements (scheme, network, asset, price, pay-to address) without spending any money. Returns the result directly if the endpoint is free.pay_and_call: Pay an x402 endpoint and retrieve its result in one step. Supports:Self-custodial mode: Signs with your own
SOLANA_SECRET_KEYor a per-call secret key.Session-governed mode: Uses a three.ws Payment Session token (
pss_…) so the platform wallet signs on your behalf — no private key required.Payment in USDC (default) or $THREE (if the endpoint supports it).
Built-in safety guards: price cap (
MAX_PAY_USD, default $1), confirmation requirement (REQUIRE_CONFIRM), pre-flight 402 probe before payment, and idempotency key support to avoid double-charges.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x402-mcpsearch for affordable text-to-speech APIs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
A Model Context Protocol server that turns any AI assistant into an autonomous economic agent on the x402 network. Search the live bazaar for paid services, read an endpoint's price before committing money, and
pay_and_callany x402 service in USDC — settled on Solana with your own key, never a custodial wallet.
This is the buyer side of the three.ws agent economy. The payment dance and Solana exact-scheme signing are handled by the real @x402/* libraries — nothing is mocked.
Install
npm install @three-ws/x402-mcpOr run with npx:
SOLANA_SECRET_KEY=<base58> npx @three-ws/x402-mcpRelated MCP server: BotWallet MCP Server
Quick start
Claude Code, one line:
claude mcp add x402 --env SOLANA_SECRET_KEY=<base58> -- npx -y @three-ws/x402-mcpClaude Desktop / Cursor (claude_desktop_config.json or mcp.json):
{
"mcpServers": {
"x402": {
"command": "npx",
"args": ["-y", "@three-ws/x402-mcp"],
"env": {
"SOLANA_SECRET_KEY": "<base58 secret of the wallet that holds USDC>",
"SOLANA_RPC_URL": "https://your-rpc-provider",
"MAX_PAY_USD": "1"
}
}
}
}SOLANA_SECRET_KEY is only needed to spend (pay_and_call, and x402_wallet defaulting to your wallet). find_services and inspect_endpoint work with no key.
Tools
Tool | Type | What it does |
| read-only | A wallet's address + live SOL/USDC balance. Defaults to your signer wallet — confirm funds before paying. |
| read-only | Search the live x402 bazaar (PayAI + Coinbase CDP) for paid HTTP/MCP services with prices. |
| read-only | Read any endpoint's 402 payment requirements (scheme, network, asset, price, pay-to) without paying. |
| execution | Pay an x402 endpoint in USDC from your Solana key and return its result. Bounded by |
Safety
pay_and_call carries destructiveHint: true, so annotation-aware clients (Claude Code, Claude Desktop, Cursor) prompt before running it. Beyond the client hint, every payment is bounded server-side: it probes the 402 first and refuses if the price exceeds max_usd or MAX_PAY_USD (default $1) before any money moves, and with REQUIRE_CONFIRM on (default) the call refuses until re-issued with confirm: true. Only the Solana (solana:*) exact-scheme requirement is settled — with the key you control.
Input parameters
x402_wallet — address (optional base58; defaults to the signer wallet).
find_services — query (required), type (http | mcp, default http), network (CAIP-2 filter), max_price_usdc, limit (1–100).
inspect_endpoint — url (required), method (GET | POST), body (object).
pay_and_call — url (required), method (GET | POST), body (object), max_usd (lowers the cap for this call), secret (per-call signer override), confirm (must be true when REQUIRE_CONFIRM is on).
Example
// inspect_endpoint — what does it cost? (no payment)
> { "url": "https://three.ws/api/x402/vanity?prefix=ab" }
{
"ok": true, "paid": true,
"accepts": [
{ "scheme": "exact", "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "asset": "EPjFW…", "price": 50000 }
],
"payable_with_this_wallet": true
}
// pay_and_call — confirm:true required by default
> { "url": "https://three.ws/api/x402/vanity?prefix=ab", "confirm": true }
{ "ok": true, "paid": true, "payer": "Gx5E…", "price_usd": 0.05, "settlement": { … }, "result": { … } }Requirements
Node.js >= 20.
A Solana mainnet RPC endpoint (
https; onlyhttp://localhostis allowed for dev). Public cluster works for reads; bring your own for payment traffic.To pay: a Solana wallet holding USDC, as a base58
SOLANA_SECRET_KEY(or per-callsecret).
Environment variables
Variable | Required | Default |
| to pay only | — |
| no |
|
| no |
|
| no |
|
| no |
|
Links
Homepage: https://three.ws
MCP catalog: https://three.ws/docs/mcp
Changelog: https://three.ws/changelog
License: Apache-2.0 — see LICENSE
License
All rights reserved. See LICENSE.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
Flicense-qualityFmaintenanceEnables AI agents to discover and pay for monetized services such as PDF processing and DeFi operations using USDC on the Base blockchain. It provides automatic payment processing and secure local wallet management for seamless integration with MCP-compatible clients.Last updated47- AlicenseAqualityDmaintenanceEnables AI agents to manage USDC wallets on Solana, allowing them to send payments, create invoices, and access paid APIs within human-defined spending limits. It uses threshold signatures to provide agents with financial autonomy while ensuring secure oversight and transaction approval.Last updated636443Apache 2.0
- AlicenseAqualityAmaintenanceThe MCP gateway that lets any AI agent discover and pay metered APIs on Base or Solana — without the user wiring payments themselves.Last updated3401Apache 2.0
- AlicenseAqualityCmaintenanceLets AI agents discover, pay for, and call any HTTP API per request using USDC, with gasless nanopayments and no API keys or accounts needed.Last updated5303MIT
Related MCP Connectors
Native Solana staking for AI agents. 26 MCP tools, one-shot signing, webhooks.
Stripe-native marketplace where AI agents discover and pay per call for API services.
Attribution and settlement infrastructure for AI agent content access over HTTP 402 and MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nirholas/x402-payments-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server