Skip to main content

AlgoChains Library MCP

Ask market-research and trading-strategy questions in plain English, and let Claude pull data with AlgoChains, backtest strategies, and return interactive charts inline — built for Claude Desktop via the Model Context Protocol.

No coding required: describe the strategy, get a full backtest dashboard back in the chat.

Install (easiest — one click)

  1. Get your API key at https://algochains.ai.
  2. Download the extension: algochains-library-mcp.mcpb.
  3. Double-click the downloaded file (or in Claude Desktop: Settings → Extensions → Install extension… and pick it). Claude Desktop shows an install dialog — paste your API key into the AlgoChains API Key field and confirm.
  4. Fully quit Claude Desktop (Cmd+Q on macOS / quit from the system tray on Windows — closing the window is not enough) and reopen it.

The first launch downloads the Python environment (a few hundred MB) — it can take several minutes and Claude Desktop may report the server disconnected once; it recovers on the next launch. The AlgoChains tools then appear under the tools icon in the chat box.

Example asks

Research:

"Pick a heavily traded crypto coin and show me when it actually trades — busiest hours of the day in 30-minute bins over the last 3 months. Shade the London, China, and Brazil market opens so I can see what each one does to volume compared to NYSE."

Build & backtest:

"Backtest an opening range breakout on SPY for me, the range is the first 10 minutes of the New York session, give it a loose 2.5% trailing stop, and get me out by noon ET no matter what. Run it over the past 2 months."

Forecast:

"Where could Intel be trading 10 days from now? Give me the SDE forecast."

Forecast, anchored in the past (the dashboard overlays what the price actually did):

"Forecast INTC 10 days out as of June 15, 2026 using SDE describing geometric Brownian motion — then show me how the price actually played out against it."

What it does

Kind Name What it does
resource algochains://agents-guide The library's AGENTS.md — API, symbols, resolutions, examples (plus the server's determinism rules).
tool research_query Historical OHLCV for one symbol or a list — a quick look (wraps algochains.research_query).
tool forecast SDE (GBM) Monte Carlo price forecast in one call — quantile fan, return distribution vs Student-t fit, terminal prices; PNG inline + interactive artifact.
tool run_python Run Python in a temp dir; any matplotlib figure is returned inline (themed).
tool build_report Run analysis cells in a temp dir; charts inline + report as markdown text.
tool build_algorithm Write a bt.Strategy and backtest it in the background; keeps the CSVs in a per-name temp dir (no plotting).
tool make_backtest_dashboard Render the run (waits if it's still running): fast matplotlib PNG inline + a React+Recharts interactive artifact.
tool send_signal Propagate a live trade signal (requires SIGNAL_SECRET; off by default).

Claude reads the resource to ground itself in the library, then uses the tools to answer.

Backtesting is two steps, mirroring research → build_report:

  1. build_algorithm(name, ...) launches the backtest in the background (Backtrader is slow — long or multi-symbol runs take minutes) and returns quickly with state:"done" or "running".
  2. make_backtest_dashboard(name) waits for the run if needed, then renders a matplotlib PNG inline plus artifact_jsx — a React+Recharts component Claude drops into an artifact for an interactive dashboard (candlestick equity, drawdown, rolling Sharpe, per-trade P&L, round trips).

Forecasting is one call: forecast(symbol, days, ...) runs the whole standardized pipeline inside the library — history → moment estimation (μ, σ, skew, kurtosis, Student-t fit) → GBM Monte Carlo — and returns the forecast dashboard (quantile fan, return distribution, terminal prices) inline plus the interactive artifact. Forecasts are reproducible: the same seed gives identical paths, and every answer quotes the methodology line (SDE: GBM · MC paths · seed). Ask for a forecast as of a past date and the dashboard overlays what the price actually did over the forecast window — instant hindcast validation.

What's written to disk (and why)

Almost nothing, and nothing hidden. Research code and backtests run in throwaway temp folders that clean themselves up — a backtest's raw CSVs stick around for ~12 hours in case you want to inspect them, then they're deleted automatically.

The one thing that's kept: every completed backtest leaves you a receipt. Three small files land in ~/Downloads/AlgoChains/comparisons/<run-name>/ (or ~/Desktop/… if you have no Downloads folder):

  • strategy.py — the exact code that ran. Not a description of your strategy, the literal script that produced the numbers you're looking at.
  • round_trips.csv — every trade it made: entries, exits, P&L.
  • dashboard.png — the dashboard image itself, so the picture of the results survives along with the numbers. (not including the trades at the bottom for now, soon to come)

Here's why that matters. A chat scrolls away, but a trading result you might act on shouldn't. When Claude tells you a strategy returned +12%, these files are your proof of what returned +12% — so next week you can reread the logic, diff two variants of a strategy to see exactly what changed, or hand the script to someone else to reproduce your result. Without them, "the backtest I ran last Tuesday" would be a memory; with them it's a folder. And because the dashboard is saved too, you can simply ask Claude "show me the dashboard for <run-name> again" in any later chat — even after the run's working data has long been cleaned up.

Nothing else is saved, the files are a few KB per run, re-running a name simply overwrites its folder, and deleting any of it is always safe. The folder won't bloat either: only the 20 most recent runs are kept — older ones are pruned automatically, except any folder you've added your own files to, which is left alone. (Power users can move the location with ALGOCHAINS_LIBRARY_MCP_COMPARISONS_DIR or change the cap with ALGOCHAINS_LIBRARY_MCP_COMPARISONS_KEEP; 0 keeps everything.)

run_python, build_report, and build_algorithm execute model-written Python locally on your machine — that's how Desktop (no code execution of its own) does the analysis. Only connect this server in an environment you trust.

Notes

  • Symbol formats: Forex EUR-USD, Stocks AAPL, Crypto BTC-USD.
  • Multiple symbols: research_query and build_algorithm accept a list of symbols as well as a single string. Multi-symbol backtests use the ('symbols', []) param and self.datas[i] (see the agents-guide "Multi-asset" section); the equity curve is the true combined portfolio value.
  • Resolutions: 1m, 5m, 15m, 30m, 1h, 4h, 1d. Databases: Forex, Stocks, Crypto.
  • Charts use a shared matplotlib/mplfinance theme; the interactive dashboard is React+Recharts (Plotly and other CDN-loaded libraries fail in Desktop's artifact sandbox — Recharts is bundled).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algochains_library_mcp-0.2.0.tar.gz (418.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algochains_library_mcp-0.2.0-py3-none-any.whl (421.5 kB view details)

Uploaded Python 3

File details

Details for the file algochains_library_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: algochains_library_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 418.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for algochains_library_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 02fd601d319eae53f18a68de881f4889b3d079cdc8767f6bf9452e850363c8fe
MD5 9bdd340871cf14651d6d9c11f57f12c7
BLAKE2b-256 5c905eb5ec47f81caf988463a2d0b0e094719670a6c123e5b2ccfb278a1e61e9

See more details on using hashes here.

File details

Details for the file algochains_library_mcp-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for algochains_library_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 572f3fcec5b26a3e6887094ab9a35f5f041f44a5887fa86f2dadf85360252549
MD5 3172f3a5ff61c4a7da30c6134cb9cc20
BLAKE2b-256 f65082e1c15cc30d557e08cce96c462f51d97bb814f89cc8e988f5b98765656c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page