Dataville MCP 教學:5 分鐘為 AI 助手接入即時 SEC 申報資料
Give your AI assistant live SEC filings in 5 minutes (MCP tutorial)
Dataville 教學示範如何透過 MCP,讓 Claude、Cursor 或 VS Code 查詢 SEC EDGAR 申報資料,並取得財務數字及原始文件連結。文章亦提供不使用 MCP 的 HTTP API 查詢方式,並列出可用的申報類型、日期範圍與筆數參數。作者提醒,10-Q 數字採年初至今口徑,第二季申報涵蓋六個月,不能直接當作單季數字。
TL;DR: one claude mcp add (or a few lines of JSON for Cursor) gives your agent SEC EDGAR filings with real numbers and source links. Steps below, plus the raw API if you'd rather skip MCP.
Ask an LLM for a company's latest revenue and you'll get one of two things: a number from its training data (stale) or a hallucination (worse).
This tutorial fixes that in about 5 minutes. You'll give Claude, Cursor, or VS Code live access to SEC EDGAR filings through an MCP server, then ask questions like "What were Home Depot's revenue and net income in its latest 10-Q?" and get answers pulled from the actual filing, with a link back to the source document.
I'm a founding engineer at Dataville, and we built this. In my last post I covered how the server is designed. This one is purely hands-on.
What you need
- A free Dataville account (includes $5 of credits every month)
- One of: Claude (web or desktop), Claude Code, Cursor, Windsurf, or VS Code
Step 0: Try it with zero setup
No account or key needed for this one:
curl "https://api.dataville.com/edgar/HD"
You get the latest filing for the ticker, in the same JSON shape every Dataville source uses (trimmed here):
{
"status": "success",
"data": {
"title": "HOME DEPOT, INC. — 10-Q (2026-08-25)",
"source": "sec-edgar",
"body": "Company: HOME DEPOT, INC.\nForm: 10-Q\n...",
"metadata": {
"form_type": "10-Q",
"filing_date": "2026-08-25",
"financials": {
"revenue": "$89.63B",
"net_income": "$8.05B",
"eps_diluted": "$8.09"
},
"document_url": "https://www.sec.gov/Archives/edgar/data/354950/..."
}
},
"usage": { "...": "..." }
}
body is plain text you can hand straight to a model. metadata holds the structured fields. Anonymous requests are capped at 50 per 24 hours per IP, which is plenty to kick the tires.
Step 1: Get an API key
Sign up at dataville.com (free tier). A key is created automatically; you'll find it on the API Keys page of the dashboard.
export DATAVILLE_API_KEY=your_key_here
Step 2: Connect your AI tool
Claude Code
claude mcp add --transport http dataville https://api.dataville.com/mcp \
--header "Authorization: Bearer $DATAVILLE_API_KEY"
claude mcp list
Cursor (.cursor/mcp.json or ~/.cursor/mcp.json)
{
"mcpServers": {
"dataville": {
"url": "https://api.dataville.com/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
Claude (web or desktop): go to Customize → Connectors, click +, choose Add custom connector, and paste:
https://api.dataville.com/mcp?token=YOUR_API_KEY
Then turn the connector on in your chat. Custom connectors work on every Claude plan.
Windsurf and VS Code configs are in the docs.
The server exposes two tools: list_dataville_sources and search_dataville. That's the whole surface area your agent has to learn.
Step 3: Ask a real question
Using Dataville, what is Home Depot's most recent SEC filing? Summarize the headline numbers.
You'll see a "Search a Dataville data source" step, then an answer grounded in the filing. When I ran it, it came back with:
- Form: 10-Q, filed 2026-08-25, period ending 2026-08-02
- Revenue: $89.63B
- Operating income: $11.82B
- Net income: $8.05B
- Diluted EPS: $8.09
- Link: the primary document on sec.gov
One gotcha worth knowing: 10-Q figures are year-to-date, so a Q2 10-Q covers six months. Good models will say so if you ask; it's in the metadata (period_start / period).
If the tool doesn't fire, add "use Dataville" to your prompt.
Step 4: Prompts worth stealing
- "Pull Home Depot's last four 10-Qs from EDGAR and chart quarterly revenue. Remember 10-Q figures are year-to-date."
- "Which Home Depot insiders filed Form 4s recently, and were they buying or selling?" (the EDGAR response includes recent insider transactions)
- "Get NVIDIA's latest 10-K from EDGAR and its Wikipedia article, then write a one-paragraph company brief citing both."
- "Find the arXiv paper 1706.03762 and summarize its abstract."
The last two show the real trick: one MCP server, many sources, so your agent can cross-reference without you wiring up another integration.
Step 5: Skip MCP and call it from code
Same data over plain HTTP (pip install requests if you don't have it). Passing limit returns a list of filings instead of just the latest:
import os
import requests
resp = requests.get(
"https://api.dataville.com/edgar/HD",
params={"form_type": "10-Q", "limit": 4},
headers={"Authorization": f"Bearer {os.environ['DATAVILLE_API_KEY']}"},
)
resp.raise_for_status()
for filing in resp.json()["data"]["metadata"]["filings"]:
fin = filing.get("financials", {})
print(filing["filing_date"], filing["form_type"], fin["revenue"])
Running it today prints:
2026-08-25 10-Q $89.63B
2026-05-27 10-Q $41.77B
2025-11-25 10-Q $126.48B
2025-08-26 10-Q $85.13B
Notice the jump from $41.77B to $89.63B: that's the year-to-date effect again, not a doubling of sales. Need raw numbers to do your own math? Each filing also carries financials_raw, plus fiscal_year, fiscal_period and accession_number.
Filtering filings: form_type, from, to, limit
| Param | Format | What it does |
|---|---|---|
form_type |
10-K, 10-Q, 8-K, 20-F, S-1, DEF 14A, plus /A amendments |
Exact match on form. Omit it to get the newest filing of any type. |
from |
YYYY-MM-DD |
Start of the date range |
to |
YYYY-MM-DD |
End of the date range |
limit |
Integer ≥ 1 | How many filings to list (defaults to 5 when a date range is set) |
Sending any of from, to or limit switches to list mode: data is the newest match and data.metadata.filings lists them all, newest first.
For example, every 8-K Home Depot filed in 2026 (8-Ks are the "something material happened" filings):
curl "https://api.dataville.com/edgar/HD?form_type=8-K&from=2026-01-01&to=2026-12-31&limit=10" \
-H "Authorization: Bearer $DATAVILLE_API_KEY"
That returns six 8-Ks (filing date and accession number shown):
2026-08-21 8-K 0000354950-26-000148
2026-08-18 8-K 0000354950-26-000145
2026-08-12 8-K 0000354950-26-000141
2026-05-26 8-K 0000354950-26-000105
2026-05-19 8-K 0000354950-26-000101
2026-02-24 8-K 0000354950-26-000026
Six results with limit=10 simply means that's all there is in the range, and you're only charged for the six.
Two things to know: form_type matches exactly, so 10-K won't return a 10-K/A (ask for amendments by name), and a bad date or a from after to returns a 400 INVALID_TIMEFRAME that isn't charged.
Each filing in the list counts as one request, and a limit above 5 needs an API key. Want this running every morning with Slack alerts? There's a filings watchlist guide for exactly that.
Beyond EDGAR
The same two tools reach 11 sources: Wikipedia, arXiv, OpenAlex, Papers with Code, Stack Exchange, PyPI, US Census, USDA FoodData, Project Gutenberg, a historical news archive, and SEC EDGAR. Every one returns the same response shape, so code you write for one works for all of them.
Wrapping up
The free tier covers everything in this post. Full parameter reference and the other sources are in the docs.
What would you build with live filings in your agent? And which data source should we add next? Tell me in the comments. I read and reply to all of them.
I drafted this post with help from an AI assistant. I ran and verified every command and output shown here myself.
來源:DEV Community · dev.to