Use SwapHunt in your AI agent

Give your agent crypto market context: Hyperliquid prices, market regime, volatility, funding, coin strength, dip and FOMO checks, and the Fear & Greed Index. The swaphunt-mcp MCP server runs on your machine and pays per call in USDC on Base with x402, from a wallet you control and with a spending cap.

Updated . Prices per call are on API docs and pricing.

Step 1: start with a dry run

The server runs with uv's uvx, which downloads swaphunt-mcp from PyPI into its own environment. There is nothing to clone or install by hand.

uvx swaphunt-mcp --version
uvx swaphunt-mcp --check   # compares every tool's price with the live 402 response; pays nothing

Without X402_PAY=1, every tool is a dry run: it reports the price and the address it would pay, and returns no data. Nothing is signed or paid. Set up your client below without the payment settings first, ask a question, and check that the agent finds the tools and their prices.

Step 2: a wallet, a spending cap and a payee allowlist

Use a dedicated wallet with a few dollars of USDC on Base mainnet, never your main wallet. Store its key in a file only you can read, so it never sits in an MCP client's config file:

install -m 600 /dev/null ~/.swaphunt-wallet.key
nano ~/.swaphunt-wallet.key        # paste the private key, save
  • X402_PAY=1 turns payments on.
  • PRIVATE_KEY_FILE is the path to the key file.
  • MAX_SPEND_USD caps what one server process can spend (default $0.10). Calls beyond it are refused, not paid.
  • PAYTO_ALLOWLIST lists the addresses the server may pay. A quote that asks for any other address is refused before anything is signed. SwapHunt's address on Base is 0xD6b585DD2F48263D08FB75EA28c1598d845d23a8; a dry run shows the same address in pay_to. Supported from swaphunt-mcp 0.5.0.

Every tool description states its price, and the free get_spending tool shows what the session has spent.

Claude Code

Dry run:

claude mcp add swaphunt -- uvx swaphunt-mcp

With payments (remove the dry-run server first with claude mcp remove swaphunt):

claude mcp add swaphunt \
  --env X402_PAY=1 \
  --env PRIVATE_KEY_FILE=$HOME/.swaphunt-wallet.key \
  --env MAX_SPEND_USD=0.25 \
  --env PAYTO_ALLOWLIST=0xD6b585DD2F48263D08FB75EA28c1598d845d23a8 \
  -- uvx swaphunt-mcp

Check the connection with /mcp inside Claude Code.

Claude Desktop

Add this to claude_desktop_config.json (Settings, Developer, Edit Config) and restart Claude Desktop. For a dry run, leave out env:

{
  "mcpServers": {
    "swaphunt": {
      "command": "uvx",
      "args": [
        "swaphunt-mcp"
      ]
    }
  }
}

With payments:

{
  "mcpServers": {
    "swaphunt": {
      "command": "uvx",
      "args": [
        "swaphunt-mcp"
      ],
      "env": {
        "X402_PAY": "1",
        "PRIVATE_KEY_FILE": "/home/you/.swaphunt-wallet.key",
        "MAX_SPEND_USD": "0.25",
        "PAYTO_ALLOWLIST": "0xD6b585DD2F48263D08FB75EA28c1598d845d23a8"
      }
    }
  }
}

Replace /home/you with your home directory. If Claude Desktop cannot find uvx, use its full path (which uvx on macOS and Linux, where uvx on Windows). On Windows, write the key path as C:\Users\you\.swaphunt-wallet.key.

Cursor, Devin Desktop (Windsurf) and VS Code

Cursor: add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project, then restart Cursor.

{
  "mcpServers": {
    "swaphunt": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "swaphunt-mcp"
      ],
      "env": {
        "X402_PAY": "1",
        "PRIVATE_KEY_FILE": "/home/you/.swaphunt-wallet.key",
        "MAX_SPEND_USD": "0.25",
        "PAYTO_ALLOWLIST": "0xD6b585DD2F48263D08FB75EA28c1598d845d23a8"
      }
    }
  }
}

Devin Desktop (Windsurf): open the MCP config file from Cascade's MCP settings ("Open MCP config file"; in stable Windsurf builds it is ~/.codeium/windsurf/mcp_config.json) and add:

