Skip to main content
Glama
stevielkim

sec-edgar-mcp

by stevielkim

sec-edgar-mcp

An MCP (Model Context Protocol) server that gives natural-language access to SEC EDGAR filings — company lookups, filing content, financial-statement figures, insider transactions, and filing-to-filing comparisons — over streamable HTTP, so any MCP client (Claude Code, Claude Desktop, etc.) can answer real filing-research questions grounded in real filings, not general knowledge.

Built as a portfolio piece demonstrating production-minded engineering around a public, rate-limited, unauthenticated API: a shared two-tier rate limiter, a coalescing cache, real-data-validated HTML/XML parsing, and a tool surface shaped by testing against a real LLM client, not just unit tests. The full design reasoning — and the tradeoffs behind it — lives in plans/architecture.md; the original requirements are in reference/product_spec.md.

Status: functionally complete through Milestone 7 (all 6 tools, tested against real EDGAR data and a real MCP client). Not yet deployed — this repo runs as a local server today; containerized deployment is Milestone 8.

Why HTTP, not stdio

SEC EDGAR requires a compliant User-Agent with contact info and enforces a per-IP rate limit (~10 req/s). Under stdio, every user's local process is its own uncoordinated IP — the rate limit is never actually exercised or enforced. Under HTTP, one deployment means one egress IP, one shared budget, and one place to get compliance, rate limiting, and caching right. That decision — and everything it forces (single-process invariant, global 429 backoff, cache design) — is spelled out in plans/architecture.md's Decision 0.

Related MCP server: SEC EDGAR MCP

Tools

Tool

What it does

resolve_company

Ticker or company name → canonical CIK, with explicit multi-candidate disambiguation when ambiguous

list_filings

A company's filings by form type and date range (metadata only — accession numbers, dates, form types)

get_filing_section

One named 10-K section (Business, Risk Factors, Properties, Legal Proceedings, Cybersecurity, Unresolved Staff Comments, Mine Safety Disclosures, MD&A), paginated

get_financial_facts

XBRL-sourced figures — revenue, net income, assets, and similar line items — for a company, annual (10-K) or quarterly (10-Q), grounded per value in the filing that reported it

compare_filing_sections

Structured added/removed/changed blocks between the same section across two 10-Ks — never a character diff

list_insider_transactions

Form 4 insider transactions for a company or person, value-sorted, filterable by transaction code and date range

Each tool's docstring is deliberately prescriptive about when to call it and what it doesn't cover — see src/sec_edgar_mcp/server/tools.py. The server's top-level instructions (in src/sec_edgar_mcp/server/app.py) state the full current scope boundary up front, so a client learns what's out of scope before trying a tool, not after a failed attempt.

Explicitly out of scope today (see reference/product_spec.md §7 for the full list and why): executive compensation (DEF 14A tables), 10-Q prose sections like a quarterly MD&A, 8-K event-type summarization, cross-company/ full-text search, and beneficial ownership above 5% (Schedule 13D/13G).

Quickstart

Requires Python 3.14+ and uv.

uv sync

SEC EDGAR requires a compliant User-Agent — the server fails fast at startup without one, rather than failing silently on the first request:

export SEC_EDGAR_USER_AGENT="your-app-name/0.1 (you@example.com)"

Run it:

uv run python -m sec_edgar_mcp

Starts a streamable-HTTP server on 127.0.0.1:8000 (configurable via SEC_EDGAR_HOST / SEC_EDGAR_PORT; see src/sec_edgar_mcp/config.py for every other tunable — rate limits, cache TTLs, retry/backoff — all have defaults, only the User-Agent is required).

Try it with MCP Inspector

uv run mcp dev src/sec_edgar_mcp/__main__.py

Opens a browser UI for calling each tool directly with raw JSON-RPC — good for verifying an individual tool's input/output shape, not for testing how an LLM actually selects between tools.

Connect it to Claude Code

With the server running:

claude mcp add --transport http sec-edgar-mcp http://127.0.0.1:8000/mcp

Start a new claude session (MCP servers load at session startup) and ask it a real question — e.g. "Has Apple's risk factor language around supply chain changed in the last two 10-Ks?" or "Show me every Form 4 insider sale by Nvidia executives in the last 90 days, sorted by value."

Development

uv run pytest          # unit + tool-layer tests (mocked EDGAR, no network)
uv run pytest -m live  # opt-in tests against real EDGAR
uv run ruff check .
uv run ruff format .
uv run mypy --strict src tests

Four tiers of automated tests, plus a fifth manual one — connecting the running server to a real MCP client and asking it natural-language questions — which is what actually found several of the bugs fixed in this repo's history (see plans/architecture.md's Testing section and recent commit messages for specifics). tests/fixtures/filings/ holds ~10 real, committed 10-K and Form 4 filings across filer sizes and eras — the parsers are validated against real data, not synthetic HTML.

Project layout

src/sec_edgar_mcp/
  config.py        # required SEC_EDGAR_USER_AGENT, everything else defaulted
  domain/           # Pydantic models (CIK, Filing, InsiderTransaction, FinancialFact, ...)
  edgar/            # rate limiter, cache, HTTP client, endpoint wrappers, parsers
  services/         # composition logic (resolve, compare, insiders, financials)
  server/           # MCPServer, @mcp.tool() adapters, logging, scope instructions
tests/
  fixtures/filings/ # ~10 real, committed SEC filings
plans/architecture.md    # full design reasoning and milestone history
reference/product_spec.md # original requirements + recorded scope decisions
F
license - not found
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    MCP server providing read-only access to SEC EDGAR filings, allowing LLMs to look up companies, search filings, and retrieve securities offering data.
    3
    1
    MIT
  • A
    license
    C
    quality
    C
    maintenance
    MCP server for accessing SEC EDGAR filings. Connects AI assistants to company filings, financial statements, and insider trading data with exact numeric precision.
    21
    348
    AGPL 3.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Hosted MCP server that gives AI agents real-time access to SEC EDGAR filings search, 10-K/8-K reading, XBRL financial facts, and insider-trade (Form 4) alerts.
    10
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    An MCP server that wraps SEC EDGAR APIs to provide company financial data, screening metrics, and disclosure signals for investment diligence, with every figure traced to its source filing.
    8
    MIT

View all related MCP servers

Related MCP Connectors

  • Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.

  • SEC XBRL MCP — wraps SEC EDGAR XBRL API (data.sec.gov)

  • SEC/XBRL issuer intelligence for crypto public companies via MCP, OpenAPI, x402, and MPP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stevielkim/sec-edgar-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server