mcp-server

v0.1.24
@houdiniswap/mcp-server Checked 1 day ago Published 6 days ago

HoudiniSwap MCP server — connect AI agents to 14 CEXes and 20+ DEXes via Model Context Protocol

MCP server for HoudiniSwap — crypto swap aggregation across 14 CEXes and 20+ DEXes, paid per call in USDC on Base or Solana via x402. No signup, no API key. Every tool costs money. GET /status is the only free endpoint and it is not exposed as a tool, so without a funded wallet every call returns 402. Fund an EVM wallet with a couple of dollars of USDC on Base — no ETH needed, payments are gasless EIP-3009 authorisations settled by the facilitator. Or fund a Solana wallet with USDC on Solana and set HOUDINI_X402_SVM_PRIVATE_KEY — no SOL needed, the facilitator pays the network fee.

Summary extracted from the README.

@houdiniswap/mcp-server

MCP server for HoudiniSwap — crypto swap aggregation across 14 CEXes and 20+ DEXes, paid per call in USDC on Base or Solana via x402. No signup, no API key.

npx -y @houdiniswap/mcp-server

A funded wallet is required

Every tool costs money. GET /status is the only free endpoint and it is not exposed as a tool, so without a funded wallet every call returns 402. Fund an EVM wallet with a couple of dollars of USDC on Base — no ETH needed, payments are gasless EIP-3009 authorisations settled by the facilitator. Or fund a Solana wallet with USDC on Solana and set HOUDINI_X402_SVM_PRIVATE_KEY — no SOL needed, the facilitator pays the network fee.

Use a wallet funded with only what you intend to spend. The private key is stored on the machine running the server and signs payments automatically.

Each paid tool result ends with a line naming the amount, the network, the paying wallet and an explorer link to the transaction, and the network that refused first if the other key had to pay.

Claude Code

/plugin marketplace add HoudiniSwap/houdiniswap-agent
/plugin install houdiniswap@houdiniswap

That installs the swap skill and wires up this server. Or, MCP server only:

# Pay with USDC on Base:
claude mcp add houdiniswap --env HOUDINI_X402_PRIVATE_KEY=0x... -- npx -y @houdiniswap/mcp-server
# Pay with USDC on Solana:
claude mcp add houdiniswap --env HOUDINI_X402_SVM_PRIVATE_KEY=<base58 key> -- npx -y @houdiniswap/mcp-server
# Both: pass both --env flags, plus --env HOUDINI_X402_NETWORK=solana to pay on Solana first

Claude Desktop / Cursor

{
  "mcpServers": {
    "houdiniswap": {
      "command": "npx",
      "args": ["-y", "@houdiniswap/mcp-server"],
      "env": {
        "HOUDINI_X402_PRIVATE_KEY": "0xYOUR_EVM_PRIVATE_KEY",
        "HOUDINI_X402_SVM_PRIVATE_KEY": "YOUR_SOLANA_PRIVATE_KEY"
      }
    }
  }
}

Keep the key line for each wallet you pay from and delete the other; HOUDINI_X402_NETWORK (below) picks the network paid on first when both are set.

The -y matters: without it npx prompts on stdin, which for a stdio MCP server is the JSON-RPC channel, and the server never starts.

Tools

getTokens · getChains · getSwapProviders · getMinMax · getQuote · createExchange · getOrder · getOrders · dexApprove · dexCheckAllowance · dexConfirmTx · dexChainSignatures · dexSignRequest · cexDepositRequest · dexSignStatus · swap

dexSignRequest serves a page on 127.0.0.1 and hands the swap to the user's own browser wallet, so no private key is ever pasted into anything. EVM only. It signs the swap, not the approval, which happens before an order exists. cexDepositRequest serves the same page for a CEX order's deposit, with network, address and amount prefilled, so the address is never copied by hand onto the wrong chain. Both are disabled when the HTTP transport is bound off-loopback, since a page on the server's host is no use to a remote caller.

Reads cost $0.0001, quotes $0.001, createExchange and dexConfirmTx $0.01 each. A standard swap runs about $0.012; a DEX swap about $0.022, because it pays the exchange tier twice.

Responses are shaped for agents: descriptions, icons and URL templates are stripped, and getQuote keeps the best few per type while reporting how many it omitted. Pass verbose: true to any tool for the raw response — pair it with a small pageSize, since a full raw page can exceed a client's tool-result limit.

Environment

Variable Description
HOUDINI_X402_PRIVATE_KEY EVM key for x402 payments in USDC on Base. Accepted with or without the 0x prefix.
HOUDINI_X402_SVM_PRIVATE_KEY Solana secret key for x402 payments in USDC on Solana: the base58 string Phantom or Solflare export.
HOUDINI_X402_NETWORK With both x402 keys, the network paid on first: base (default) or solana. A payment refused there is retried on the other.
HOUDINI_X402_PAY_TO_BASE / HOUDINI_X402_PAY_TO_SOLANA Comma-separated recipients x402 pays on that network. Default: HoudiniSwap's production addresses. Set them only for another HoudiniSwap environment.
HOUDINI_X402_BUDGET_USDC Most the server signs in x402 payments while it runs, in USDC. Default 10.
HOUDINI_API_KEY Partner API key (id:secret), if you have one. Takes precedence.
HOUDINI_PARTNER_ID Public partner ID.
HOUDINI_API_URL API base URL. Defaults to the production partner API.
PORT / HOUDINI_HTTP_HOST HTTP transport only. Binds 127.0.0.1:8080 by default.
HOUDINI_HTTP_ALLOWED_HOSTS HTTP transport only. Extra comma-separated host names /mcp answers to, for a proxy that forwards another name.

None is strictly required — the server starts without any of them, but every tool then returns 402.

Notes

  • Paid calls are spaced ~5 seconds apart. The facilitator settles each payment on-chain and two at once from the same wallet fail, so the client serialises them. A full swap takes 20-30s; that is expected, not a hang. Individual payments time out after 60s.
  • A payment ceiling is enforced client-side. The signer only accepts USDC on Base or Solana (for the keys you set), paid to HoudiniSwap's addresses, up to $0.10 per call and $10 per run (HOUDINI_X402_BUDGET_USDC), so a misconfigured or hostile endpoint cannot drain the wallet. The $10 lasts until the server restarts; in HTTP mode one budget is shared by every caller. Every signed payment counts, so with an empty Base wallet and a funded Solana one each call signs twice (refused on Base, then paid on Solana) and the $10 covers about $5 of calls.
  • HTTP mode binds loopback only and has no authentication. Put an authenticating proxy in front of it before exposing it. /mcp answers only to the loopback names and HOUDINI_HTTP_HOST (plus HOUDINI_HTTP_ALLOWED_HOSTS); a request addressed to any other host name gets a 403.

MIT · Source