Skip to main content
Glama

MarketBrief

将 40 多个数据源自动转化为每日华尔街风格的市场简报,并发送到您的 Telegram。

MarketBrief 是一个开源框架,用于获取实时市场数据,聚合来自 40 多个 RSS 订阅源的新闻,并使用 Claude AI 生成结构化的分析师级报告。可以将其视为您个人的彭博终端,浓缩为每日简报。

Every morning at 7:00 AM, you wake up to this in Telegram:

  "Rates rise, equities capsize"

  TODAY'S FOCUS:
  - CPI 08:30 ET — beat eases Fed, miss reprices June cut
  - Gold $3,100 support — break below = safe-haven bid fading
  - Trump tariff speech 14:00 ET — new China tariffs trigger risk-off

  4 analyst-grade issues with source citations...
  Positioning table (OW/UW/MW)...
  Categorized news digest with 30+ items...
  Economic calendar with 10+ events...

它解决了什么问题?

如果您是散户投资者、加密货币交易员或市场爱好者,您可能:

  • 每天早上查看 5-10 个网站以获取市场更新

  • 错过重要的经济数据发布

  • 缺乏一种系统的方法来连接各资产类别之间的关联

  • 希望有一位分析师为您撰写每日简报

MarketBrief 实现了这一切的自动化。 它从官方来源(美联储、SEC、FRED、欧洲央行)、市场数据提供商(雅虎财经、CoinGecko)和 40 多个新闻源中提取数据,然后使用 Claude AI 将所有内容综合成一份结构化的简报,包含特定的价格水平、来源引用和可操作的仓位建议。


工作原理

                 YOU CONFIGURE                          IT FETCHES
           ┌─────────────────────┐            ┌──────────────────────┐
           │  portfolio.json     │            │  Yahoo Finance       │
           │  - your holdings    │            │  FRED (official)     │
           │  - interest areas   │            │  CoinGecko           │
           │                     │            │  SoSoValue (ETF)     │
           │  dashboard.json     │            │  Frankfurter (ECB)   │
           │  - assets to track  │            │  40+ RSS feeds       │
           │                     │            │  Forex Factory       │
           │  feeds.json         │            │  MyFXBook            │
           │  - news sources     │            └──────────┬───────────┘
           └─────────┬───────────┘                       │
                     │                                   │
                     ▼                                   ▼
           ┌─────────────────────────────────────────────────────────┐
           │              Claude AI (2-stage pipeline)               │
           │                                                         │
           │  Stage 1: Pre-flight Editorial Analysis                 │
           │  → Identifies market regime (risk-on/off/rotation)      │
           │  → Groups news into narrative threads                   │
           │  → Kills 30-50% of noise items                          │
           │                                                         │
           │  Stage 2: Structured Report Generation                  │
           │  → 4-issue analysis (what/reaction/contradiction/view)  │
           │  → Source-cited positioning table                        │
           │  → Categorized news digest                              │
           │  → Economic calendar with impact scoring                │
           └─────────────────────┬───────────────────────────────────┘
                                 │
                    ┌────────────┼────────────┐
                    ▼            ▼            ▼
              ┌──────────┐ ┌──────────┐ ┌──────────┐
              │ Telegram  │ │  Feishu  │ │ Terminal │
              │ (HTML+PDF)│ │  (Card)  │ │  (JSON)  │
              └──────────┘ └──────────┘ └──────────┘

没有 AI 密钥?没问题。 如果没有 ANTHROPIC_API_KEY,MarketBrief 仍然会输出一份完整的数据报告:市场快照、新闻源、经济日历——只是没有 AI 的评论部分。


快速开始

1. 克隆并安装

git clone https://github.com/yukipanpan/marketbrief.git
cd marketbrief
pip install -e .

2. 配置

cp config/portfolio.example.json config/portfolio.json
cp config/dashboard.example.json config/dashboard.json
cp config/feeds.example.json config/feeds.json
cp .env.example .env

