agentladle/mcp-sec
AgentLadle MCP SEC
English | 中文 | 📺 Watch Demo
🇨🇳/🇭🇰 Cloud-hosted MCP for A-share & HK listed companies (Past 3 years annual & latest interim reports). Read more | Get API Key
A MCP (Model Context Protocol) server that provides tools for discovering, downloading, parsing, and searching U.S. SEC financial reports.
It enables AI assistants (Claude, Cursor, etc.) to access SEC EDGAR data through 6 structured tools — from discovering available filings to keyword-searching within their pages.
Features
6 MCP tools for SEC financial data: state-driven retrieval (search directly, fallback to download/parse only when needed)
Professional SEC document parsing using edgartools — accurate page-break detection and structured node-tree extraction for iXBRL filings
Local keyword search with TF + position-boost scoring, zero external dependencies
Idempotent — already-downloaded/parsed files are automatically skipped
Zero-config install — one line to add to your MCP client, no clone or manual setup needed
Pure Python, cross-platform (Windows / macOS / Linux)
Related MCP server: filingrail-mcp
Prerequisites
Python 3.10+ — Download Python
uv — Install uv
Note: After installing uv, restart your terminal and MCP client (e.g. Cherry Studio) to ensure the
uvcommand is recognized.
Quick Start
Add to your MCP client configuration (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"mcp-sec": {
"command": "uvx",
"args": ["agentladle-mcp-sec"],
"env": {
"SEC_EMAIL": "your@email.com"
}
}
}
}That's it. uvx will automatically download the package and its dependencies from PyPI — no clone, no manual install, no path configuration.
⚠️ SEC Email Requirement: Replace
your@email.comwith your real email. The SEC requires a valid email in the User-Agent header. Using a fake email may result in your IP being blocked.
Alternative: pip install
If you prefer managing the environment yourself:
pip install agentladle-mcp-secThen configure:
{
"mcpServers": {
"mcp-sec": {
"command": "agentladle-mcp-sec",
"env": {
"SEC_EMAIL": "your@email.com"
}
}
}
}Alternative: Run from source (local development)
Clone the repository and run directly:
git clone https://github.com/agentladle/mcp-sec.gitThen configure your MCP client:
{
"mcpServers": {
"mcp-sec": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-sec", "agentladle-mcp-sec"],
"env": {
"SEC_EMAIL": "your@email.com"
}
}
}
}Replace /path/to/mcp-sec with the actual path to the cloned repository.
Data Flow
SEC EDGAR API Local Files (~/.agentladle/mcp-sec/data/)
────────────── ──────────────────────────────
company_tickers.json ──→ company_tickers.json (ticker→CIK mapping)
│
SEC Submissions API ──→ html/{TICKER_FORM_DATE}/ (Tool 2: primary + HTML exhibits)
│
edgartools parsing ──→ json/*.json (Tool 3: parse, page-split)
│
Local TF search ──→ search results (Tool 4: keyword search)
Page range read ──→ page content (Tool 5: read pages)
TOC lookup ──→ table of contents (Tool 6: get TOC)Tools
# | Tool | Description |
1 |
| Discover available SEC filings for a company |
2 |
| Download SEC filing; 6-K/8-K include HTML exhibits by default (PDF skipped) |
3 |
| Parse HTML into page-split JSON using edgartools |
4 |
| Full-text keyword search with TF relevance scoring |
5 |
| Read report content by page number range |
6 |
| Get the Table of Contents page(s) |
7 |
| Diagnostic: look up ticker→CIK mapping when CIK resolution fails |
Tool 1: list_sec_filings
List available SEC filings for a company. Use this tool ONLY when the exact year/date is unspecified by the user, or when a download attempt fails due to an invalid date.
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker, e.g. |
| string | ❌ | Filing type filter, e.g. |
| int | ❌ | Max filings to return, default 5, max 20 |
Tool 2: download_sec_report
Download a specific SEC filing from EDGAR. For 6-K/8-K, also downloads HTML exhibits by default (PDF exhibits are skipped, not parsed). Idempotent.
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker, e.g. |
| string | ✅ | Filing type: |
| string | ✅ | Report date (fiscal period end date), e.g. |
| bool | ❌ | Download HTML exhibits. Default: |
Tool 3: parse_sec_report
Parse a downloaded HTML filing into page-split JSON. Uses edgartools mark_page_breaks() + parse_html() for professional SEC document parsing.
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker |
| string | ✅ | Filing type |
| string | ✅ | Report date (fiscal period end date) |
Tool 4: keyword_search
Full-text keyword search across all pages. Results ranked by TF + position-boost score.
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker |
| string | ✅ | Filing type |
| string | ✅ | Report date (fiscal period end date) |
| string[] | ✅ | 1–5 search keywords |
| string | ❌ |
|
| int | ❌ | Max results to return, default 5, max 50 |
Tool 5: get_report_pages
Read full page content by page number range.
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker |
| string | ✅ | Filing type |
| string | ✅ | Report date (fiscal period end date) |
| int | ✅ | Start page number (1-based) |
| int | ❌ | Number of pages to return, default 3, max 5 |
Tool 6: get_report_toc
Get the Table of Contents page(s). Searches the first 10 pages for "Table of Contents".
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker |
| string | ✅ | Filing type |
| string | ✅ | Report date (fiscal period end date) |
Tool 7: lookup_ticker_cik
Diagnostic tool: look up ticker→CIK mapping. Use only when download_sec_report / list_sec_filings returns CIK not found or Ticker not found. Bypasses the session failed-ticker cache and returns same-CIK alias tickers.
Parameter | Type | Required | Description |
| string | ✅ | Stock ticker, e.g. |
| bool | ❌ | Force re-download of |
Configuration
On first run, a default config file is created at ~/.agentladle/mcp-sec/config.yaml:
sec:
email: ""
paths:
data_dir: "~/.agentladle/mcp-sec/data"
html_dir: "~/.agentladle/mcp-sec/data/html"
json_dir: "~/.agentladle/mcp-sec/data/json"
download:
delay_between_requests: 0.2
min_file_size: 5000The email field is used to build the SEC-compliant User-Agent header (AgentLadleMcpSec {email}). You can configure it in three ways (in order of priority):
Environment variable
SEC_EMAIL— recommended, set it in your MCP client JSON configConfig file — edit
~/.agentladle/mcp-sec/config.yamland setemailDefault — if empty, a placeholder email is used (not recommended for production)
⚠️ SEC User-Agent Policy: The SEC requires a real email in the User-Agent header. Using the default placeholder may result in your IP being blocked and can cause intermittent ticker→CIK lookup failures.
SEC_EMAILis required — please configure it.
Data Directory Structure
~/.agentladle/mcp-sec/
├── config.yaml # Configuration (auto-created)
└── data/
├── company_tickers.json # ticker→CIK mapping (auto-downloaded & cached)
├── html/ # Downloaded HTML filings
│ ├── AAPL_10-K_2025-01-31.htm
│ └── ...
└── json/ # Parsed page-split JSON
├── AAPL_10-K_2025-01-31.json
└── ...File naming convention: {TICKER}_{FORM}_{REPORT_DATE}.htm/json
Example Usage
The tools are designed with an EAFP (Easier to Ask for Forgiveness than Permission) approach. AI assistants should attempt to retrieve data directly and rely on errors to trigger downloads.
Scenario A: File already exists locally (Shortest Path)
User: "Analyze AAPL's latest 10-K management discussion"
1. keyword_search(ticker="AAPL", form="10-K", report_date="2025-01-31", keywords=["management", "discussion"])
→ Returns page snippets matching the keywords immediately.Scenario B: File missing (Fallback triggered)
User: "What is Tesla's 2024 revenue?"
1. keyword_search(ticker="TSLA", form="10-K", report_date="2024-12-31", keywords=["revenue", "net sales"])
→ Error: File not found.
2. download_sec_report(ticker="TSLA", form="10-K", report_date="2024-12-31")
→ Downloads HTML to ~/.agentladle/mcp-sec/data/html/
3. parse_sec_report(ticker="TSLA", form="10-K", report_date="2024-12-31")
→ Parses into JSON.
4. keyword_search(ticker="TSLA", form="10-K", report_date="2024-12-31", keywords=["revenue", "net sales"])
→ Retries search and returns data.Tech Stack
Component | Choice | Purpose |
MCP Framework |
| MCP server with stdio transport |
HTTP Client |
| SEC API requests & file downloads |
HTML Parsing |
| Professional SEC iXBRL parsing (page-break detection + node tree) |
Search | Python built-in | TF + position-boost scoring |
Config |
| YAML configuration file |
Project Structure
src/mcp_sec/
├── __init__.py
├── server.py # MCP Server entry point
├── config.py # Config loading (~/.agentladle/mcp-sec/config.yaml, singleton cached)
├── models.py # Data models
├── tools/
│ ├── list_filings.py # Tool 1: list_sec_filings
│ ├── download.py # Tool 2: download_sec_report
│ ├── parse.py # Tool 3: parse_sec_report
│ ├── search.py # Tool 4: keyword_search
│ ├── page.py # Tool 5: get_report_pages
│ └── toc.py # Tool 6: get_report_toc
└── services/
├── downloader.py # SEC EDGAR download + ticker→CIK
├── parser.py # HTML→JSON parsing (edgartools)
└── searcher.py # Local JSON search + TF scoringLicense
MIT
Available Tools
7 toolsdownload_sec_reportA
Download a SEC report from EDGAR for the specified company, form type, and report date. For 6-K/8-K, also downloads HTML exhibits by default (PDF exhibits are skipped, not parsed).
<critical_rules>
NEVER assume a file needs to be downloaded before attempting a search.
Upon a successful download, you MUST immediately call parse_sec_report to convert it into a searchable format before returning to your search.
If exhibits_skipped contains pdf_not_supported, PDF exhibit text is unavailable in this version. </critical_rules>
Args: ticker: Stock ticker symbol, e.g. "AAPL" form: Report type, e.g. "10-K", "10-Q", "20-F", "6-K", "8-K", "40-F" report_date: Report date (fiscal period end date) or fiscal year, e.g. "2023" or "2025-01-31" include_exhibits: Whether to download HTML exhibits. Default: true for 6-K/8-K, false otherwise. PDF exhibits are never parsed.
Inputs: form (required), ticker (required), report_date (required), include_exhibits. Returns: result
get_report_pagesA
Retrieve full page content for a range of pages from a report.
<critical_rules>
Do not use this tool blindly without knowing the target page. Find the start_page via keyword_search or get_report_toc first.
Keep page_count reasonable (default 3, max 5) to avoid context overflow. </critical_rules>
Args: ticker: Stock ticker symbol form: Report type report_date: Report date (fiscal period end date) start_page: Starting page number (1-based) page_count: Number of consecutive pages to return, default 3, max 5
Inputs: form (required), ticker (required), start_page (required), report_date (required), +1 more. Returns: result
get_report_tocA
Retrieve the Table of Contents of a report. Also returns structured section metadata (Item numbers and page locations) if available.
<critical_rules>
If you only need to locate specific numbers or singular facts, do NOT use this tool. Use keyword_search instead.
Reading TOC to find a chapter and then reading pages is much slower than direct keyword search. Use it only for broad contextual understanding. </critical_rules>
Args: ticker: Stock ticker symbol form: Report type report_date: Report date (fiscal period end date)
Inputs: form (required), ticker (required), report_date (required). Returns: result
keyword_searchA
Search parsed reports by keyword full-text search, results sorted by relevance (TF). Uses word-boundary matching for precise results.
<critical_rules>
NEVER pass full natural language sentences. You MUST extract 1 to 5 core keywords.
COGNITIVE TRANSLATION: Convert conversational terms to SEC financial terminology (e.g., "how much they made" -> "net income", "revenue").
SYNONYM EXPANSION: Maximize recall by providing synonyms (e.g., if looking for R&D, use ["R&D", "Research and Development", "Research"]).
Omit stop words entirely. </critical_rules>
User: "Did Tesla mention self-driving risks?" -> keywords=["self-driving", "autonomous", "FSD", "risk", "liability"], match_mode="ANY"
Args: ticker: Stock ticker symbol form: Report type report_date: Report date (fiscal period end date) keywords: 1-5 search keywords match_mode: "ANY" (any match) or "ALL" (all must match), default ANY max_results: Maximum number of matching snippets to return, default 5
Inputs: form (required), ticker (required), keywords (required), report_date (required), +2 more. Returns: result
list_sec_filingsA
List available SEC filings for a company.
<critical_rules>
If the user provides a specific year or date, SKIP this tool entirely and proceed directly to keyword_search or download_sec_report.
Use this tool ONLY if the user provides no timeframe, or if an attempt to download fails due to an invalid date/missing filing. </critical_rules>
User: "Give me Microsoft's latest 10-K details." -> Use list_sec_filings to find the most recent report_date, then proceed.
Args: ticker: Stock ticker, e.g. "AAPL" form: Filing type filter, e.g. "10-K". Omit to list all financial report types. limit: Max number of filings to return, default 5, max 20
Inputs: ticker (required), form, limit. Returns: result
lookup_ticker_cikA
Look up the SEC CIK mapping for a ticker symbol. Diagnostic / recovery tool.
<critical_rules>
This tool bypasses the session-level failed-ticker blacklist and can clear it.
Prefer refresh=false first (reads local cache). Use refresh=true only when total_entries is 0 or the ticker is still missing after a local lookup. </critical_rules>
Args: ticker: Stock ticker symbol, e.g. "BABA" refresh: Force re-download of company_tickers.json from SEC (default: false)
Inputs: ticker (required), refresh. Returns: result
parse_sec_reportA
Parse a downloaded HTML report (and HTML exhibits, if present) into a page-split JSON file. Typically called immediately after download_sec_report completes.
<critical_rules>
Never call this tool preemptively. Wait for the download to succeed or for a specific error prompt. </critical_rules>
Args: ticker: Stock ticker symbol, e.g. "AAPL" form: Report type, e.g. "10-K", "10-Q", "6-K", "8-K" report_date: Report date (fiscal period end date), e.g. "2025-01-31"
Inputs: form (required), ticker (required), report_date (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct stage of the SEC report lifecycle: discovery (list_sec_filings, lookup_ticker_cik), acquisition (download_sec_report), processing (parse_sec_report), and content access (keyword_search, get_report_pages, get_report_toc). The detailed strategy notes explicitly separate search vs. page reading vs. TOC retrieval, so an agent can reliably select the right tool.
Six of seven tools follow a clear verb_noun pattern (download_, parse_, get_, list_, lookup_), but keyword_search breaks the convention by leading with a noun/modifier instead of a verb (e.g., search_keywords would be consistent). Overall the pattern is still predictable and readable.
Seven tools is well-scoped for the server's purpose: a complete pipeline from ticker resolution to full-text search and page retrieval. Each tool covers a distinct function without redundancy, and the count sits comfortably in the ideal 3-15 range.
The tooling covers the full lifecycle of SEC report analysis: listing available filings, resolving tickers, downloading, parsing, searching, navigating via TOC, and reading specific page ranges. There are no obvious dead ends; the explicit fallback flow from error-prone tools to download/parse/lookup ensures agents can recover.
Maintenance
Related MCP Connectors
Provide AI assistants with real-time access to official SEC EDGAR filings and financial data. Enab…
SEC EDGAR filings for AI agents: company lookup, filings, financials, insider trades. No keys.
SEC EDGAR filings for AI agents: company lookup, filings, financials, insider trades. No keys.
SEC EDGAR filings for AI agents: 10-K, 8-K, 13F, insider trades, XBRL financials, full-text search.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to access SEC EDGAR data: search filings, extract sections, pull structured financials, and track insider transactions.20 npmMIT
- AlicenseAqualityCmaintenanceGive your AI agent live SEC EDGAR data: company financials, insider trades, 8-K events, 13F holdings, and the raw filings stream — all normalized to clean JSON, every number traceable back to its sec.gov source filing.845 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants direct access to SEC EDGAR filing data — financials, filings, and filing text — with no API key required.-
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to SEC EDGAR filings for retrieving company data, financial statements, and insider transactions with exact precision.1MIT