Skip to main content
The Horizon MCP server exposes 26 tools and 2 context resources via the Model Context Protocol. Any MCP-compatible client can connect and trade prediction markets, equities, options, and crypto through natural language. Tools are organized into 14 individual tools for common trading operations and 12 compound tools (including equity for stocks/options data) that group related capabilities via an action parameter. This keeps the tool list small enough for LLMs to load efficiently while preserving all 241+ capabilities.

Installation

This installs the mcp package alongside Horizon. The server is available as both a module and a console script:

Architecture

The server lazily initializes a singleton Engine on the first tool call. Configuration comes from environment variables - no config files needed. The MCP server (horizon.mcp_server) delegates to horizon.tools which manages a singleton Engine backed by the Rust core.

Compound Tool Pattern

Most tools beyond the core 14 use an action-dispatch pattern:
The action parameter selects the operation, and params is a JSON string with action-specific arguments. Each compound tool’s description lists all available actions.

Individual Tools (14)

Portfolio & Status

engine_status

Get the engine’s current state.

list_positions

Returns all open positions.

list_open_orders

Parameters: market_id (optional) - filter by market.

list_recent_fills

Parameters: limit (default: 20) - number of fills to return.

portfolio_metrics

Get portfolio metrics: total value, PnL, exposure, diversification, concentration. No parameters.

Trading

submit_order

Place a limit order on the engine’s configured exchange. Returns the order ID on success, or {"error": "..."} on failure.

cancel_order

Parameters: order_id - the ID to cancel.

cancel_all_orders

Cancels all open orders across all exchanges. Returns {"canceled_count": N}.

Risk Management

activate_kill_switch

Parameters: reason - why you’re activating it.
This is an emergency stop. It immediately cancels all open orders across all exchanges. Use only in emergencies.

Market Data

get_feed_snapshot

Parameters: name - feed name (as configured in the engine).

Discovery

discover_markets

Search for markets on an exchange.

get_market_detail

Get detailed information for a specific market including price history, orderbook, recent trades, and top holders.

top_markets

Get the highest-volume active markets.

Sizing

kelly_sizing

Compute Kelly-optimal position size.

Compound Tools (12)

feed

Feed management and data. 7 actions: list_feeds, start, metrics, all_metrics, health, parity, discover_events.

order_management

Advanced order operations. 5 actions: cancel_market, add_stop_loss, add_take_profit, list_contingent, deactivate_kill_switch.

wallet

Polymarket wallet analytics (public, no auth). 11 actions: trades, market_trades, positions, value, profile, top_holders, market_flow, profile_wallet [PRO], track [ULTRA], consensus [ULTRA], scan_signals [ULTRA].

analytics

Quantitative analytics toolkit. 84 actions across categories: statistics, signals, portfolio, AFML (bars/labels/frac_diff), microstructure, state estimation, causality, execution, copula, portfolio optimization, hedging, pricing, bootstrap, risk/regime, and more.
See the tool description for the full list of 84 actions and their parameters.

scanning

Market scanning, signals, and execution. 11 actions: sentinel_report [ULTRA], oracle_forecast [ULTRA], oracle_edges [ULTRA], whale_galaxy [ULTRA], llm_forecast, llm_scan, analyze_resolution, sniper_scan, execute_arbitrage, stealth_estimate [ULTRA], stealth_execute [ULTRA].

unusual_whales

Unusual Whales market intelligence. 36 actions across: flow (options_flow, stock_flow, dark_pool, market_tide, spike), Congress/insider (congress_trades, congress_trader, insider_trades), stock data (stock_info, stock_state, earnings, earnings_schedule, seasonality), options analytics (greek_exposure, greek_exposure_by_strike, greek_exposure_by_expiry, iv_rank, vol_term_structure, max_pain, option_chains), short interest (short_interest, short_volume, ftd), screeners (screener_stocks, screener_options), ETF (etf_holdings, etf_flow), institutions (institutions, institution_holdings, institution_ownership), calendars (economic_calendar, fda_calendar), other (news, prediction_whales, prediction_unusual, crypto_whales).

market_data

Market data from Massive (Polygon.io). 24 actions across: price data (aggregates, snapshot, last_trade, last_quote, previous_close, grouped_daily), movers (gainers_losers, crypto_gainers_losers), reference (ticker_details, search_tickers, market_status, market_holidays), technical indicators (sma, ema, rsi, macd), options (options_chain, options_contracts), other (news, dividends, splits, crypto_snapshot, forex_conversion, forex_snapshot).

cloud

Horizon Cloud deployment and management. 12 actions: list_strategies, get_strategy, create_strategy, validate, list_credentials, save_credentials, deploy, stop, status, metrics, logs, account.

marketplace

Horizon strategy marketplace. 18 actions across: browse (browse, get_listing, leaderboard), publish (publish, my_listings, listing_earnings), subscribe (subscribe, unsubscribe, my_subscriptions, signals), purchase (purchase, my_purchases), payments (connect_payments, payment_status), verification (verify_performance, listing_badges, verify_trader, verification_status).

fund

Multi-strategy fund management (requires HORIZON_FUND_MODE=1). 16 actions across: status (status, report, risk_dashboard, stress_test), strategies (deploy_strategy, stop_strategy, pause_strategy, resume_strategy, list_strategies, scale_strategy), analytics (nav_history, pnl_attribution, correlation_matrix, execution_report), memory (memory_query, memory_record).

account

Horizon account and credentials. 3 actions: setup, login, key_status.

equity

Equity and options market data. 6 actions: quote, search, options_chain, greeks, iv_surface, screener. Uses Unusual Whales as the data source.

Resources

The server exposes two MCP resources for context injection: Clients can attach these as context when starting a conversation.

Error Handling

Every tool returns {"error": "..."} on failure instead of crashing the server. Common errors:

Testing

Verify the server starts and responds to the MCP initialize handshake:
You should see a JSON-RPC response with the server’s capabilities and 26 tools.