Skip to content

Cursor IDE Integration

Cursor IDE supports the Model Context Protocol (MCP), enabling direct integration with Aleatoric’s synthetic market data engine. This guide walks you through configuring Cursor to use Aleatoric for backtesting crypto trading strategies.

Before you begin, ensure you have:

  1. Open Cursor IDE
  2. Go to Settings (Cmd/Ctrl + ,)
  3. Navigate to Features > MCP Servers
  4. Click Add new MCP server

Add the following configuration to your Cursor MCP settings:

{
"mcpServers": {
"aleatoric": {
"url": "https://mcp.aleatoric.systems/mcp",
"headers": {
"X-API-Key": "ak_live_your-api-key-here"
}
}
}
}

Alternatively, configure via environment variable:

{
"mcpServers": {
"aleatoric": {
"url": "https://mcp.aleatoric.systems/mcp",
"headers": {
"X-API-Key": "${ALEATORIC_API_KEY}"
}
}
}
}

After saving, Cursor will connect to the Aleatoric MCP server. You should see “aleatoric” listed as an active MCP server in your settings panel.

Example Workflow: Backtesting a Crypto Trading Bot

Section titled “Example Workflow: Backtesting a Crypto Trading Bot”

With Aleatoric integrated into Cursor, you can leverage Claude to generate deterministic market scenarios and backtest your trading strategies directly in your development environment.

Ask Claude in Cursor to generate specific market conditions for your backtests:

Prompt Example 1 — Flash Crash Scenario:

Generate a 30-minute BTC flash crash scenario using Aleatoric with:
- Initial price: $45,000
- 25% drawdown in first 10 minutes
- Recovery to -15% by end
- High volatility order book with thin liquidity
- Seed: 12345 for reproducibility

Prompt Example 2 — Funding Rate Arbitrage:

Create a HyperLiquid SOL-PERP funding regime simulation with:
- Spot price oscillating around $150
- Positive funding bias (longs pay shorts)
- 24 funding periods
- Include order book depth at each interval

Prompt Example 3 — Liquidation Cascade:

Simulate a liquidation cascade scenario for my ETH perpetual bot:
- Start at $3,200, cascade trigger at $2,800
- Bursty sell-side flow with 40% burst probability
- Generate L2 book snapshots every 100ms
- Output as Parquet for backtesting

Once you have market data, use these prompts to backtest your strategies:

Prompt Example 4 — Strategy Validation:

Using the generated Parquet file, backtest my grid trading strategy:
1. Load the market data artifact
2. Apply 0.5% grid spacing
3. Calculate PnL accounting for fees
4. Report max drawdown and Sharpe ratio

Prompt Example 5 — Deterministic Replay:

Replay the same market scenario (seed 12345) but with modified strategy params:
- Reduce position size by 50%
- Tighten stop-loss from 5% to 3%
Compare results with the previous run.

The Aleatoric MCP server exposes the following tools to Claude in Cursor:

ToolDescription
generate_market_scenarioCreate deterministic market data with custom volatility, trends, and microstructure parameters
stream_orderbookReal-time L2 order book simulation via SSE
generate_batchGenerate Parquet artifacts for offline backtesting
ToolDescription
simulate_funding_regimeModel perpetual funding rates for HyperLiquid, Binance, OKX, Bybit, CME, SGX
get_venue_configRetrieve venue-specific parameters (tick size, lot size, fee tiers)
normalize_eventsCanonicalize market events from different exchange formats
ToolDescription
list_presetsAvailable preset configurations (e.g., hyperliquid_perp_sol, binance_btc_spot)
validate_configValidate simulation manifest and compute provenance hash
get_schemaJSON Schema for SimulationManifest
ToolDescription
list_cachesView cached simulation artifacts
replay_cacheSSE replay of previously generated scenarios
export_cacheDownload cached Parquet files
  1. Use consistent seeds — Always specify a seed value for reproducible backtests
  2. Start with presets — Use list_presets to find pre-configured scenarios before customizing
  3. Validate before running — Use validate_config to catch configuration errors early
  4. Cache expensive simulations — Enable caching for long-running scenarios to avoid regeneration
  5. Monitor usage — Check your usage at /v1/usage/current to stay within plan limits

If Cursor cannot connect to Aleatoric:

  1. Verify your API key is correct and has mcp scope
  2. Check network connectivity to https://mcp.aleatoric.systems
  3. Ensure no firewall is blocking outbound HTTPS

If you receive rate limit errors:

  • Default limit: 120 requests/minute
  • Consider upgrading your plan for higher limits
  • Use caching to reduce redundant requests