
EdgarTools
MCP查询美国 SEC EDGAR 披露数据的 Python 库,内置 MCP 服务器:检索 10-K、10-Q、8-K 等文件,读取 XBRL 标准化财务报表、Form 4 内部人交易与 13F 持仓。免费无需 API Key,需设置 EDGAR_IDENTITY 身份标识。
EdgarTools — Python Library for SEC EDGAR Filings
EdgarTools turns any SEC filing into financial statements, clean text and tidy DataFrames in a few lines of Python. No API key, no vendor, no bill: it reads straight from the SEC and covers every filing since 1993, from 10-Ks and insider trades to 13F holdings and fund reports. Spend your time on the analysis, not the parsing: your first income statement in three lines of code.
Docs · Cheat sheet · Agents: Skill · MCP server · Hosted: edgar.tools

Hear the story behind the library: Dwight Gunning on the Stack to Street podcast, "EdgarTools: AI That Cites the SEC Filing" (YouTube · Apple Podcasts · transcript).
Quick Start
1. Install. The package is edgartools; the module you import is edgar. Python 3.11+.
uv add edgartools # or: pip install edgartools
2. Identify yourself to the SEC. EDGAR requires a contact email on every request. There is no key, signup or rate-limit tier.
from edgar import Company, set_identity
set_identity("your.name@example.com")
3. Get data.
# Five fiscal years of standardized income statement, from XBRL
Company("NVDA").income_statement(periods=5)
#> Total Revenue $215.9B $130.5B $60.9B
Why not just call SEC's APIs?
data.sec.gov gives you JSON facts and filing indexes. Everything past that is your code. EdgarTools does that part:
- Section text and markdown. Item 1A, Item 7 or any Item of a 10-K or 10-Q as text, and whole filings as markdown for RAG. Raw HTML is where hand-rolled parsers break.
- Parsed forms, not XML. 13F holdings, Form 4 transactions, N-PORT portfolios and 8-K items as typed objects and DataFrames.
- Statements that line up. Rows standardized across filers, so "Total Revenue" means the same thing for a bank and a chipmaker, plus discrete quarters (Q4 derived from the 10-K) and trailing twelve months.
- Search and plumbing. Full-text search over filing content, the live filing feed, rate limiting, caching and offline storage.
It runs in your own process, MIT-licensed, with no API key and no vendor quota; SEC's fair-access limit of 10 requests a second still applies, and EdgarTools keeps to it.
What you can do
Full-text search across SEC filings
Search the text of every filing since 2001, not just form types and dates.
from edgar import search_filings
# Every 10-K filed since 2025 that mentions tariffs
results = search_filings("tariff", forms="10-K", start_date="2025-01-01")
hit = results[0]
hit.accession_number, hit.form, hit.filed, hit.company # a hit's fields; filed is the filing date
hit.get_filing() # the Filing behind a hit, ready for .obj() or .markdown()
# Structured: 8-Ks that reported a cybersecurity incident (Item 1.05) in 2025
search_filings(forms="8-K", items="1.05", start_date="2025-01-01", end_date="2025-12-31")
#> 19 total
Financial statements over several years
Company("MSFT").income_statement(periods=10) # also .balance_sheet() and .cash_flow_statement()
One metric across companies
Pick rows by their standardized label, never by position: the first row of an income statement is not always total revenue.
import pandas as pd
revenue = {
ticker: Company(ticker).income_statement(periods=3, as_dataframe=True)
.set_index("label").filter(like="FY").loc["Total Revenue"] / 1e9
for ticker in ["JPM", "PFE", "CAT"]
}
pd.DataFrame(revenue).round(1) # $ billions
#> FY 2025 182.4 62.6 67.6
Quarterly figures and trailing twelve months
nvda = Company("NVDA")
nvda.get_ttm_revenue() # the last four quarters, summed
nvda.income_statement(period="quarterly", periods=8) # discrete quarters; Q4 is derived from the 10-K
Sections and markdown for RAG
filing = Company("NVDA").latest("10-K")
filing.markdown() # the whole filing as markdown
tenk = filing.obj()
tenk.risk_factors # Item 1A as text
tenk["Item 1C"] # any Item by number
Find filings, by anything
from edgar import find, get_current_filings, get_filings
get_filings(2025, 4, form="10-K") # every 10-K filed in Q4 2025
get_current_filings() # the live feed, as SEC posts it
find("0000320193-25-000079") # an accession number, CIK or ticker


13F institutional holdings
thirteenf = Company("BRK.A").get_filings(form="13F-HR").latest().obj()
thirteenf.holdings # one row per security: Issuer, Cusip, Ticker, SharesPrnAmount, Value, ...
Institutional Holdings guide →

Insider trades from Form 4
form4 = Company("TSLA").get_filings(form="4").latest().obj()
form4.to_dataframe() # buys, sells, grants and exercises