{
  "mcpServers": {
    "swaphunt": {
      "command": "uvx",
      "args": [
        "swaphunt-mcp"
      ],
      "env": {
        "X402_PAY": "1",
        "PRIVATE_KEY_FILE": "/home/you/.swaphunt-wallet.key",
        "MAX_SPEND_USD": "0.25",
        "PAYTO_ALLOWLIST": "0xD6b585DD2F48263D08FB75EA28c1598d845d23a8"
      }
    }
  }
}

VS Code: add this to .vscode/mcp.json in your workspace, then start the server from the file.

{
  "servers": {
    "swaphunt": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "swaphunt-mcp"
      ],
      "env": {
        "X402_PAY": "1",
        "PRIVATE_KEY_FILE": "/home/you/.swaphunt-wallet.key",
        "MAX_SPEND_USD": "0.25",
        "PAYTO_ALLOWLIST": "0xD6b585DD2F48263D08FB75EA28c1598d845d23a8"
      }
    }
  }
}

As for Claude Desktop: leave out env for a dry run, and replace /home/you with your home directory. Keep these files out of version control if they name your key file.

claude.ai and ChatGPT

There is no hosted SwapHunt MCP server, so claude.ai and ChatGPT connectors cannot use swaphunt-mcp, which runs on your own machine. From there, use the REST API with x402 below, or use Claude Code, Claude Desktop or an editor above.

Other agents: REST and x402

Any agent that can send HTTP requests and pay with x402 can call the API at https://x402.swaphunt.dev directly. There is no account and no API key: an unpaid request returns 402 Payment Required with the price, and an x402 client signs a USDC payment and repeats the request. You can pay on Base, Polygon, Arbitrum or Solana, at the same price on each.

# A request without payment gets 402 Payment Required with the price in the
# payment-required header (base64 JSON). An x402 client pays and retries.
curl -i "https://x402.swaphunt.dev/v1/sanity/is-this-a-dip?symbol=ETH"

Your own x402 client should check the price and the receiving address in the 402 before it pays, the same way swaphunt-mcp does.

Example

Prompt:

ETH dropped today. Is it a real dip or just noise, and is it oversold?

This is a dry-run reply, not a paid result: without X402_PAY=1, each tool call returns the price and no data.

{"dry_run": true, "would_cost_usd": 0.003, "network": "eip155:8453",
 "pay_to": "0xD6b585DD2F48263D08FB75EA28c1598d845d23a8",
 "note": "Dry run, nothing paid and no data. The user can set X402_PAY=1 to enable payments."}

With payments on, the agent gets the endpoint's JSON (every result names its source) plus what the call cost, what is left of the session budget and a link to the transaction.

Good to know

  • Coin-level analysis covers the top 50 Hyperliquid perpetuals by 30-day volume. Other coins get not_covered before any payment is asked, so nothing is charged.
  • Each payment is locked to the amount, asset, network and receiving address of the 402 the server just received. With PAYTO_ALLOWLIST set, that address must also be on your list.
  • Fear & Greed results include an attribution field; the tool descriptions tell the agent to show it with the value.
  • Nothing returned is investment advice. Source and security notes: swaphunt-mcp on GitHub.

FAQ

Does the MCP server spend money without asking?
No. Without X402_PAY=1 every tool is a dry run that reports the price and returns no data. With payments on, MAX_SPEND_USD caps what one server process can spend (default $0.10), and a tool refuses to pay more than the price in its description.
Which wallet should I use?
A dedicated wallet with a few dollars of USDC on Base, never your main wallet. Keep the key in a file only you can read and point PRIVATE_KEY_FILE at it, so the key is not in the MCP client's config file.
Can I use SwapHunt from claude.ai or ChatGPT?
Not through MCP: there is no hosted SwapHunt MCP server, and swaphunt-mcp runs on your own machine. An agent that can send HTTP requests and pay with x402 can call the REST API directly.
Do I need MCP at all?
No. Any agent that can send HTTP requests can call the x402 API. The OpenAPI document lists every endpoint, parameter and response, and each unpaid request returns its price.