编辑 .env 文件并填入您的 API 密钥:

# Required for AI analysis (skip for data-only mode)
ANTHROPIC_API_KEY="sk-ant-your-key-here"

# Optional — enhances data coverage
FRED_API_KEY="your-fred-key"              # Free at https://fred.stlouisfed.org/docs/api/api_key.html
SOSOVALUE_API_KEY="your-sosovalue-key"    # ETF flow data

# Optional — delivery channels
TELEGRAM_BOT_TOKEN="your-bot-token"       # Create at https://t.me/BotFather
TELEGRAM_CHAT_ID="your-chat-id"

3. 运行

# Data-only mode (no AI key needed, free)
marketbrief generate --no-ai

# Full AI-powered report
marketbrief generate --output json

# Fetch specific data
marketbrief fetch market      # Live prices: equities, FX, commodities, crypto
marketbrief fetch news        # Aggregated news from 40+ feeds
marketbrief fetch calendar    # Economic calendar (Forex Factory + FRED)
marketbrief fetch crypto      # BTC, ETH, SOL prices from CoinGecko
marketbrief fetch etf         # BTC/ETH spot ETF flows from SoSoValue
marketbrief fetch fred        # Official US economic data (CPI, GDP, NFP...)

您可以自定义的内容

这是一个模板框架,而不是成品。一切设计都是为了方便修改:

资产与投资组合 (config/portfolio.json)

跟踪您关心的任何内容。默认设置以美国市场为中心,但您可以:

{
  "holdings": [
    {"name": "Nikkei 225 ETF", "ticker": "EWJ", "category": "Japan Equities"},
    {"name": "Copper Futures", "ticker": "HG=F", "category": "Industrial Metals"},
    {"name": "Bitcoin", "ticker": "BTC-USD", "category": "Crypto"}
  ],
  "interest_areas": ["Semiconductors", "Uranium", "Japan"],
  "focus_regions": ["Japan", "US", "EU"]
}

仪表板 (config/dashboard.json)

添加或删除雅虎财经支持的任何资产:

{
  "equities": [
    {"label": "Nikkei 225", "yf": "^N225"},
    {"label": "FTSE 100",  "yf": "^FTSE"},
    {"label": "DAX",       "yf": "^GDAXI"}
  ],
  "crypto_ids": ["bitcoin", "ethereum", "solana", "dogecoin"]
}

新闻源 (config/feeds.json)

添加任何 RSS 订阅源。按类别组织以实现智能过滤:

{
  "feeds": [
    {"name": "my_niche_blog", "category": "research", "url": "https://example.com/feed.xml"},
    {"name": "industry_news", "category": "markets",  "url": "https://industry.com/rss"}
  ]
}

类别很重要: government(政府)和 geopolitics(地缘政治)订阅源从不截断。macro(宏观)和 ai_tech(人工智能技术)订阅源会回溯 7 天(新闻则为 36 小时)。

AI 分析风格 (config/prompts/)

Claude 的提示词完全可编辑。您可以:

  • 更改输出语言(英语、中文或混合)

  • 调整分析问题的数量(默认:4)

  • 修改分析师的语气(果断的卖方风格 vs 中立风格)

  • 添加自定义分析框架

  • 更改仓位建议选项


用例与构思

MarketBrief 是一个起点。以下是您可以利用它构建的内容:

用例

方法

个人每日简报

配置您的投资组合 + Telegram,设置 GitHub Actions 定时任务

加密货币追踪器

移除股票,添加 20 个加密货币订阅源,跟踪 DeFi 协议

宏观研究助手

侧重于 FRED + 美联储 + 财政部订阅源,关注利率/外汇

团队晨会

推送到共享的 Telegram 频道或飞书群

AI 代理数据源

使用 MCP Server 为任何 AI 助手提供实时市场数据

交易信号流水线

将您自己的评分逻辑添加到新闻/日历获取器中

多语言简报

在提示词中将 OUTPUT_LANGUAGE 更改为中文/日语

财报季追踪器

