market-data-mcp

market-data-mcp

Provides real-time market data tools (quotes, news, earnings calendar, watchlist scanner, and composite analysis) for AI agents via Finnhub, with optional Alpaca broker integration and graceful degradation.

Category
访问服务器

README

market-data-mcp

Real-time market data: quotes, news, earnings calendar, and a watchlist scanner for AI agents — backed by Finnhub.

Gives any MCP client (Claude Desktop, Claude Code, agents) clean, uniform market data tools that fail gracefully. A missing or premium-gated source returns "no data", never a fabricated value. Markdown output by default, JSON on demand.


Tools

Tool What it does Source Free tier
market_quote Real-time price, % change, high/low/open/prev-close Finnhub /quote Yes
market_news Top 5 headlines — company-specific or general market Finnhub /company-news, /news Yes
market_calendar Earnings calendar for the next N days (with EPS/revenue estimates) Finnhub /calendar/earnings Yes*
market_scan Watchlist scanner: rank up to 25 tickers by absolute % change Finnhub /quote x N Yes
market_analyze Composite: momentum score + news catalyst + earnings proximity All of the above Yes
broker_positions Read open positions from Alpaca paper account Alpaca Paper API Optional**

*Calendar tested live on 2026-06-14: accessible on Finnhub free tier.
**broker_positions requires ALPACA_API_KEY + ALPACA_SECRET_KEY in .env. Degrades gracefully without them.

Every tool returns Markdown (human-readable, default) or JSON (response_format="json") for programmatic use.


Live demo output (2026-06-14)

market_quote AAPL:
  AAPL: $291.13  (-1.52%  -$4.50)  prev close $295.63

market_scan AAPL,MSFT,NVDA,TSLA:
  Scanned 4/4 symbols. Top mover: TSLA +1.82%

market_calendar days=7:
  20 earnings events in the next 7 days: ACN, KR, MEI ...

market_analyze AAPL:
  Signal: Lean negative  [......##|........] -30/100  confidence 60%
  AAPL: $291.13  -1.52%  → Lean negative [TRIM]
  Catalyst: Apple's iOS 27 surprise could change the AI narrative

Quick start

git clone <your-repo-url> market-data-mcp
cd market-data-mcp
python -m venv .venv
.venv\Scripts\activate        # Windows
pip install -r requirements.txt

copy .env.example .env        # edit: add FINNHUB_API_KEY
python tests/test_smoke.py    # live test all 6 tools

Get a free Finnhub key at: https://finnhub.io/register


Claude Desktop config

Add this to claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS), then restart Claude Desktop:

{
  "mcpServers": {
    "market-data-mcp": {
      "command": "python",
      "args": ["-m", "market_data_mcp"],
      "cwd": "C:/path/to/market-data-mcp"
    }
  }
}

Use the system Python path if you are not using a venv:

{
  "mcpServers": {
    "market-data-mcp": {
      "command": "C:/Users/YourName/AppData/Local/Python/pythoncore-3.14-64/python.exe",
      "args": ["-m", "market_data_mcp"],
      "cwd": "C:/path/to/market-data-mcp",
      "env": { "PYTHONUTF8": "1" }
    }
  }
}

Optional: Alpaca broker source

The broker_positions tool reads your Alpaca paper account. To enable it:

  1. Go to https://app.alpaca.markets/ → Paper Trading → API Keys
  2. Add to .env:
    ALPACA_API_KEY=your-key-here
    ALPACA_SECRET_KEY=your-secret-here
    
  3. Restart the server.

Without these keys, broker_positions returns a graceful "keys not set" message.


Why it's built this way

  • Uniform result contract. Every source returns the same Result shape (source, ok, summary, data, score, confidence, error). An LLM can reason across all tools without parsing N formats.
  • Graceful degradation. A source with no data, a premium-gated endpoint, or a missing key returns Result.failed(...) — never a fabricated value. Zero-price from Finnhub for unknown symbols is treated as "no data", not a quote.
  • Scored analysis. The composite market_analyze tool emits a -100..+100 directional score with confidence, so an agent can triage without reading prose.
  • TTL cache. Per-source in-process cache avoids hammering rate-limited APIs when an agent calls several tools in one turn (e.g. scan + analyze in sequence).

Disclaimer

For research and educational use only. Data comes from Finnhub and Alpaca and may be delayed or incomplete. Never use automated market data for financial decisions without independent verification.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选