Optopsy

v1.0.0Finance & Fintechstable

Rust-based rewrite of Optopsy: An options backtesting engine exposed via Model Context Protocol (MCP)

ai-agentsai-assistantai-backtestingai-toolsai-trading
Share:
13
Stars
0
Downloads
0
Weekly
0/5

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

Backtest options trading strategies with AI-assisted analysis.
Evaluate trading algorithms and generate performance reports.
goldspanlabs

Maintainer

LicenseMIT
Languagerust
Versionv1.0.0
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx optopsy

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 --release
2

Place 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/
3

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 --release
4

Configure 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.

5

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.

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.

Quick Config Preview

{ "mcpServers": { "optopsy": { "command": "npx", "args": ["-y", "optopsy"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides