Gold Mcp

io.github.ThaiTrevor由 GitHub 账号 ThaiTrevor 发布v4.1.2更新于 Oct 24, 2026

MCP server for XAUUSD gold market data + 4-tier trading toolkit (TA, backtest, SMC, risk).

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

本地 MCP 服务器,为助手提供公开的 XAUUSD 黄金行情、宏观背景以及分级交易分析工具集。

可以做什么
  • 获取黄金价格、OHLCV K 线、宏观背景(DXY、美债收益率、SPX、VIX、BTC、白银、原油)、相关性与季节性,并一次性生成市场快照
  • 通过本地 Binance WebSocket 工作进程读取实时 PAXG 报价与聚合 K 线,并查看工作进程状态
  • 可选接入本地 MT5 终端,读取报价、K 线、品种信息与账户余额/净值
  • 运行进阶技术分析、多周期快照、共振形态扫描与价格提醒(Pro)
  • 回测、滚动前推验证与策略参数优化,并按小时/交易时段统计日内季节性(Premium)
  • 扫描聪明钱概念、判定市场状态、计算仓位规模、运行蒙特卡洛与 VaR、生成 AI 简报及 HTML/Markdown 报告(Ultra)
适用场景
适合希望助手基于实时公开行情与宏观数据来分析黄金、而不是凭空推测的场景,也适合需要回测、风险仓位计算和报告生成的研究工作。免费档已覆盖基础价格、宏观与相关性查询。
运行要求
以 Python 包形式在本地通过 stdio 运行(需 Python 3.10+),启动命令为 python -m gold_mcp.server;免费档无需环境变量。Pro/Premium/Ultra 工具需要 GOLD_MCP_LICENSE_KEY,AI 分析工具需要 ANTHROPIC_API_KEY。MT5 适配器为 Windows 上的可选附加组件,需自备终端。需能访问 Yahoo Finance 与 Binance。
安装前请注意
付费档通过 GOLD_MCP_LICENSE_KEY 解锁,需向厂商站点购买;AI 分析工具会用你自己的 ANTHROPIC_API_KEY 把数据发送给 Anthropic。提醒功能可创建和删除,MT5 适配器会读取你的交易账户余额与净值。输出明确仅供教育研究,不构成投资建议,行情数据来自第三方公开来源。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Gold Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

gold-mcp

[License: MIT] [Python 3.10+] [Version] [MCP] [CI] [PRs welcome]

An MCP server that brings public gold (XAUUSD) market data into Claude, ChatGPT, Cursor, Windsurf, Cline, Zed, and any other Model Context Protocol client.

Free tier (13 tools + optional 8-tool MT5 BYOK adapter) is fully functional and stays free forever. Pro, Premium, and Ultra tiers add advanced TA, backtest, SMC suite, risk management, and AI analyst via an offline Ed25519 license key — no SaaS, no phone-home.

Educational and research use only — not financial advice.

Tiers

TierToolsLicenseSuggested price
Free13 (+8 optional MT5 BYOK)None$0
Pro+7 (20 total)GOLD_MCP_LICENSE_KEY env$9-19/mo
Premium+4 (24 total)GOLD_MCP_LICENSE_KEY env$29-49/mo
Ultra+18 (42 total, 50 with MT5 BYOK)GOLD_MCP_LICENSE_KEY env$99-149/mo

Free — public gold data + realtime PAXG + MT5 BYOK (13 + 8 tools)

Public gold data (Yahoo Finance):

  • get_gold_price — latest gold close + 24h change
  • get_gold_ohlcv — historical bars (1m → 1mo)
  • get_macro_context — DXY, US10Y/02Y, SPX, VIX, BTC, silver, oil
  • get_gold_correlations — gold-vs-macro correlation matrix
  • get_gold_seasonality — day-of-week / monthly return stats
  • get_vn_macro — USD/VND + implied world-parity gold price in VND
  • estimate_vn_gold_premium — compare local VN quote to world parity
  • gold_market_snapshot — one-call aggregator + bulleted summary
  • diagnostic — show license tier + available tools
  • cache_purge — sweep expired cache entries

Realtime PAXG via Binance public WebSocket (NEW v4.1, no API key):

  • paxg_worker_status — WS worker health + tick count
  • get_paxg_tick — last PAXG tick (tracks XAU/USD within 0.1-0.3%)
  • get_paxg_ohlcv_realtime — aggregated PAXG bars from local tick log

MT5 BYOK adapter (NEW v4.1, optional via pip install 'gold-mcp[mt5]', Windows):

  • mt5_attach / mt5_detach / mt5_status — manage attached terminal
  • mt5_find_symbol — broker-specific XAUUSD symbol resolution
  • mt5_get_tick / mt5_get_ohlcv / mt5_get_ticks — read from your terminal
  • mt5_account_info — balance / equity / leverage
  • No credentials cross the server. You run your own MT5 terminal.

Pro — advanced TA + multi-timeframe + alerts

  • analyze_gold_advanced — Bollinger + Ichimoku + Fibonacci
  • multi_timeframe_snapshot — 5m / 1h / 4h / 1d in one call
  • gold_correlation_regime — detects DXY decoupling, etc.
  • get_gold_setups — multi-indicator confluence scanner
  • create_gold_alert / list_gold_alerts / delete_gold_alert

Premium — backtest + research

  • backtest_gold_strategy — 4 strategies, vectorized
  • gold_walk_forward — rolling out-of-sample validation
  • optimize_gold_strategy — grid search by Sharpe / PF / return
  • gold_intraday_seasonality — hourly / session bucketing

Ultra — institutional analyst toolkit (18 exclusive tools)

