Cursor, Windsurf, and VS Code all support MCP servers. Adding Horizon gives the AI assistant access to your trading engine directly from your editor.
Cursor
Install
pip install horizon-sdk[mcp]
# or
uv pip install horizon-sdk[mcp]
Configure
Open Cursor Settings > MCP Servers and add:{
"horizon": {
"command": "python",
"args": ["-m", "horizon.mcp"],
"env": {
"HORIZON_API_KEY": "your-key",
"HORIZON_EXCHANGE": "paper"
}
}
}
Or create/edit .cursor/mcp.json in your project root:{
"mcpServers": {
"horizon": {
"command": "python",
"args": ["-m", "horizon.mcp"],
"env": {
"HORIZON_API_KEY": "your-key",
"HORIZON_EXCHANGE": "paper"
}
}
}
}
Use
In Cursor’s AI chat, ask about positions, markets, or orders. The assistant will use Horizon tools automatically.
Windsurf
Install
pip install horizon-sdk[mcp]
# or
uv pip install horizon-sdk[mcp]
Configure
Create or edit ~/.codeium/windsurf/mcp_config.json:{
"mcpServers": {
"horizon": {
"command": "python",
"args": ["-m", "horizon.mcp"],
"env": {
"HORIZON_API_KEY": "your-key",
"HORIZON_EXCHANGE": "paper"
}
}
}
}
Use
Windsurf’s Cascade will discover the Horizon tools and use them when you ask about trading.
VS Code (Copilot)
Install
pip install horizon-sdk[mcp]
# or
uv pip install horizon-sdk[mcp]
Configure
Create .vscode/mcp.json in your workspace:{
"servers": {
"horizon": {
"type": "stdio",
"command": "python",
"args": ["-m", "horizon.mcp"],
"env": {
"HORIZON_API_KEY": "your-key",
"HORIZON_EXCHANGE": "paper"
}
}
}
}
Use
In the Copilot chat panel, switch to Agent mode. Copilot will discover the Horizon MCP tools.
Live Trading
To switch from paper to a live exchange, update the env block:
{
"env": {
"HORIZON_API_KEY": "your-key",
"HORIZON_EXCHANGE": "polymarket",
"POLYMARKET_API_KEY": "...",
"POLYMARKET_API_SECRET": "...",
"POLYMARKET_API_PASSPHRASE": "...",
"POLYMARKET_PRIVATE_KEY": "0x..."
}
}
Never commit API keys to version control. Use environment variables or a secrets manager.
HTTP Transport
For clients that support HTTP-based MCP (streamable HTTP), use:
{
"horizon": {
"command": "python",
"args": ["-m", "horizon.mcp", "--http"]
}
}
This starts the server on the default HTTP port instead of stdio.