Fund holdings from N-PORT
from edgar import Fund
Fund("VOO").get_portfolio() # the latest N-PORT holdings as a DataFrame
8-K events and earnings releases
eightk = find("0001045810-26-000073").obj() # NVIDIA, 2026-08-26
eightk.items # ['Item 2.02', 'Item 9.01']
eightk.earnings # the EX-99.1 press release tables, parsed
Library or hosted?
EdgarTools is this library: free, MIT-licensed, running in your own Python process. edgar.tools is the hosted platform built on it: the same parsing, kept running and current, with every answer cited to its filing. You are not paying for the parsing; you are paying for it to be run and answerable. No feature is ever removed from the library to sell the platform.
| If you want to… | Use |
|---|---|
| Build something that runs: pipelines, backfills, backtests, model corpora, notebooks, custom joins, anything repeated across hundreds of names or run inside your own network | The library |
| Ask, not build: what the companies you cover filed and what changed since last time, who sold, who holds it, one person across every company they touch, screens across a universe, alerts, cited answers to forward or share with a team. From a browser, a phone, Excel, Claude or ChatGPT, or an agent that cannot run Python | edgar.tools. Free account to start |
| Own a maintained dataset (insider trades, 13F, BDC portfolios, material events), every row traceable to its filing, without running the pipeline | edgar.tools data licensing |
| Fetch one known filing or one JSON document, once, from a script | Neither: call EDGAR directly |
Both have an MCP server: the library's runs locally (see AI Integration below), and edgar.tools' is hosted at app.edgar.tools/mcp. Attach one per client, not both: they overlap and split your assistant's routing.
AI integration
EdgarTools ships an agent skill and a local MCP server, both in the ai extra. For an assistant that cannot run Python, use the hosted connector from the section above instead.
pip install "edgartools[ai]"
python -c "from edgar.ai import install_skill; install_skill()" # the skill, for Claude Code and Claude Desktop
The MCP server works with any MCP client. For Claude Desktop, add it to claude_desktop_config.json:
{
"mcpServers": {
"edgartools": {
"command": "uvx",
"args": ["--from", "edgartools[ai]", "edgartools-mcp"],
"env": {
"EDGAR_IDENTITY": "Your Name your.email@example.com"
}
}
}
}
uvx needs uv; without it, pip install "edgartools[ai]" and run python -m edgar.ai. Setup for other clients: MCP server guide · Skill guide.
Support the project
The SEC changes filing formats and ships a new XBRL taxonomy every year. Sponsorship is what keeps the parsers current and pays for new ones as new disclosures appear.
- GitHub Sponsors: monthly or one-time. Companies can sponsor on their existing GitHub bill.
- Buy Me a Coffee: a one-time thank-you.
- Consulting: help from the library's author with SEC data pipelines and financial AI built on it.
Upgrading from 5.x
EdgarTools 6.0 needs Python 3.11 or newer and renames or removes some 5.x APIs. Read Upgrading to 6.0 before you upgrade, and Upgrading to 6.1 for what changed since.
Docs, help and contributing
- Documentation · Cheat sheet · Notebooks · Blog
- Questions go to Discussions; bugs and feature requests to Issues.
- Contributions are welcome, including AI-assisted ones. Read the contributing guide and point your assistant at AGENTS.md.
EdgarTools is distributed under the MIT License.
相关资源

OpenBB Platform CLI
CLIOpenBB 开源投资研究平台的命令行版,在终端查询股票行情、财报、宏观经济等金融数据,可用 Routine 脚本批量自动取数。官方维护,部分数据源需自备 API Key。
OpenBB-finance/OpenBB75.9k
Finance Toolkit MCP
MCPFinanceToolkit 开源库作者出品的 MCP,用 500 多种公式透明的方法计算财务比率、估值、风险与宏观指标,适合公司对比与尽调初稿。托管版免安装,首次连接时填入 Financial Modeling Prep API Key(免费档仅限美股、近 5 年数据);结果需专业人员复核。
JerBouma/FinanceToolkit5.6k
同花顺金融数据服务
MCP同花顺官方的 A 股数据服务,提供托管 MCP,让 agent 查询 A 股行情、财务报表、估值、涨跌停与龙虎榜;指数板块、公募基金、期货期权另有独立服务,可按同样方式添加。需在官网注册并创建 API Key;不含港美股和分钟级行情,分析结论不构成投资建议。
HiThink-Tech/Financial-API4.7k
ExcelMcp
MCP在 Windows 上直接驱动本机 Excel:刷新 Power Query、做透视表和图表、计算 DAX、运行 VBA,并保留原有公式与格式,适合财务和行政在现有报表上自动整理数据。需要 Windows、Excel 2016 以上和 Node.js,不支持 macOS。
sbroenne/mcp-server-excel971
a-stock-data
Skill让 agent 写代码获取 A 股及相关市场数据:行情 K 线、研报、资金流、龙虎榜、公告、宏观利率、期货与可转债等,整合 34 个公开数据源,除 iwencai 外无需密钥;需要安装 Python 依赖。
simonlin1212/a-stock-data12.1k
hithink-finance(同花顺金融数据服务)
Skill同花顺官方金融取数技能:用自然语言查询 A 股行情、财报、估值、指数板块、公募基金与期货期权数据,自动选用 CLI、MCP 或 REST 接口,大批量结果落盘到本地。需在同花顺金融数据服务官网用同花顺 App 扫码登录并创建 API Key;分析结果不构成投资建议,需专业人员复核。
HiThink-Tech/Financial-API4.7k