Skip to main content
Glama
grahammccain

Chart Library

by grahammccain

图表库 MCP 服务器

PyPI License: MIT Glama Score Tools

兼容: Claude Desktop | Claude Code | ChatGPT | GitHub Copilot | Cursor | VS Code | 任何 MCP 客户端

询问你的 AI 智能体“上次出现这种图表形态时发生了什么?”,并获得真实的答案——由历史类似案例群组和后续走势的校准分布提供支持。

超过 2500 万个形态嵌入。10 年历史数据。1.9 万多只股票。一次工具调用即可完成。

> "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.

这是一种检索,而非预测。没有幻觉预测。没有选择性偏差。只有你的智能体可以引用的经验记录。


快速入门

pip install chartlibrary-mcp

Claude Desktop(一键安装)

下载 chart-library-1.1.1.mcpb 扩展文件,并使用 Claude Desktop 打开以进行自动安装。

Claude Code

claude mcp add chart-library -- chartlibrary-mcp

Claude Desktop(手动安装)

添加到 claude_desktop_config.json

{
  "mcpServers": {
    "chart-library": {
      "command": "chartlibrary-mcp",
      "env": {
        "CHART_LIBRARY_API_KEY": "cl_your_key"
      }
    }
  }
}

Cursor / VS Code

添加到 .cursor/mcp.json 或 VS Code MCP 设置中:

{
  "servers": {
    "chart-library": {
      "command": "chartlibrary-mcp",
      "env": {
        "CHART_LIBRARY_API_KEY": "cl_your_key"
      }
    }
  }
}

GitHub Copilot (VS Code)

添加到项目中的 .vscode/mcp.json(该文件已包含在 chart-library 仓库中):

{
  "servers": {
    "chart-library": {
      "command": "chartlibrary-mcp",
      "env": {
        "CHART_LIBRARY_API_KEY": "cl_your_key"
      }
    }
  }
}

当你打开项目时,Copilot Chat 会自动检测到 MCP 服务器。在 Copilot Chat 中使用 @mcp 来调用工具。

ChatGPT (开发者模式)

ChatGPT 通过远程 HTTP 端点连接到 MCP 服务器。设置方法如下:

  1. 启用开发者模式:前往 ChatGPT 设置 > 应用 > 高级设置 > 开发者模式(需要 Pro、Plus、Business、Enterprise 或 Education 计划)

  2. 创建连接器:在“设置 > 连接器”中,点击“创建”并输入:

    • 名称:Chart Library

    • 描述:历史图表形态搜索引擎 — 涵盖 1.9 万多只股票的 2500 万个形态,10 年数据

    • URLhttps://chartlibrary.io/mcp

    • 身份验证:无需身份验证(如果使用 API 密钥,则选择 OAuth)

  3. 在对话中使用:从 Plus 菜单中选择“开发者模式”,选择 Chart Library 应用,然后提问,例如“NVDA 的图表在历史上看起来是什么样的?”

注意:位于 https://chartlibrary.io/mcp 的远程端点使用 Streamable HTTP 传输。如果需要 SSE 回退,请使用 https://chartlibrary.io/mcp/sse

远程 MCP 端点

对于任何支持远程 HTTP 连接的 MCP 客户端:

https://chartlibrary.io/mcp

此端点同时支持 Streamable HTTP 和 SSE 传输,无需本地安装。

免费层级:200 次调用/天,无需信用卡。chartlibrary.io/developers 获取 API 密钥,或在没有密钥的情况下使用基础搜索。


Related MCP server: TickerAPI

你的智能体能用它做什么?

“我应该担心我的 TSLA 持仓吗?”

> get_exit_signal("TSLA")

  Signal: HOLD (confidence: 72%)
  Similar patterns that exited early: 3/10 would have avoided a drawdown
  Similar patterns that held: 7/10 gained an additional +2.1% over 5 days
  Recommendation: Pattern suggests continuation. No exit signal triggered.

“目前哪些行业正在轮动?”

> get_sector_rotation()

  Leaders (30-day relative strength):
    1. XLK  Technology     +4.2%
    2. XLY  Cons. Disc.    +3.1%
    3. XLC  Communication  +2.8%

  Laggards:
    9. XLU  Utilities      -1.4%
   10. XLP  Cons. Staples  -2.1%
   11. XLRE Real Estate    -3.3%

  Regime: Risk-On (growth > defensives)

“如果 SPY 下跌 3%,AMD 会发生什么?”

> run_scenario("AMD", spy_change=-3.0)

  When SPY fell ~3%, AMD historically:
    Median move:  -5.2%
    Best case:    +1.1%
    Worst case:  -11.4%
    Positive:     18% of the time

  AMD shows 1.7x beta to SPY downside moves.

8 个规范工具

Chart Library 2.0 将 22 个旧版工具整合为 8 个可组合的原语。通过 cohort_id 句柄进行链式调用,无需重新运行 kNN 即可实现亚秒级细化。

工具

功能

search