添加关注财报的 RSS 订阅源,自定义日历过滤


MCP Server

MarketBrief 可以作为 MCP 服务器运行,让任何 AI 助手(Claude Desktop、Claude Code 等)直接调用市场数据工具。

pip install marketbrief[mcp]
python -m marketbrief.mcp_server

添加到您的 Claude Desktop 配置 (claude_desktop_config.json):

{
  "mcpServers": {
    "marketbrief": {
      "command": "python",
      "args": ["-m", "marketbrief.mcp_server"],
      "env": {"FRED_API_KEY": "your-key"}
    }
  }
}

7 个可用工具

工具

功能

需要 AI 密钥

generate_report

全面的 AI 驱动简报流水线

fetch_market_data

股票、大宗商品、外汇、利率、加密货币快照

fetch_news

聚合 40 多个 RSS 订阅源并去重

fetch_calendar

经济日历(Forex Factory + MyFXBook)

analyze_regime

宏观环境检测(收益率曲线、信贷、轮动)

analyze_breadth

市场广度信号(上涨/下跌家数、移动平均线交叉)

fetch_etf_flows

BTC/ETH 现货 ETF 每日资金流向和资产管理规模 (AUM)

大多数工具无需任何 API 密钥即可工作——只有 generate_report 需要 Anthropic 密钥。


自动交付 (GitHub Actions)

按计划运行 MarketBrief——无需服务器:

  1. 复制工作流模板:

    mkdir -p .github/workflows
    cp workflows/morning_report.yml.template .github/workflows/morning_report.yml
  2. 在您的 GitHub 仓库中添加密钥 (Settings → Secrets → Actions):

    • ANTHROPIC_API_KEY

    • TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID

    • FRED_API_KEY (可选)

  3. 根据您的时区调整 cron 定时计划 (参见 workflows/README.md)。

  4. 推送代码——报告将自动生成并交付。


数据源

来源

数据

成本

雅虎财经

股票、大宗商品、外汇、利率、行业

免费

Frankfurter API

欧洲央行官方汇率

免费

CoinGecko

加密货币价格 + 市值

免费

FRED

美国官方经济数据 (CPI, GDP, NFP, 收益率)

免费 (需 API 密钥)

SoSoValue

BTC/ETH 现货 ETF 每日资金流向 + AUM

免费 (需 API 密钥)

Forex Factory

包含时间和影响力的经济日历

免费

MyFXBook

包含实际值/预测值/前值的日历

免费

40+ RSS 订阅源

来自美联储、SEC、CNBC、彭博、CoinDesk 等的新闻

免费


项目结构

marketbrief/
├── src/marketbrief/
│   ├── core/
│   │   ├── config.py       # Unified config: JSON + env vars
│   │   ├── types.py        # Pydantic models for all data
│   │   ├── analysis.py     # Claude AI 2-stage pipeline
│   │   └── pipeline.py     # Main orchestrator
│   ├── fetchers/            # 6 data source modules
│   ├── renderers/           # HTML, Telegram, PDF, Markdown
│   ├── delivery/            # Telegram, Feishu, stdout
│   └── skills/              # Trading analysis modules
├── config/                  # Customizable JSON configs + prompts
├── mcp_server/              # MCP Server (7 tools)
├── claude_skill/            # Claude Code Skill definition
└── workflows/               # GitHub Actions templates

贡献

欢迎提交 PR!以下领域特别需要贡献:

  • 新的获取器:添加数据源 (例如 Binance, TradingView, Alpha Vantage)

  • 渲染器:改进 HTML/PDF 输出,添加新格式 (Slack, Discord, 电子邮件)

  • 交易技能:移植环境检测器和广度分析器

  • 本地化:其他语言的提示词 (日语, 韩语, 西班牙语)

  • 测试:获取器和分析流水线的单元测试


许可证

MIT — 您可以随意使用。

-
security - not tested
A
license - permissive license
-
quality - not tested

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/yukipanpan/marketbrief'

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