# x402engine-mcp [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/agentc22/x402engine-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 581  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/x402engine-mcp

## Description
Pay-per-call AI APIs for agents via HTTP 402 crypto micropayments (USDC/USDm)

## Tools
Capabilities this server exposes over MCP:

- **discover_services** — List all available x402 Engine APIs with pricing, endpoints, and payment networks. Call this first to understand what's available.
- **service_health** — Get live health metrics for all x402engine services — latency (p50/p95/p99), error rates, request volume, and status. Free, no payment required. Call this before choosing which service to use.
- **generate_image** — Generate an image from a text prompt. Three quality tiers: 'fast' ($0.015, FLUX Schnell), 'quality' ($0.05, FLUX.2 Pro), 'text' ($0.12, Ideogram v3 for images with text). Returns image URL.
- **execute_code** — Execute code in a secure sandboxed environment (E2B). Supports Python, JavaScript, Bash, and R. $0.005 per execution.
- **transcribe_audio** — Transcribe audio to text using Deepgram Nova-3. Accepts a public URL to an audio file. $0.10 per transcription.
- **get_crypto_price** — Get current prices for cryptocurrencies. $0.001 per request.
- **get_crypto_markets** — Get top cryptocurrencies by market cap with detailed market data. $0.002 per request.
- **get_crypto_history** — Get historical price data for a cryptocurrency. $0.003 per request.
- **get_trending_crypto** — Get trending cryptocurrencies. $0.001 per request.
- **search_crypto** — Search for a cryptocurrency by name or symbol. $0.001 per request.
- **get_crypto_categories** — List CoinGecko category IDs for sector discovery and downstream market filters. $0.001 per request.
- **get_wallet_balances** — Get token balances for a wallet address on any supported chain. $0.005 per request.
- **get_wallet_transactions** — Get transaction history for a wallet address. $0.005 per request.
- **get_wallet_pnl** — Get profit and loss analysis for a wallet's token trades. $0.01 per request.
- **get_token_prices** — Get DEX-derived prices for tokens by contract address. $0.005 per request.
- **get_token_metadata** — Get metadata for a token (name, symbol, decimals, etc.). $0.002 per request.
- **pin_to_ipfs** — Pin JSON data to IPFS via Pinata. Returns the IPFS CID. $0.01 per pin.
- **get_from_ipfs** — Retrieve content from IPFS by CID. $0.001 per request.
- **search_flights** — Search flight offers by route, dates, and passengers. Returns pricing, itineraries, and airlines. $0.01 per request.
- **search_locations** — Search for airports and cities by keyword. Returns IATA codes, names, and coordinates. $0.005 per request.
- **search_hotels** — Search hotel offers by city and dates. Returns room details, pricing, and availability. $0.01 per request.
- **search_cheapest_dates** — Find the cheapest travel dates for a route. Returns date/price pairs sorted by price. $0.01 per request.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "x402engine-mcp": {
    "command": "npx",
    "args": ["-y","x402engine-mcp"],
    "env": {
      "X402_EVM_PRIVATE_KEY": "",
      "X402_SOLANA_PRIVATE_KEY": "",
      "X402_PAYMENT_NETWORK": "",
      "X402_MAX_PAYMENT_USD": "",
      "X402_BASE_URL": "",
      "X402_PAYMENT_HEADER": "",
      "X402_DEV_BYPASS": ""
    }
  }
}
```

**Requires environment variables:** `X402_EVM_PRIVATE_KEY`, `X402_SOLANA_PRIVATE_KEY`, `X402_PAYMENT_NETWORK`, `X402_MAX_PAYMENT_USD`, `X402_BASE_URL`, `X402_PAYMENT_HEADER`, `X402_DEV_BYPASS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What x402engine-mcp does

The x402engine-mcp MCP server gives MCP-compatible agents access to selected services in the x402engine gateway. Its tools cover service discovery and health checks, image generation, code execution, audio transcription, cryptocurrency data, wallet and token information, IPFS operations, and travel searches. The gateway also advertises a broader catalog that can change independently of the npm package.

The server is useful when an agent needs to call APIs that charge per request rather than use a single subscription or static credential. Prices are available in tool descriptions and live discovery responses. Free discovery functions can be used without configuring a wallet, while paid calls expose their payment requirements until a payer is available.

## How it works

The x402engine-mcp MCP server communicates with the x402engine gateway using the HTTP 402 payment flow. When a paid endpoint requires payment, the server evaluates the request against its configured payment settings and, when supported, signs the USDC authorization locally. The private key is not sent to x402engine.

Automatic payment supports canonical USDC on Base and Solana. Base is preferred when the payment network is set to `auto` and both wallet types are configured. Requests are rejected before signing if they use an unknown asset, an unsupported network, or an amount above the configured limit. Clients that provide their own compatible payment header can also use MegaETH, but it is not part of the automatic wallet flow described here.

## Setup and configuration

Run the server through `npx`, using the package name and a pinned version if desired. A Base setup requires `X402_EVM_PRIVATE_KEY`, a Base payment network setting, and a wallet funded with USDC on Base. A Solana setup uses `X402_SOLANA_PRIVATE_KEY`, selects Solana, and requires USDC plus enough SOL for transaction fees. The README recommends a dedicated wallet with a low balance.

`X402_MAX_PAYMENT_USD` sets the hard per-request spending limit and defaults to 1.00. `X402_BASE_URL` can replace the production gateway URL. `X402_PAYMENT_HEADER` provides a legacy pre-signed x402 header, while `X402_DEV_BYPASS` is available for development bypasses. With no wallet configured, the process can still start and serve free discovery tools.

## Tools and capabilities

The exposed tool groups include:

- Discovery: `discover_services` and `service_health`
- Image and code: `generate_image` and `execute_code`
- Audio: `transcribe_audio`
- Crypto: price, market, history, trending, search, and category tools
- Wallet and token: balances, transactions, PnL, prices, and metadata
- IPFS: `pin_to_ipfs` and `get_from_ipfs`
- Travel: flight, location, hotel, and cheapest-date searches

The x402engine-mcp MCP server also publishes gateway discovery documents and a services API, allowing agents or clients to inspect the current catalog rather than relying only on the bundled tool list.

_Full upstream README: https://allmcps.com/mcp/x402engine-mcp/readme_

