mcp-financial-data
An MCP server that integrates SEC EDGAR, FRED, and Polygon.io financial data with OAuth 2.1 security and a citation-grounded 10-K extractor powered by Claude Sonnet 4.5.
README
mcp-financial-data
An MCP server (spec 2025-11-25) for SEC EDGAR + FRED + Polygon.io with OAuth 2.1, a citation-grounded 10-K extractor powered by Claude Sonnet 4.5, and an MCP Apps inline UI for the extracted summary.
Anchor audience: Anthropic Forward Deployed Engineering, Bridgewater / Citadel / Anthropic Finance teams.
This repo is project P1 of a 9-project portfolio sprint running May 18 – June 21, 2026.
Why this exists
Financial-services AI work consistently fails the same audit checklist:
- The agent answered with a number, but the citation pointed at the wrong filing.
- The agent dropped a fact silently when the source didn't support it.
- The MCP integration didn't validate JWT scopes per request.
- The eval harness wasn't deterministic, so the regression yesterday is indistinguishable from a flaky judge today.
Every one of these is a hard constraint in this repo, enforced in CI.
Architecture
flowchart LR
Client["MCP Client (Claude Desktop / Cursor / Goose)"] -->|"OAuth 2.1 + PKCE"| Server[FastMCP Server]
Server --> EDGAR[EDGAR async client]
Server --> FRED[FRED async client]
Server --> Polygon[Polygon.io async client]
Server --> Extractor["10-K Extractor (Claude Sonnet 4.5 + Citations)"]
Server --> Apps["MCP Apps inline UI"]
EDGAR --> Cache[(Postgres response cache 24h TTL)]
FRED --> Cache
Polygon --> Cache
Extractor --> Cache
Server --> Evals["evals/harness.py (JSONL runs)"]
Quickstart
git clone https://github.com/SebAustin/mcp-financial-data.git
cd mcp-financial-data
cp .env.example .env # fill in API keys
make setup # uv sync + pre-commit install
make ci # lint + typecheck + tests + smoke eval (offline)
make serve # run the MCP server on $MCP_HOST:$MCP_PORT
What's in the box
| Surface | Tool / endpoint | Notes |
|---|---|---|
| MCP tool | edgar.list_filings |
Recent SEC filings for a CIK. |
| MCP tool | edgar.company_facts |
XBRL facts (us-gaap concepts). |
| MCP tool | fred.series |
FRED economic time series. |
| MCP tool | polygon.aggregates |
OHLCV aggregate bars. |
| MCP tool | tenk.extract_section |
Claude-grounded 10-K claims with citations. |
| MCP App | tenk-summary-card |
Inline UI rendering the extractor output. |
| OAuth | RFC 6750 resource server | Validates JWT against external IdP. |
Eval targets (W1)
The eval harness writes per-case JSONL plus a summary JSON to
evals/runs/<run_id>/. CI runs --smoke --offline on every PR; nightly
CI runs --full against live APIs with a $5 spend cap.
| Metric | W1 target | Source of truth | Notes |
|---|---|---|---|
| Smoke pass rate | 5 / 5 cases | evals/cases/seed.jsonl |
Offline fixtures. |
| Mean exec-accuracy | ≥ 0.95 | evals/metrics.py::exec_accuracy |
Deterministic. |
| Mean citation coverage | = 1.00 (extractor) | evals/metrics.py::citation_coverage |
Required for tenk.*. |
| Mean judge score (offline) | ≥ 0.90 | evals/metrics.py::judge_with_stub |
0.5·exec + 0.5·citation. |
| P50 latency (smoke) | ≤ 50 ms | harness latency_ms |
Offline only. |
| Total cost / smoke run | $0.00 | harness total_cost_usd |
--offline enforced. |
| Coverage gate (src/) | ≥ 85% | pytest --cov-fail-under=85 |
mypy --strict also gates. |
Hard constraints (skim before contributing)
- Citations are non-optional for the 10-K extractor. Every
CitedClaim.textcarries at least oneCitation. Uncited model output is dropped or moved tonoteswith[INFERENCE]. Seedocs/adr/0003-citations-required-for-extracted-claims.md. - EDGAR Fair Access is enforced. Every request carries the
EDGAR_USER_AGENTenv value. Process rate limit ≤ 10 req/sec. - Spend cap.
MAX_API_SPEND_USDdefaults to 50. Enforced in extractor and harness. - No
requests, noprint(), nosubprocess shell=True, no bareexcept. - OAuth 2.1 RS only. This server validates JWTs; it is never the IdP.
See
docs/adr/0004-oauth21-as-resource-server.md.
Layout
src/mcp_financial_data/ # the package
server.py # FastMCP entrypoint
auth/oauth.py # OAuth 2.1 RS primitives
tools/{edgar,fred,polygon} # async API clients
extractors/tenk.py # citation-grounded 10-K extractor
apps/ui.py # MCP Apps inline UI registration
evals/{harness,metrics} # eval harness (--smoke / --full / --offline)
tests/{unit,integration} # pytest, 85% gate, integration skipped by default
evals/cases/seed.jsonl # 5 hand-authored eval cases
evals/runs/ # per-SHA harness output (gitignored)
docs/adr/ # MADR architecture decisions
.github/ # CI templates + issue/PR templates + dependabot
References
- Model Context Protocol — specification 2025-11-25
- SEC EDGAR — accessing data fairly (User-Agent + 10/sec)
- FRED API documentation
- Polygon.io REST API
- Anthropic Citations API
License
MIT. See LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。