入口点。返回给定股票代码+日期的 cohort_id + 锚点 + 匹配数量。将句柄输入到 cohortanalyzeexplain 中进行链式调用。

cohort

核心原语。 图表形态的条件分布(p10/p25/p50/p75/p90 + 校准带 + MAE/MFE + 命中率 + 生存率),按机制/行业/流动性/事件过滤。一次调用即可替代旧版的 get_cohort_distributionrefine_cohort_with_filtersrun_scenarioget_regime_win_rates

analyze

通过 metric= 枚举获取分析指标:anomalyvolume_profilecrowdingcorrelation_shiftearnings_reactionpattern_degradationregime_accuracy

context

通过 target= 获取情境数据:股票元数据、市场机制 + 行业轮动,或数据库覆盖统计。

explain

通过 style= 枚举获取叙述 + 排名:filter_ranking(哪个过滤器对分布影响最大)、prose(纯英文摘要)、position_guidance(退出信号)、risk_ranking(夏普比率排名选股)。

portfolio

投资组合层面的持仓条件分布。加权平均分布,对尾部贡献者进行排名。

anchor_fetch

2.0 新增。 轻量级(代码,日期)元数据获取——行业、市值、时点机制。当你只需要股票的上下文时,可避免进行完整的 kNN 计算。

report_feedback

报告错误或建议改进。

这些工具用真实的条件基准率取代了虚构的“平均而言该形态收益为 X%”。查看 grounded-base-rates 模式 以了解完整循环。

典型的智能体流程

1. search("NVDA 2024-06-18")                          → cohort_id
2. cohort(cohort_id=..., filters={regime:{same_vix_bucket: true}})
                                                       → conditional distribution
3. explain(cohort_id=..., style="filter_ranking")     → which filter matters most
4. cohort(cohort_id=..., filters={...new filter...})  → refined distribution

旧版工具(已弃用,仍可调用)

为了向后兼容,这 22 个旧版工具名称仍然保留,并在其 MCP 注释中标记为 deprecated。它们会转发到规范工具,并将在未来的重大版本中移除。请通过下表进行迁移:

旧版

替换

search_charts, search_batch, get_discover_picks

search

get_cohort_distribution, refine_cohort_with_filters, run_scenario, get_regime_win_rates, compare_to_peers

cohort

detect_anomaly, get_volume_profile, get_crowding, get_earnings_reaction, get_correlation_shift, get_pattern_degradation, get_regime_accuracy

analyze (metric=)

get_sector_rotation, get_status, get_market_context

context

get_pattern_summary, explain_cohort_filters, get_exit_signal, get_risk_adjusted_picks

explain (style=)

get_portfolio_health

portfolio

analyze_pattern, get_follow_through, check_ticker

search + cohort (+ 可选 explain)


工作原理

Chart Library 索引了一个庞大的历史图表形态库,并通过条件分布 API 将其公开。每个查询都返回样本量、百分位数和校准后的远期收益带——绝非点预测。

当你的智能体调用 analyze_pattern("NVDA") 时,服务器会:

  1. 构建 NVDA 当前图表状态的表示

  2. 检索历史上相似的形态

  3. 查看随后 1、3、5 和 10 天内发生的情况

  4. 通过 Claude Haiku 返回分布 + 纯英文摘要

结果:事实性、可引用的陈述,例如“在 N 个相似的历史形态中,5 天的中位数收益为 X%(80% 区间 [p10, p90])”,你的智能体可以在不产生幻觉或回避的情况下呈现这些内容。


API 密钥

层级

调用次数/天

价格

Sandbox

200

免费

Builder

5,000

$29/月

Scale

50,000

$99/月

chartlibrary.io/developers 获取你的密钥。

export CHART_LIBRARY_API_KEY=cl_your_key

链接


图表库提供历史形态数据仅供参考。不构成财务建议。

Install Server
A
license - permissive license
C
quality
B
maintenance

Maintenance

Maintainers
2dResponse time
2wRelease cycle
2Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Financial intelligence for AI agents. 31 tools across 8 data sources — regime, derivatives, stablecoin flows, momentum, volatility, macro, DeFi, weather patterns, political cycles, seasonality. The context layer between your agent and a bad trade.
    31
    31
    9
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Agent-ready financial intelligence tools for AI agents. Two curated tools — get_stock_snapshot and get_company_metrics — that combine multiple data sources, derive signals (UNDERVALUED, STRONG, ACCELERATING), and pre-compute the math. One call, one agent-friendly response.
    3
    116
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Provides actionable financial intelligence tools for AI agents including insider buying signals, earnings IV plays, market pulse, stock analysis, and options strategies via free public data sources.
    6
    MIT

View all related MCP servers

Related MCP Connectors

  • Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.

  • The financial MCP for AI agents - 90+ financial tables, SEC filings, signals, alt-data.

  • US stocks, ETFs, crypto → compact brief: patterns, S/R, regime + base rates vs baseline. Not advice.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/grahammccain/chart-library-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server