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)
- Get your API key at https://algochains.ai.
- Download the extension: algochains-library-mcp.mcpb.
- 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.
- 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:
build_algorithm(name, ...)launches the backtest in the background (Backtrader is slow — long or multi-symbol runs take minutes) and returns quickly withstate:"done"or"running".make_backtest_dashboard(name)waits for the run if needed, then renders a matplotlib PNG inline plusartifact_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, andbuild_algorithmexecute 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, StocksAAPL, CryptoBTC-USD. - Multiple symbols:
research_queryandbuild_algorithmaccept a list of symbols as well as a single string. Multi-symbol backtests use the('symbols', [])param andself.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).
Metadata
Release files for algochains-library-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| algochains_library_mcp-0.2.0.tar.gz | 418.0 kB | Without provenance | Details for algochains_library_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| algochains_library_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for algochains_library_mcp-0.2.0-py3-none-any.whl |
Total release size: 839.4 kB
Release files / algochains_library_mcp-0.2.0.tar.gz
| Download URL | algochains_library_mcp-0.2.0.tar.gz |
|---|---|
| Size | 418.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02fd601d319eae53f18a68de881f4889b3d079cdc8767f6bf9452e850363c8fe
|
|
BLAKE2b-256 checksum How to use checksums |
5c905eb5ec47f81caf988463a2d0b0e094719670a6c123e5b2ccfb278a1e61e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / algochains_library_mcp-0.2.0-py3-none-any.whl
| Download URL | algochains_library_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 421.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
572f3fcec5b26a3e6887094ab9a35f5f041f44a5887fa86f2dadf85360252549
|
|
BLAKE2b-256 checksum How to use checksums |
f65082e1c15cc30d557e08cce96c462f51d97bb814f89cc8e988f5b98765656c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for algochains-library-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.