Optopsy
Rust-based rewrite of Optopsy: An options backtesting engine exposed via Model Context Protocol (MCP)
What is Optopsy?
Optopsy is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to rust-based rewrite of optopsy: an options backtesting engine exposed via model context protocol (mcp)
Rust-based rewrite of Optopsy: An options backtesting engine exposed via Model Context Protocol (MCP)
This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Rust-based rewrite of Optopsy: An options backtesting engine
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx optopsyConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Optopsy
Optopsy MCP is a high-performance options and stock backtesting engine written in Rust, exposed as a self-hosted MCP server over HTTP. It supports 32 built-in options strategies—iron condors, butterflies, verticals, calendars, diagonals, covered calls, and more—along with signal-driven stock backtesting on OHLCV data, a Rhai scripting engine for custom strategies, grid and Bayesian parameter sweeps, walk-forward analysis, Monte Carlo simulation, and HMM-based regime detection. Quantitative analysts and algorithmic traders can use this server to let Claude generate, run, and interpret backtests through natural language without writing code.
Prerequisites
- Rust toolchain (cargo) installed for building from source
- Historical options chain and/or OHLCV data in Parquet format placed in ~/.optopsy/cache/
- An MCP-compatible client that supports HTTP/StreamableHTTP transport
- Optional: Docker if you prefer a containerized deployment
Clone and build the server
Clone the repository and compile the release binary with cargo. The build produces a fast native binary with no runtime dependencies.
git clone https://github.com/goldspanlabs/optopsy-mcp.git
cd optopsy-mcp
cargo build --releasePlace your market data files
Copy your Parquet options chain and OHLCV data files into the default cache directory. Any Parquet file matching the expected schema is picked up automatically.
mkdir -p ~/.optopsy/cache
cp /path/to/your/data/*.parquet ~/.optopsy/cache/Start the MCP server
Run the server specifying a port. It starts a StreamableHTTP MCP server at /mcp on the given port.
PORT=8000 cargo run --release
# Custom data directory
DATA_ROOT=/your/custom/cache PORT=8000 cargo run --releaseConfigure your MCP client
Point your MCP client at the running HTTP endpoint. The server exposes tools including backtest, scripting_guide, aggregate_prices, distribution, correlate, rolling_metric, regime_detect, generate_hypotheses, drawdown_analysis, monte_carlo, factor_attribution, portfolio_optimize, cointegration_test, and benchmark_analysis.
Write and run a custom strategy
Ask Claude to generate a Rhai strategy script or use one of the 32 built-in option strategy templates. The scripting_guide tool returns the full Rhai API reference.
Optopsy Examples
Client configuration
Configure an MCP client to connect to the optopsy-mcp HTTP server running locally on port 8000.
{
"mcpServers": {
"optopsy": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Prompts to try
Example prompts for backtesting options strategies, running analysis, and optimizing parameters.
- "Backtest an iron condor on SPY with $100k capital, 30-delta wings, and a 50% stop loss"
- "Sweep DTE and delta for short puts on SPY — find the best risk-adjusted setup"
- "Write a strategy that sells puts on SPY when VIX > 20 and RSI < 30 with a 50% stop loss"
- "Run walk-forward analysis on this strategy with 4 windows to check if it holds up over time"
- "Show SPY's average return by day of week and test for statistical significance"Troubleshooting Optopsy
The server starts but backtest returns 'no data found' for a symbol
Verify your Parquet files are in ~/.optopsy/cache/ (or in the DATA_ROOT directory if overridden) and that they conform to the expected schema. Check the file names and that the symbol column in the data matches the symbol you are passing to the backtest tool.
cargo build --release fails with compilation errors
Ensure you have the latest stable Rust toolchain installed. Run 'rustup update stable' to update. The project is under active development so pin to a specific release tag for stability: 'git checkout <tag>' before building.
Rhai strategy script errors during backtest execution
Call the scripting_guide tool first to retrieve the full Rhai API reference including the BarContext object properties and available helper functions. Rhai scripts are sandboxed with no file or network access, so ensure all data is accessed through the ctx object.
Frequently Asked Questions about Optopsy
What is Optopsy?
Optopsy is a Model Context Protocol (MCP) server that rust-based rewrite of optopsy: an options backtesting engine exposed via model context protocol (mcp) It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Optopsy?
Follow the installation instructions on the Optopsy GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Optopsy?
Optopsy works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Optopsy free to use?
Yes, Optopsy is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Optopsy Alternatives — Similar Finance & Fintech Servers
Looking for alternatives to Optopsy? Here are other popular finance & fintech servers you can use with Claude, Cursor, and VS Code.
ValueCell
★ 10.7kValueCell is a community-driven, multi-agent platform for financial applications.
Vibe Trading
★ 8.1k'Vibe-Trading: Your Personal Trading Agent'
Quantdinger
★ 6.2kAI quantitative trading platform for crypto, stocks, and forex with backtesting, live trading, market data, and multi-agent research.vibe-trading ,trading-agents,ai-trader,ai-trading
TradingView
★ 2.8kReal-time crypto & stock screening, advanced technical indicators, Bollinger Bands intelligence, candlestick patterns + native Claude Desktop integration. Multi-exchange (Binance, KuCoin, Bybit+). Open-source AI trading infrastructure.
Financial Datasets
★ 2.1kProvides access to comprehensive financial data including income statements, balance sheets, cash flow statements, stock prices, company news, SEC filings, and cryptocurrency information with built-in financial ratio analysis.
Stripe
★ 1.6kThe Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
Browse More Finance & Fintech MCP Servers
Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Optopsy in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Optopsy?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.