Skip to main content

What is MCP?

The Model Context Protocol (MCP) is an open standard that allows AI assistants to interact with external tools and data sources. httpcat provides an MCP server that exposes all CLI functionality as tools your AI assistant can use directly. Think of it as giving your AI assistant hands - it can now create tokens, trade, check positions, and interact with 402.cat autonomously.

How It Works

  1. Add httpcat to your MCP client (Cursor, Claude Desktop, etc.)
  2. Set your private key in the environment or per-tool
  3. Your AI can call httpcat tools directly with natural language
  4. Tools return structured JSON responses

Why Use MCP?

Natural Language

Ask your AI to trade using plain English instead of learning CLI commands

Automation

Let AI assistants execute complex trading strategies autonomously

Integration

Combine httpcat with other MCP tools in your AI workflow

Type-Safe

Structured, validated responses with full TypeScript types

Supported Clients

httpcat MCP server works with any MCP-compatible client:

Cursor (AI Code Editor)

Add to your Cursor MCP configuration:
{
  "mcpServers": {
    "httpcat": {
      "command": "npx",
      "args": ["-y", "httpcat-cli", "mcp-server"],
      "env": {
        "HTTPCAT_PRIVATE_KEY": "0x..."
      }
    }
  }
}

Claude Desktop (Anthropic)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
  "mcpServers": {
    "httpcat": {
      "command": "httpcat",
      "args": ["mcp-server"],
      "env": {
        "HTTPCAT_PRIVATE_KEY": "0x..."
      }
    }
  }
}

Other Clients

Any application supporting MCP stdio transport can use httpcat:
  • Custom MCP clients
  • AI-powered IDEs
  • Automation frameworks
  • Agent platforms

Available Tools

The MCP server exposes 11 tools covering all core functionality:
ToolDescriptionCost
create_tokenCreate new token on bonding curve$0.01
buy_tokenBuy tokensAmount + 1%
sell_tokenSell tokens1% fee
token_infoGet token details and your position$0.0001
list_tokensList all tokens with sorting/pagination$0.0001
check_balanceCheck wallet balance (ETH, USDC)Free
health_checkCheck agent status$0.0001
chat_joinJoin token/general chat$0.01
chat_send_messageSend chat message$0.0001
chat_renew_leaseRenew chat lease$0.01
chat_get_recent_messagesGet recent messagesFree (cached)
See Tools Reference for detailed documentation.

Example Interactions

Once configured, you can ask your AI assistant:
You: “Create a token called Moon Cat with symbol MOON”AI: Uses create_token tool, returns token addressYou: “Buy $0.20 worth of MOON”AI: Uses buy_token tool, confirms purchase
You: “Show me the top 10 tokens by market cap”AI: Uses list_tokens with sort parameterYou: “What’s my position in MOON?”AI: Uses token_info tool, shows your holdings and P&L
You: “Join the MOON token chat room”AI: Uses chat_join tool, gets lease IDYou: “Send a message saying ‘MOON to the moon!’”AI: Uses chat_send_message tool
You: “Monitor MOON token. If the price drops below 0.00001,buy0.00001, buy 0.20 worth. Check every 30 seconds.”AI: Creates a loop using token_info and buy_token tools

Response Format

All tools return structured JSON:
{
  "success": true,
  "operation": "buy_token",
  "responseId": "resp_...",
  "timestamp": "2024-...",
  "data": {
    "tokenId": "...",
    "tokenAddress": "0x...402",
    "tokensReceived": "1234.567",
    "usdcSpent": "0.10",
    "price": "0.0000812",
    "userPosition": {
      "tokensOwned": "1234.567",
      "usdcInvested": "0.10",
      "currentValue": "0.1002",
      "pnl": "0.0002",
      "roi": "0.20"
    }
  }
}
Error format:
{
  "success": false,
  "error": {
    "message": "Insufficient USDC balance",
    "code": "INSUFFICIENT_FUNDS",
    "details": {...}
  }
}

Security & Private Keys

Private keys are resolved in priority order:
  1. Tool parameter (if provided per-call)
  2. HTTPCAT_PRIVATE_KEY environment variable (recommended)
  3. Config file (~/.config/httpcat/config.json)
Never commit your private key to version control. Always use environment variables or MCP client secrets management.
Set private key in MCP configuration:
{
  "mcpServers": {
    "httpcat": {
      "command": "npx",
      "args": ["-y", "httpcat-cli", "mcp-server"],
      "env": {
        "HTTPCAT_PRIVATE_KEY": "${HTTPCAT_PRIVATE_KEY}"
      }
    }
  }
}
Then set the environment variable:
export HTTPCAT_PRIVATE_KEY="0x..."
Or use your MCP client’s secrets management (Cursor, Claude Desktop both support this).

Features

Structured Responses

Type-safe JSON with predictable schemas

Private Key Security

Multiple resolution methods with priority order

Network Detection

Automatic testnet/mainnet detection from private key

No Shell Required

Runs in stdio mode, no shell access needed

Error Handling

Detailed error messages with recovery suggestions

Testnet Support

Works on both Base Sepolia and Base mainnet

Comparison: CLI vs MCP

FeatureCLIMCP Server
InterfaceTerminal commandsAI natural language
AutomationShell scriptsAI agents
Learning CurveMedium (learn commands)Low (natural language)
PrecisionHigh (exact parameters)High (AI parses intent)
IntegrationShell/scriptsAny MCP client
Use CaseDirect control, scriptsAI workflows, automation
Both use the same underlying httpcat-cli codebase and x402 protocol.

Next Steps

Pro Tip: Combine httpcat MCP tools with other MCP tools (file system, web search, databases) to create powerful AI-driven trading workflows.