Chart Library
About
Pattern intelligence API for AI agents. Search 24M historical chart patterns, get forward returns, market regime analysis, and AI summaries for any stock ticker.
Details
- Author
- grahammccain
- Categories
- Other, Finance, AI
Jump to
Setup
Install Chart Library in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/grahammccain/chart-library-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
Works with:Claude Desktop | Claude Code | ChatGPT | GitHub Copilot | Cursor | VS Code | Any MCP client
Cohort intelligence engine for stock chart patterns— give your AI agent the cohort of historical analogs, the full forward-return distribution, and the features that separated winners from losers. Calibrated, methodology-honest, no overstated confidence.
📖What is cohort intelligence?· 🛠️Full MCP setup guide· 🤖Build an AI trading agent with Claude
25M+ pattern embeddings. 10 years of history. 19K+ stocks. One tool call.
> "What does NVDA's chart on 2024-08-05 1h look like historically?" NVDA · 2024-08-05 · 1h — cohort of 500 historical analogs (485 with realized 5-day returns) Distribution at 5 days forward: median: −1.3% p10 ·· p90: −11.3% ·· +6.8% (80% empirical band) win rate: 44% cohort_score: 0.31 (modest) Features that separated winners from losers: + credit_spread_state = tight + macro_state = bullish + pct_off_52w_low (further off) − vol_regime = low Summary: NVDA's 1-hour pattern on 2024-08-05 has 500 historical analogs. The cohort's 5-day distribution is bearish-leaning (median −1.3%, win rate 44%) — the historical record does NOT show this pattern typically resolving bullish. Conditioning on tight credit spreads and a bullish macro state would have separated the outperformers within the cohort.
A retrieval, not a forecast. No hallucinated predictions. No cherry-picking. Just the empirical record your agent can cite.
Download thechart-library-6.1.0.mcpbextension file and open it with Claude Desktop for automatic installation.
claude mcp add chart-library -- chartlibrary-mcp
{ "mcpServers": { "chart-library": { "command": "chartlibrary-mcp", "env": { "CHART_LIBRARY_API_KEY": "cl_your_key" } } } }
Add to.cursor/mcp.jsonor VS Code MCP settings:
{ "servers": { "chart-library": { "command": "chartlibrary-mcp", "env": { "CHART_LIBRARY_API_KEY": "cl_your_key" } } } }
Add to.vscode/mcp.jsonin your project (this file is already included in the chart-library repos):
{ "servers": { "chart-library": { "command": "chartlibrary-mcp", "env": { "CHART_LIBRARY_API_KEY": "cl_your_key" } } } }
Copilot Chat will auto-detect the MCP server when you open the project. Use@mcpin Copilot Chat to invoke tools.
ChatGPT connects to MCP servers via remote HTTP endpoints. To set up:
- Enable Developer Mode: Go to ChatGPTSettings > Apps > Advanced settings > Developer mode(requires Pro, Plus, Business, Enterprise, or Education plan)
- Create a connector: In Settings > Connectors, clickCreateand enter:
- Name: Chart Library
- Description: Historical chart pattern search engine — 25M+ patterns across 19K+ stocks, 10 years of data
- URL:https://chartlibrary.io/mcp
- Authentication: No Authentication (or OAuth if using an API key)
Note: The remote endpoint athttps://chartlibrary.io/mcpuses Streamable HTTP transport. If you need SSE fallback, usehttps://chartlibrary.io/mcp/sse.
For any MCP client that supports remote HTTP connections:
This endpoint supports both Streamable HTTP and SSE transports, no local installation required.
Free tier: 200 calls/day, no credit card required.Get an API key atchartlibrary.io/developersor use basic search without one.
"Should I be worried about my TSLA position?"
> search(query="TSLA") → cohort_id > explain(cohort_id=..., style="position_guidance") Signal: HOLD Of the historical analogs to this setup, those that exited early avoided a drawdown 3/10 of the time; those that held gained a further +2.1% median over the next 5 days. No exit signal triggered — the cohort's record leans toward continuation, not reversal.
"What sectors are rotating in right now?"
> context(target="market") Sector relative strength (30-day): Leaders: XLK Technology +4.2% · XLY Cons. Disc. +3.1% · XLC Comm. +2.8% Laggards: XLU Utilities −1.4% · XLP Cons. Staples −2.1% · XLRE Real Estate −3.3% Regime: Risk-On (growth > defensives), SPY above 20d, VIX mid-band.
"How does AMD behave when the broad tape is weak?"
> search(query="AMD 2024-06-18") → cohort_id > cohort_groupby(cohort_id=..., by="ctx_spy_trend_20d") AMD's cohort, split by the SPY trend at each analog's date: SPY weak (bottom quartile): median 5d −5.2% · p10/p90 −11.4%/+1.1% · 18% positive SPY strong (top quartile): median 5d +2.6% · p10/p90 −3.1%/+8.4% · 61% positive A distribution conditioned on the tape — historical analogs, not a beta forecast.
Chart Library v6 exposes the same granular surface as the remote server atchartlibrary.io/mcp— so the pip package, the Claude connector, and the REST API all use the same tool names. The core loop issearch → pull_comps → cohort_introspect. Chain tools via thecomp_set_id/cohort_idhandle for sub-second refinement without re-running kNN.
Full-cohort handover— hand the raw cohort back so you can bucket/sort byyourobjective, not our default lens:
These tools replace hallucinated "on average this pattern returns X%" with real conditional base rates. The full distinction — what they do and how to read responses — is documented at/concepts/cohort-intelligenceand/concepts/reading-a-cohort-response.
1. search(query="NVDA 2024-06-18") → comp_set_id 2. pull_comps(symbol="NVDA", date="2024-06-18", filters={"vol_regime": ["high"]}) → comp set: distribution + drivers 3. cohort_introspect(cohort_id=..., where={"events.days_since_earnings": {"max": 5}}) → how the post-earnings subset did 4. cohort_groupby(cohort_id=..., by="sector_etf") → outcome split by sector
v6 converges on the granular naming the live remote/connector surface already used. The v5umbrellatools —cohort(depth=),discover(mode=),narrative(mode=), anddecision_brief— are nowdeprecated but still callable, so existing code keeps working.cohort(depth="full")forwards tocohort_analyze. New agents should reach for the canonical tools above.
The v4-era granular aliases (cohort_compare,decompose,clusters,live_search,similar_cohorts,anchor_fetch,narrative_pulse,narrative_alerts,discover_picks,get_daily_setups) remain deprecated-but-callable and forward to the canonical surface.
The v3-era tools (search_charts,get_cohort_distribution,analyze_pattern, etc.) were removed in v5. If your code still calls them, pinchartlibrary-mcp<5.0.0until you migrate. The mapping:
Chart Library indexes a large library of historical chart patterns and exposes them behind a conditional-distribution API. Every query returns sample sizes, percentiles, and calibrated forward-return bands — never a point forecast.
When your agent callssearch("NVDA")and chainscohort_analyze, the server:
- Resolves NVDA's current chart state to a stored embedding
- Retrieves the cohort of historically similar patterns
- Looks up what happened over the following 1, 3, 5, and 10 days
- Returns the calibrated distribution + a plain-English summary via Claude Haiku
The result: factual, citation-ready statements like"out of N similar historical patterns, the median 5-day return was X% (80% band [p10, p90])"that your agent can present without hallucinating or hedging.
Get your key atchartlibrary.io/developers.
export CHART_LIBRARY_API_KEY=cl_your_key
- Website
- API Documentation
- Developer Portal
- Regime Tracker
- Python SDK|JavaScript SDK
Chart Library's privacy policy is published atchartlibrary.io/privacyand covers:
- What we collect: account info (email when you create an account), usage data (search queries, features used), and device information (browser, OS, IP). API queries are stored for service operation and analytics.
- How we use it: providing and improving the service, processing your searches, communicating about your account, and analyzing usage patterns.
- Data sharing: we do not sell personal data. Operational service providers (hosting, analytics, payment processing) receive only what's necessary to provide the service.
- Third-party services: queries may be processed by upstream providers (Polygon.io for market data, Anthropic for narrative summaries) under their own privacy policies.
- Retention: account info while your account is active; usage data is anonymized or deleted periodically. You can request deletion at any time.
- Security: encryption in transit and at rest. No method of transmission is 100% secure.
- California rights (CCPA): right to know, right to delete, right to opt-out, non-discrimination.
- Contact:support@chartlibrary.iofor any privacy inquiry.
The MCP server itself sends only the arguments of your tool calls tochartlibrary.io(no local file or directory contents, no clipboard, no browser history). YourCHART_LIBRARY_API_KEYis sent only as a Bearer header to authenticate with the chart-library API.
- Transport: all calls to the remote API are HTTPS (TLS 1.2+).
- Authentication: optional API key passed as a Bearer header; the free Sandbox tier requires no key.
- No write accessto your environment, files, or other accounts. The single MCP tool that performs a write (report_feedback) only writes back to chart-library's own feedback inbox and never touches your system.
Report security issues tosupport@chartlibrary.io.
Chart Library provides historical pattern data for informational purposes. Not financial advice.
Institutional research and manager diligence reports on hedge funds, venture capital and private equity managers. Summary of filings, personnel changes, media screening and social signals delivered to you in minutes.
Real-time business event intelligence for AI agents -- AI-scored leads, funding rounds, acquisitions, and market briefs in Claude, Cursor, or Windsurf
Real-time ASX market intelligence for AI agents — announcements, AI summaries, sentiment, social intelligence, stock prices, and franking credit calculator across 2,200+ Australian-listed companies.
Financial data for AI agents. SEC XBRL fundamentals, insider trades, 13F holdings, treasury yields. Source-traced.
Market intelligence your AI agent can call
An AI agent providing unified access to financial market data and news articles.
Financial intelligence for AI agents: an agent-readable investment loop for market regime, portfolio context, decision framing, and thesis review.
Financial intelligence for AI agents — 31 tools across 8 data sources including regime, derivatives, stablecoin flows, momentum, macro, weather patterns, and political cycles.
Deep fundamental data from SEC filings, including operational KPIs not found on Bloomberg, built for your financial AI agents.
AI trading memory layer for MT5/forex with 15 MCP tools — store/recall trades, pattern discovery, strategy evolution, and Outcome-Weighted Memory.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




