MCP Server Documentation
Everything you need to connect your AI assistant to Volrix backtesting tools via the Model Context Protocol.
What is the Volrix MCP Server?
The Volrix MCP server gives AI assistants (Claude, ChatGPT, Cursor, and other MCP-compatible clients) direct access to Indian derivatives backtesting infrastructure. Through natural language, users can:
- Write and validate Python trading strategies
- Run backtests on NIFTY, BANKNIFTY, SENSEX, and MCX commodities
- Fetch performance metrics, trades, and equity curves
- Compare multiple strategy variants side-by-side
- Explore historical market data availability
- Access built-in strategy documentation and patterns
Setup
Prerequisites
- A Volrix account (sign up at volrix.ai)
- An active subscription plan
- An MCP-compatible AI client (Claude Desktop, ChatGPT, Cursor, Claude Code, etc.)
Claude Desktop / Claude Code
Add the following to your MCP configuration file:
{
"mcpServers": {
"volrix": {
"url": "https://mcp.volrix.ai/sse"
}
}
}On first connection, you will be prompted to authenticate with your Volrix account via OAuth.
ChatGPT
Volrix is available as a connector in the ChatGPT plugin/connector store. Search for "Volrix" and enable it. Authentication happens automatically via OAuth when you first use a Volrix tool.
Other MCP Clients
Any client that supports the MCP specification can connect using the SSE transport:
Server URL: https://mcp.volrix.ai/sse
Transport: SSE (Server-Sent Events)
Auth: OAuth 2.0 (initiated on first connection)Available Tools
The MCP server exposes the following tools to your AI assistant:
Strategy Development
validate_code
Validate Python strategy code against framework rules before submitting. Returns actionable diagnostics.
run_backtest
Submit validated strategy code for backtesting with specified symbol, date range, timeframe, and parameters.
stop_backtest
Cancel a queued or currently running backtest.
Results & Metrics
metrics
Get performance metrics (Sharpe, returns, drawdown, win rate) for a completed backtest.
trades
Retrieve the trade log for a completed backtest run.
mtm
Retrieve mark-to-market (intraday PnL) data for a completed run.
compare_backtests
Compare multiple completed runs side-by-side with correlation analysis.
Data & Status
available_duration
Check the available historical data date range for a symbol and segment.
data
Fetch historical candle data for a symbol over a date range.
day_data
Get single-day spot, futures, expiry, and option chain data.
strategy_status
Check the lifecycle status of a submitted backtest run.
active_backtests
See how many backtests are currently queued or running.
user_plan_info
Check your plan, quota, rate limits, and parallel run capacity.
Analysis Mode
analysis
Retrieve analysis payload (movements and points) from an analysis-mode run.
movement_analysis
Get time-series movement rows recorded by an analysis run.
movement_metrics
Compute statistical metrics from saved movement analysis data.
point_analysis
Get discrete point rows recorded by an analysis run.
point_metrics
Compute statistical summaries from saved point analysis data.
Documentation
list_skills
List all available strategy documentation topics.
get_skill
Read a specific strategy documentation topic (API reference, patterns, indicators, etc.).
Supported Markets
Index F&O (NSE/BSE)
| Symbol | Lot Size | Expiries |
|---|---|---|
| NIFTY | 65 | Weekly + Monthly |
| BANKNIFTY | 30 | Monthly only |
| SENSEX | 20 | Weekly + Monthly |
Commodities (MCX)
| Symbol | Lot Size |
|---|---|
| GOLD / GOLDM | 100 / 10 |
| SILVER / SILVERM | 30 / 5 |
| CRUDEOIL / CRUDEOILM | 100 / 10 |
| NATURALGAS / NATGASMINI | 1250 / 250 |
Example Prompts
Strategy Development
"Write a short straddle strategy that sells ATM NIFTY options at 9:20 AM with a 30% stop loss and exits at 3:15 PM. Validate it and run from Jan to Mar 2025."
Performance Analysis
"Give me the Sharpe ratio, max drawdown, and win rate for my last backtest. How does it compare to the straddle-v1 run?"
Market Research
"What date range is available for BANKNIFTY? Show me the spot data for budget day 2025 - what was the high-low range?"
Troubleshooting
Authentication fails or token expired
Disconnect and reconnect the Volrix MCP server in your client settings. This re-initiates the OAuth flow and refreshes your token.
Backtest stuck in "queued" state
Check your active backtest count with active_backtests. Free plans have a limit on parallel runs. Wait for a current run to finish, or cancel one with stop_backtest.
Validation errors in strategy code
The validate_code tool returns specific diagnostics. Common issues: import statements in code (not allowed), module-level variables, using qty instead of lots, or non-lambda data inputs to indicators. Ask your AI assistant to fix the listed diagnostics.
No data available for requested date range
Use available_duration to check what historical data exists for your symbol. The requested start/end dates must fall within the available window.
Connection issues with SSE transport
Ensure your client supports SSE (Server-Sent Events) transport. If behind a corporate proxy, SSE connections may be blocked. Try connecting from a different network.
Rate Limits & Quotas
Limits depend on your subscription plan. Use the user_plan_info tool to check your current quotas at any time.
- Parallel backtests are capped per plan tier
- Total monthly backtest submissions are quota-limited
- API rate limiting applies across all MCP tool calls
- Historical data access window varies by plan
Support
If you encounter issues not covered above:
- Email: hello@volrix.ai
- Telegram: t.me/pythonalgodiscussion
- Twitter: @VolrixAI