Smart Money Concepts (SMC)

  • smc_full_scan — composite SMC bias (structure + OB + FVG + sweeps)
  • detect_order_blocks — bullish/bearish OB with impulse ATR filtering
  • detect_fair_value_gaps — 3-candle imbalances + fill tracking
  • detect_liquidity_sweeps — stop-hunt detection (breach + reverse)
  • detect_market_structure — CHOCH/BOS labeling on swing fractals

Regime + Multi-Timeframe

  • classify_regime — composite Hurst exponent + Lo-MacKinlay variance ratio
  • mtf_alignment — D1/H4/H1 confluence with alignment score 0-100

Position sizing + risk

  • kelly_fraction — half-Kelly default for safety
  • fixed_fractional_size — classic R% sizing
  • optimal_f — Ralph Vince geometric-mean-maximizing f
  • risk_of_ruin — Monte Carlo ruin probability

Monte Carlo + VaR

  • monte_carlo_paths — bootstrap or parametric path simulation
  • value_at_risk — historical VaR + Conditional VaR
  • prob_hit_target_or_stop — MC trade probability with EV in R-multiples

AI Analyst (BYOK Anthropic)

  • ai_daily_briefing — structured JSON read from Claude Sonnet 4.6
  • ai_setup_explanation — cheaper Haiku 4.5 plain-English read

Report generation

  • generate_html_tearsheet — polished standalone HTML report
  • generate_markdown_briefing — portable Markdown daily summary

Quickstart

1. Install

bash
git clone https://github.com/ThaiTrevor/gold-mcp.gitcd gold-mcppip install -e .

Python 3.10+. No other setup, no env vars, no data files.

2. Wire it into your MCP client

Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

json
{  "mcpServers": {    "gold-mcp": {      "command": "python",      "args": ["-m", "gold_mcp.server"]    }  }}

Restart Claude Desktop. The tools appear under the plug icon.

Claude Code (CLI)
bash
claude mcp add --scope user gold-mcp -- python -m gold_mcp.server
Cursor / Windsurf / Cline / Continue / Zed

~/.cursor/mcp.json (or the equivalent file for your client):

json
{  "mcpServers": {    "gold-mcp": {      "command": "python",      "args": ["-m", "gold_mcp.server"]    }  }}
ChatGPT Desktop / Agent mode

Settings → Connectors → Add MCP server:

Command: pythonArgs:    -m gold_mcp.server

3. Try it

Ask the model in plain English. Examples:

"What is gold doing right now and how does it compare to today's macro tape (DXY, yields, VIX)?"

"Show me the last 24 hourly bars of gold and the 60-day correlation with silver and DXY."

"Give me a market snapshot for gold — combine price, macro context, correlations, and the day-of-week seasonality."

"USD/VND right now and the implied world-parity gold price in VND per tael. If SJC is quoting 145 million, what's the premium?"

Why this exists

LLMs reason well about gold but they don't see live market data, the macro tape that moves gold, or a clean correlation matrix on demand. This server is a tiny, free bridge between an MCP client and the public Yahoo Finance data that any researcher already has access to — exposed as well-typed tools so the model picks the right one automatically.

It started as a study project to learn MCP architecture and turned into something useful enough to publish for the community.

Upgrading to Pro / Premium

Add GOLD_MCP_LICENSE_KEY to the env block of your MCP config:

json
"env": {  "GOLD_MCP_LICENSE_KEY": "eyJ0aWVy...Ijoi.MEUCI..."}

Restart your MCP client. Call diagnostic — tier_active should report pro or premium. New tools become available immediately.

See examples/claude_desktop_config_pro.json for the full template.

Architecture

gold_mcp/  server.py            FastMCP wiring with 3-tier gating (21 tools max)  gold_data.py         yfinance price + OHLCV  macro_data.py        DXY/yields/SPX/VIX/BTC + correlations  analytics.py         seasonality  analyst.py           one-call aggregator (gold_market_snapshot)  cache.py             TTL filesystem cache (60s → 24h)  license.py           Ed25519 offline license verification  issue_license.py     CLI: init-keys, issue, verify  pro_tools.py         Pro tier: advanced TA, alerts, multi-timeframe  premium_tools.py     Premium tier: backtest, walk-forward, optimizer  adapters/    vn_macro.py        USD/VND + world-parity gold

For vendors selling licenses, see the CLI:

bash
python -m gold_mcp.issue_license init-keys# Paste printed PUBLIC_KEY_B64 into gold_mcp/license.py
python -m gold_mcp.issue_license issue --tier pro --email [email protected] --days 30

Or run the Lemon Squeezy webhook handler (port from mcp-byok-template — swap the env-var name from MCP_BYOK_LICENSE_KEY to GOLD_MCP_LICENSE_KEY).

Contributing

This project is small on purpose. We welcome contributions that fit the same pattern:

  • Small, focused tools that wrap one public data source
  • Return structured JSON with named keys + a short interpretation field
  • No private data, no scraped credentials, no broker-specific paths
  • No tools that produce trading recommendations

See CONTRIBUTING.md for details and SECURITY.md for how to report security issues.

Testing

bash
pip install -e ".[dev]"pytest

CI runs the suite on Linux, macOS, and Windows across Python 3.10/3.11/3.12 on every push and pull request.

Disclaimer

gold-mcp is a data and analysis tool for educational and research purposes only. Nothing returned by any tool constitutes investment advice, a recommendation, or a solicitation. Markets carry risk; you are responsible for your own decisions.

License

MIT — see LICENSE.

来源:README.md,提交 f8a5ac9

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v4.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分