Use Chart Library inside Claude.
Chart Library is an MCP server. Connect it to Claude and every question about a stock pattern is answered with historical analogs, forward-return distributions, and calibrated bands — grounded retrieval, not a generated prediction. 25M+ patterns spanning 10 years of US equity history, drawn from a 19,000+ symbol universe. One tool call.
Three ways to install
1. Claude Desktop — one-click .mcpb install
easiestDownload the desktop extension bundle and open it with Claude Desktop. Adds the 8 canonical tools (search, cohort, discover, analyze, context, narrative, explain, portfolio) to your local Claude. Optional API key for higher volume — the free Sandbox tier covers the full core loop, including the flagship Layer 3 cohort intelligence, without one.
Download the latest .mcpb release →2. Remote MCP — add to Claude as a custom connector
one-click for paid plansPro / Max / Team / Enterprise users can wire the hosted MCP endpoint directly: Settings → Connectors → Add custom connector, then paste:
Name: Chart Library
MCP URL: https://chartlibrary.io/mcp
Transport: Streamable HTTP (auto-detected)
Auth: OAuth 2.0 (recommended) or API key Bearer headerClaude.ai bounces you to chartlibrary.io for the OAuth consent screen — sign in (or create a free account), click Approve, and you're back in Claude with the connector active. No API key to copy, no config file to edit. The flow uses OAuth 2.0 authorization- code with PKCE (RFC 6749 + RFC 7636), discoverable via /.well-known/oauth-authorization-server.
The endpoint speaks the MCP 2025-03-26 spec. Origin-header validation is enforced per the spec; the standard Anthropic surfaces are allowlisted. Free Sandbox tier (1,000 calls/day) is included with any account.
3. Claude Code / Python SDK — install from PyPI
for agent buildersFor Claude Code, Python agents, LangChain, CrewAI, OpenAI Agents, or any framework with MCP support. Stdio transport — runs locally, calls our HTTP API under the hood.
pip install chartlibrary-mcp
# Claude Code:
claude mcp add chart-library -- chartlibrary-mcp
# Claude Desktop (manual config):
# Add to claude_desktop_config.json:
{
"mcpServers": {
"chart-library": {
"command": "chartlibrary-mcp",
"env": { "CHART_LIBRARY_API_KEY": "cl_your_key" }
}
}
}What it does
Eight canonical tools. Ask Claude any question about a stock pattern and it'll reach for these instead of hallucinating from training data.
| search | Find similar historical patterns, return a cohort_id you can chain |
| cohort | Conditional distribution — p10/p25/p50/p75/p90 + calibrated bands + feature importance + regime stratification |
| discover | What's interesting today — picks, daily setups, risk-adjusted ranking |
| analyze | Anomaly, volume, crowding, earnings reaction, regime accuracy, pattern degradation |
| context | Market state, ticker metadata, anchor regime context |
| narrative | News intelligence — single-symbol pulse or market-wide anomalies |
| explain | Prose narrative, filter importance, exit guidance, risk ranking |
| portfolio | Multi-holding cohort, or per-symbol track record |
Example session
User: What does NVDA's chart on 2024-08-05 1h look like historically?
Claude: I'll search Chart Library for analogs.
→ cohort(symbol="NVDA", date="2024-08-05", timeframe="1h", depth="full")
Found 293 historical analogs. 5-day forward distribution:
median: −0.81%
p10/p90: −12.15% / +10.71% (80% conformal band, validated 80.8%)
win rate: 47%
Volatility regime is the key signal: in high-vol setups like
today's (vix=18, vix_term_structure=0.92), this pattern hit
70% win rate with mean +2.73%. In low-vol it hit 26% / −4.45%.
Today's setup matches the favorable high-vol profile, but
magnitude is wide. Position size accordingly.
Source: Chart Library cohort_analyze, n=293, validated
calibration. Not a forecast.Why use it
- Grounded retrieval, not generation. Every response cites a specific cohort. Sample size, percentiles, and calibrated bands are baseline output.
- Calibration is the moat. Our nominal 80% empirical band has held 80.8% across 310,592 audited cases. Validate against /calibration or call /api/v1/calibration directly.
- Compliance-safe framing. Output is a fact about historical outcomes, not a forecast. Designed to be quoted by an agent without triggering "investment advice" classifiers.
- Composable. Chain tools via
cohort_idhandles. Refine filters without re-running kNN.
Pricing
| Tier | Calls included | Layer 3 | Price |
|---|---|---|---|
| Free | 1,000/day | ✓ | Free |
| Builder | 50K/mo | ✓ | $29/mo |
| Scale | 500K/mo | ✓ | $99/mo |
| Agent | 2M/mo | ✓ | $299/mo |
| Enterprise | Unlimited | ✓ | From $2K/mo |
Get a key at /developers. The full core loop — search, context, explain, and the flagship Layer 3 cohort intelligence (pull_comps / cohort_analyze) — is free, keyless over the hosted MCP or with a free key (1,000 calls/day). Paid tiers add volume, higher RPM, and SLA — you convert at scale, not to unlock the product.
Trust + compliance
- Privacy — /privacy covers collection, usage, sharing, retention, contact. Tool calls send only the arguments you pass — no file system, no clipboard, no browser history.
- Transport — HTTPS (TLS 1.2+) end-to-end. Origin-header validation per the MCP spec.
- Write surface — exactly one write tool (
report_feedback), which writes back to our own feedback inbox. Never touches your system or other accounts. - Disclaimer — /disclaimer. Chart Library is historical data analysis, not investment advice.
More
- /learn/intelligence — what cohort intelligence is, methodology in plain English
- /learn/methodology — how the cohort + calibration math works
- /calibration — live calibration report (80% band coverage tracked)
- /guides/mcp-server-for-finance — full MCP setup guide with worked examples
- /guides/build-ai-trading-agent-claude — end-to-end agent template using Chart Library
- github.com/grahammccain/chart-library-mcp — source, releases, issue tracker