Skip to main content
Claude Code is Anthropic’s CLI for agentic coding. Adding Horizon as an MCP server gives Claude direct access to your trading engine - check positions, place orders, search markets, and manage risk through natural language.

Setup

1

Install Horizon with MCP support

2

Set environment variables

3

Register the MCP server

This tells Claude Code to launch the Horizon MCP server as a subprocess using stdio transport.
4

Verify

You should see horizon in the list of registered servers.

Usage

Once registered, just talk to Claude naturally. It will automatically use the Horizon tools when relevant.

Check your portfolio

Claude calls engine_status and list_positions, then summarizes:

Search for markets

Claude calls discover_markets(exchange="polymarket", query="bitcoin"):

Size a trade with Kelly

Claude calls kelly_sizing(prob=0.65, price=0.50, bankroll=2000.0):

Place an order

Claude calls submit_order(market_id="will-btc-hit-100k", side="buy", price=0.50, size=150.0):

Emergency stop

Claude calls activate_kill_switch(reason="user requested emergency stop"):

Tips

  • Paper mode by default: If you don’t set HORIZON_EXCHANGE, the engine runs in paper mode. Safe for experimentation.
  • Persistent engine: The MCP server maintains a singleton engine for the entire session. Positions and orders persist across tool calls.
  • Multiple markets: You can work with multiple markets in the same session. The engine tracks positions independently per market.
  • Context resources: Claude can read horizon://status and horizon://positions as background context for richer responses.

Removing