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.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- Cursor IDE installed (cursor.com)
- Aleatoric API Key — Get yours here
- Python 3.9+ (for local development workflows)
Step-by-Step Setup
Section titled “Step-by-Step Setup”1. Configure MCP in Cursor Settings
Section titled “1. Configure MCP in Cursor Settings”- Open Cursor IDE
- Go to Settings (Cmd/Ctrl + ,)
- Navigate to Features > MCP Servers
- Click Add new MCP server
2. Add Aleatoric Server Configuration
Section titled “2. Add Aleatoric Server Configuration”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}" } } }}3. Verify Connection
Section titled “3. Verify Connection”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.
Generating Market Scenarios
Section titled “Generating Market Scenarios”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 reproducibilityPrompt 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 intervalPrompt 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 backtestingBacktesting Prompts
Section titled “Backtesting Prompts”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 artifact2. Apply 0.5% grid spacing3. Calculate PnL accounting for fees4. Report max drawdown and Sharpe ratioPrompt 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.Available MCP Tools
Section titled “Available MCP Tools”The Aleatoric MCP server exposes the following tools to Claude in Cursor:
Market Data Generation
Section titled “Market Data Generation”| Tool | Description |
|---|---|
generate_market_scenario | Create deterministic market data with custom volatility, trends, and microstructure parameters |
stream_orderbook | Real-time L2 order book simulation via SSE |
generate_batch | Generate Parquet artifacts for offline backtesting |
Venue Simulation
Section titled “Venue Simulation”| Tool | Description |
|---|---|
simulate_funding_regime | Model perpetual funding rates for HyperLiquid, Binance, OKX, Bybit, CME, SGX |
get_venue_config | Retrieve venue-specific parameters (tick size, lot size, fee tiers) |
normalize_events | Canonicalize market events from different exchange formats |
Configuration & Validation
Section titled “Configuration & Validation”| Tool | Description |
|---|---|
list_presets | Available preset configurations (e.g., hyperliquid_perp_sol, binance_btc_spot) |
validate_config | Validate simulation manifest and compute provenance hash |
get_schema | JSON Schema for SimulationManifest |
Cache Management
Section titled “Cache Management”| Tool | Description |
|---|---|
list_caches | View cached simulation artifacts |
replay_cache | SSE replay of previously generated scenarios |
export_cache | Download cached Parquet files |
Best Practices
Section titled “Best Practices”- Use consistent seeds — Always specify a
seedvalue for reproducible backtests - Start with presets — Use
list_presetsto find pre-configured scenarios before customizing - Validate before running — Use
validate_configto catch configuration errors early - Cache expensive simulations — Enable caching for long-running scenarios to avoid regeneration
- Monitor usage — Check your usage at
/v1/usage/currentto stay within plan limits
Troubleshooting
Section titled “Troubleshooting”Connection Issues
Section titled “Connection Issues”If Cursor cannot connect to Aleatoric:
- Verify your API key is correct and has
mcpscope - Check network connectivity to
https://mcp.aleatoric.systems - Ensure no firewall is blocking outbound HTTPS
Rate Limiting
Section titled “Rate Limiting”If you receive rate limit errors:
- Default limit: 120 requests/minute
- Consider upgrading your plan for higher limits
- Use caching to reduce redundant requests
Next Steps
Section titled “Next Steps”- Explore the full API Reference for detailed endpoint documentation
- Review Protocol Integration for advanced deployment patterns
- Check Architecture for system design details