Labsco
MCP SERVER

Chart Library

by grahammccain

Give an agent the historical analogs of a stock chart pattern — the cohort, its forward returns, and what separated the winners.

Equity & Fund Market Data
Summary
The empirical record, not a prediction your agent invented.

What it replaces is the sentence "on average this pattern returns X%" that a model will happily produce from nothing. Here the answer is a cohort of real analogs with a full return distribution and a published calibration record — citable, and refusable when the cohort is weak.

What it is

A retrieval engine over historical chart patterns rather than a forecaster. Ask what a symbol's chart on a given date and timeframe looked like historically, and you get the cohort of analogs, the full distribution of what they did next, and the features that separated the best outcomes from the rest — with the coverage record attached.

What you get
  • `search` — the entry point, finding similar historical patterns for an anchor and returning a handle you can chain; `mode=` supports `text`, `live_bars` for raw OHLCV, and `similar` for cohort-level neighbours
  • `pull_comps` — the flagship: the comp set for a symbol, date and timeframe, with what the analogs did next, the drivers that separated the best outcomes, and the coverage record. `cohort_analyze` is the same engine under the original field names, kept callable for existing integrations
  • `cohort_introspect` — slice a stored comp set by any macro, technical or event attribute and get per-subset statistics against the full-cohort baseline, without re-running the search
  • `cohort_attribution` — which member traits separated the forward-return tail from the rest, each with a bootstrap confidence interval and a false-discovery decision; descriptive, never causal
  • `cohort_members`, `cohort_groupby` and `cohort_rerank` — the full cohort handed back one record per analog, partitioned by a dimension you name, or reordered by a weighted composite of fields you specify
  • `track_record` — the historical predicted-against-realized coverage of the calibrated bands: the nominal 80% band held 80.8% across 302,880 prior cases
  • `symbol_intelligence` — per-symbol feature reliability and achieved calibration across prior analyses
  • `analyze`, `context`, `explain`, `portfolio` and `report_feedback` — analytic metrics, situational data, narrative and rankings, multi-holding weighted distributions, and a feedback path
Requirements

`pip install chartlibrary-mcp` and an API key in `CHART_LIBRARY_API_KEY`; `claude mcp add chart-library -- chartlibrary-mcp` registers it, and there is a one-click bundle for Claude Desktop plus config snippets for Cursor, VS Code and Copilot. The Sandbox tier is free at 200 calls a day, with paid tiers at 5,000 and 50,000. The remote server, the pip package and the REST API expose the same tool names, so a client can move between them. The core loop is search, then pull comps, then introspect — chain them by handle so refinement does not re-run the nearest-neighbour search.

Setup effort

One command — pip install chartlibrary-mcp