Claude Code Integration

Set up Quantish MCP servers in Claude Code (Anthropic's CLI) for AI-powered prediction market trading.

Prerequisites

  • Claude Code CLI - Install with npm install -g @anthropic-ai/claude-code
  • API Key - Generate from the Get Started page

Step 1: Generate Your API Key

  1. Go to the Get API Key page
  2. Select your server type:
    • Discovery - Search markets across platforms (no access code needed)
    • Kalshi - Trade on Kalshi via Solana/DFlow (no access code needed)
    • Polymarket - Trade on Polymarket (requires access code)
  3. Enter your email and click "Generate API Key"
  4. Copy the generated API key

Important: Save your API key immediately. It's only shown once and cannot be retrieved later.

Step 2: Configure MCP in Claude Code

Config File Location

Claude Code uses a settings file at:

🍎

macOS / Linux

~/.claude/settings.json
🪟

Windows

%USERPROFILE%\.claude\settings.json

Add Your MCP Configuration

Create or edit the settings.json file:

{
  "mcpServers": {
    "quantish-discovery": {
      "type": "url",
      "url": "https://quantish.live/mcp",
      "headers": {
        "X-API-Key": "YOUR_DISCOVERY_API_KEY"
      }
    },
    "quantish": {
      "type": "url",
      "url": "https://quantish-sdk-production.up.railway.app/mcp",
      "headers": {
        "x-api-key": "YOUR_POLYMARKET_API_KEY"
      }
    },
    "quantish-kalshi": {
      "type": "url",
      "url": "https://kalshi-mcp-production-7c2c.up.railway.app/mcp",
      "headers": {
        "x-api-key": "YOUR_KALSHI_API_KEY"
      }
    }
  }
}

Key Difference from Cursor: Claude Code requires "type": "url" for HTTP-based MCP servers. Server names use hyphens (e.g., quantish-kalshi) instead of underscores.

Quick Setup Commands

You can also create the config from terminal:

# Create the .claude directory

mkdir -p ~/.claude

# Create settings.json (replace YOUR_KEY)

cat > ~/.claude/settings.json << 'EOF'

{ "mcpServers": { "quantish-discovery": { "type": "url", "url": "https://quantish.live/mcp", "headers": { "X-API-Key": "YOUR_KEY" } } } }

EOF

Step 3: Start Claude Code

After saving your config, start Claude Code:

claude

Claude Code will automatically load MCP servers from your settings file. You should see the servers listed when Claude starts.

Step 4: Verify Connection

Test that everything is working:

# Try these commands in Claude Code:

"Search for Bitcoin prediction markets"

"Get trending markets on Kalshi"

"What's my Polymarket wallet balance?"

If Claude responds with market data, your MCP is configured correctly!

Troubleshooting

"type": "url" is required

Claude Code requires "type": "url" for HTTP-based MCP servers. This is different from Cursor which infers the type automatically.

MCP server not connecting

  • Check that your API key is correct (no extra spaces or quotes)
  • Verify the URL is exactly as shown (including /mcp at the end)
  • Ensure your internet connection is working

JSON syntax errors

  • Use a JSON validator to check your settings.json
  • Make sure all strings are in double quotes
  • Check for trailing commas (not allowed in JSON)

Example Trading Session

You:

"Search for Super Bowl prediction markets on Kalshi"

Claude:

I found several Super Bowl markets. Here are the most active ones...

You:

"Get live data for the Chiefs vs Eagles market"

Claude:

The current prices are: Chiefs YES: $0.45, Eagles YES: $0.55...

You:

"Buy $50 of Chiefs YES tokens"

Claude:

Order executed! Bought 111 YES tokens at $0.45. Transaction: 5xK7...

Next Steps