Enables AI agents to discover and call pay-per-request APIs for images, LLMs, code, crypto, and travel using automatic USDC payments.
Also known as agentc22/x402engine-mcp
- Stars
- 1
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- 1.0.3
- Last commit
- Oct 11, 2026
- License
- —
What is x402engine MCP?
x402engine enables AI agents to discover and call pay-per-request APIs for images, LLMs, code, crypto, and travel using automatic USDC payments.
Summary generated from the project's README
About x402engine MCP server
Enabling AI agents to access paid services through automatic USDC payments is the primary function of this server. It allows developers to connect their agents to a wide variety of pay-per-request APIs, including LLMs, image generation, web scraping, code execution, and travel booking. By using the HTTP 402 protocol, the server handles transactions on either the Base or Solana networks, ensuring that agents can pay for the specific resources they consume.
Users set up the server locally using npx and configure it with a dedicated payer wallet via environment variables like X402_EVM_PRIVATE_KEY or X402_SOLANA_PRIVATE_KEY. To maintain security, the server signs payments locally so private keys are never transmitted to the gateway. Developers can control spending by setting a hard per-request limit with X402_MAX_PAYMENT_USD. While discovery tools like discover_services and service_health are free to use without a wallet, accessing paid tools requires a funded account on the chosen network.
What you can do with it
- 1Discover available paid APIsAn agent can scan the gateway to find and check the status of various service endpoints.
- 2Generate visual contentA developer can instruct an AI to create images using the integrated generation tools.
- 3Perform travel researchAn agent can search for flights, hotels, and locations to assist with trip planning.
- 4Manage cryptocurrency dataUsers can request real-time market prices, wallet balances, or transaction histories.
Written from the project's README. Every use case is checked against a quote from it.
How to install x402engine MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall x402engine MCP in Claude Code
$ claude mcp add --env 'X402_DEV_BYPASS=<YOUR_X402_DEV_BYPASS>' --env 'X402_PAYMENT_HEADER=<YOUR_X402_PAYMENT_HEADER>' x402engine-mcp -- npx -y x402engine-mcpInstall x402engine MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"x402engine-mcp": {
"command": "npx",
"args": [
"-y",
"x402engine-mcp"
],
"env": {
"X402_DEV_BYPASS": "<YOUR_X402_DEV_BYPASS>",
"X402_PAYMENT_HEADER": "<YOUR_X402_PAYMENT_HEADER>"
}
}
}
}Install x402engine MCP in VS Code
.vscode/mcp.json
{
"servers": {
"x402engine-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"x402engine-mcp"
],
"env": {
"X402_DEV_BYPASS": "<YOUR_X402_DEV_BYPASS>",
"X402_PAYMENT_HEADER": "<YOUR_X402_PAYMENT_HEADER>"
}
}
}
}Install x402engine MCP in VS Code CLI
$ code --add-mcp '{"name":"x402engine-mcp","type":"stdio","command":"npx","args":["-y","x402engine-mcp"],"env":{"X402_DEV_BYPASS":"<YOUR_X402_DEV_BYPASS>","X402_PAYMENT_HEADER":"<YOUR_X402_PAYMENT_HEADER>"}}'Install x402engine MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"x402engine-mcp": {
"command": "npx",
"args": [
"-y",
"x402engine-mcp"
],
"env": {
"X402_DEV_BYPASS": "<YOUR_X402_DEV_BYPASS>",
"X402_PAYMENT_HEADER": "<YOUR_X402_PAYMENT_HEADER>"
}
}
}
}Install x402engine MCP in Codex
$ codex mcp add x402engine-mcp --env 'X402_DEV_BYPASS=<YOUR_X402_DEV_BYPASS>' --env 'X402_PAYMENT_HEADER=<YOUR_X402_PAYMENT_HEADER>' -- npx -y x402engine-mcpInstall x402engine MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.x402engine-mcp] command = "npx" args = ["-y", "x402engine-mcp"] [mcp_servers.x402engine-mcp.env] X402_DEV_BYPASS = "<YOUR_X402_DEV_BYPASS>" X402_PAYMENT_HEADER = "<YOUR_X402_PAYMENT_HEADER>"
Install x402engine MCP in Gemini CLI
$ gemini mcp add -s user -e 'X402_DEV_BYPASS=<YOUR_X402_DEV_BYPASS>' -e 'X402_PAYMENT_HEADER=<YOUR_X402_PAYMENT_HEADER>' x402engine-mcp npx -- -y x402engine-mcpInstall x402engine MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"x402engine-mcp": {
"command": "npx",
"args": [
"-y",
"x402engine-mcp"
],
"env": {
"X402_DEV_BYPASS": "<YOUR_X402_DEV_BYPASS>",
"X402_PAYMENT_HEADER": "<YOUR_X402_PAYMENT_HEADER>"
}
}
}
}Configuration
X402_DEV_BYPASSSecretDev bypass secret to skip payments during testing
X402_PAYMENT_HEADERSecretPre-signed x402 payment header for automatic payment
X402_BASE_URLGateway URL (default: https://x402engine.app)
X402_EVM_PRIVATE_KEYX402_MAX_PAYMENT_USDX402_PAYMENT_NETWORKX402_SOLANA_PRIVATE_KEY
| Name | Description | |
|---|---|---|
| X402_DEV_BYPASS | Dev bypass secret to skip payments during testing | Secret |
| X402_PAYMENT_HEADER | Pre-signed x402 payment header for automatic payment | Secret |
| X402_BASE_URL | Gateway URL (default: https://x402engine.app) | |
| X402_EVM_PRIVATE_KEY | — | |
| X402_MAX_PAYMENT_USD | — | |
| X402_PAYMENT_NETWORK | — | |
| X402_SOLANA_PRIVATE_KEY | — |
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work · What to fix for more points
- Source repository linked and reachableagentc22/x402engine-mcp is public and reachablegithub.com/agentc22/x402engine-mcp ↗Pass
- Package names this repository as its sourcex402engine-mcp names agentc22/x402engine-mcp as sourcenpmjs.com/package/x402engine-mcp ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-10-11github.com/agentc22/x402engine-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from x402engine-mcpPass
- No critical advisory in the package or its dependencies99 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubx402engine-mcp
Agent-friendly MCP server for x402engine. It lets agents discover and call pay-per-request APIs through HTTP 402, with automatic USDC payment on Base or Solana.
The live gateway covers LLMs, image and video generation, web search and scraping, code execution, crypto and wallet data, transaction simulation, audio, travel, and IPFS. This MCP exposes a curated tool set and live discovery for the full catalog.
Quick Start
Use a dedicated, low-balance payer wallet. The MCP signs x402 payments locally and never sends the private key to x402engine.
Base
{
"mcpServers": {
"x402engine": {
"command": "npx",
"args": ["-y", "x402engine-mcp@1.1.1"],
"env": {
"X402_EVM_PRIVATE_KEY": "0xYOUR_DEDICATED_PAYER_KEY",
"X402_PAYMENT_NETWORK": "base",
"X402_MAX_PAYMENT_USD": "1.00"
}
}
}
}
Fund the wallet with USDC on Base. The x402 facilitator pays transaction gas; the wallet signs an EIP-3009 USDC authorization.
Solana
{
"mcpServers": {
"x402engine": {
"command": "npx",
"args": ["-y", "x402engine-mcp@1.1.1"],
"env": {
"X402_SOLANA_PRIVATE_KEY": "YOUR_BASE58_OR_JSON_PRIVATE_KEY",
"X402_PAYMENT_NETWORK": "solana",
"X402_MAX_PAYMENT_USD": "1.00"
}
}
}
}
Fund the wallet with USDC on Solana and enough SOL for transaction fees.
Discovery Without a Wallet
The server starts without a wallet, and free tools such as discover_services and service_health still work. Paid tools return their x402 payment requirements until a wallet is configured.
claude mcp add x402engine -- npx -y x402engine-mcp@1.1.1
Hermes Agent
Install the x402engine skill and merge this server into the active Hermes profile's config.yaml:
mcp_servers:
x402engine:
command: npx
args: ["-y", "x402engine-mcp@1.1.1"]
env:
X402_BASE_URL: "https://x402engine.app"
X402_PAYMENT_NETWORK: "auto"
X402_MAX_PAYMENT_USD: "0.10"
Start a new session and call discover_services or service_health; both are free. Keep the network on auto until a wallet is configured. For Base payments, store X402_EVM_PRIVATE_KEY in the profile's local .env, add X402_EVM_PRIVATE_KEY: "${X402_EVM_PRIVATE_KEY}" to the server's env, and change the network to base. Never put wallet keys in chat. The cap applies per request; authorize a separate total budget for each task.
Full Hermes setup guide · Installable skill
Payment Controls
| Variable | Default | Description |
|---|---|---|
X402_EVM_PRIVATE_KEY |
unset | Dedicated payer key for Base USDC |
X402_SOLANA_PRIVATE_KEY |
unset | Base58 or JSON payer key for Solana USDC |
X402_PAYMENT_NETWORK |
auto |
auto, base, or solana |
X402_MAX_PAYMENT_USD |
1.00 |
Hard per-request spending limit |
X402_BASE_URL |
production gateway | Override the gateway URL |
X402_PAYMENT_HEADER |
unset | Legacy pre-signed x402 header |
X402_DEV_BYPASS |
unset | Development bypass secret |
In auto mode, Base is preferred when both keys are configured. Automatic payment only accepts the canonical USDC contracts on Base and Solana. It rejects unknown assets, unsupported networks, and amounts above the configured cap before signing.
MegaETH remains available to clients that supply their own compatible payment header.
MCP Tools
| Category | Tools |
|---|---|
| Discovery | discover_services, service_health |
| Image and code | generate_image, execute_code |
| Audio | transcribe_audio |
| Crypto | get_crypto_price, get_crypto_markets, get_crypto_history, get_trending_crypto, search_crypto, get_crypto_categories |
| Wallet and token | get_wallet_balances, get_wallet_transactions, get_wallet_pnl, get_token_prices, get_token_metadata |
| IPFS | pin_to_ipfs, get_from_ipfs |
| Travel | search_flights, search_locations, search_hotels, search_cheapest_dates |
Prices are included in each tool description and in live discovery. The gateway catalog can change independently of this package.
Discovery
- Gateway discovery: /.well-known/x402.json
- Agent card: /.well-known/agent.json
- Endpoint manifest: /.well-known/agent-manifest.v1.json
- Services API: /api/services
- Package metadata: server.json
Development
npm install
npm test
npm run build
Links
- Website: x402engine.app
- npm: x402engine-mcp
- GitHub: agentc22/x402engine-mcp
- Protocol: x402.org
x402engine MCP questions
How do I add x402engine MCP to Claude Code?
Run claude mcp add --env 'X402_DEV_BYPASS=<YOUR_X402_DEV_BYPASS>' --env 'X402_PAYMENT_HEADER=<YOUR_X402_PAYMENT_HEADER>' x402engine-mcp -- npx -y x402engine-mcp in your terminal. Add --scope user to make it available in every project.
How do I add x402engine MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How does the server handle payments?
The MCP signs x402 payments locally using a dedicated payer wallet, ensuring private keys are never sent to the x402engine service.
Can I use the server without a wallet?
Yes, you can use the server without a wallet to access free tools like service discovery and health checks, though paid tools will require a wallet configuration.
What networks are supported for payments?
The server supports automatic USDC payments on the Base and Solana networks.
Is there a way to limit spending?
Yes, you can set a hard per-request spending limit using the X402_MAX_PAYMENT_USD environment variable.