Skip to main content

MCP server for clean, normalized SEC EDGAR, FRED, ETF and index data

Project description

EdgarMCP

PyPI License: MIT CI

An MCP server that gives AI agents clean, normalized access to financial data: company fundamentals and insider trades from SEC EDGAR, macro series from FRED, real-time quotes via the Tradernet WebSocket feed, ETF/fund holdings from SEC NPORT-P, look-through analytics, and index snapshots.

Raw sources (XBRL, bulky filing HTML, ownership XML) are expensive and error-prone for agents — they burn tokens and trip up on parsing. EdgarMCP returns agent-ready JSON.

Installation

pip install mcp-edgar

This installs the edgarmcp console script (a stdio MCP server).

Quick start

Add it to an MCP client. For Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "edgarmcp": {
      "command": "edgarmcp",
      "env": {
        "FRED_API_KEY": "your-free-fred-key",
        "OPENFIGI_API_KEY": "optional-openfigi-key"
      }
    }
  }
}

Both keys are optional: without FRED_API_KEY the FRED-backed tools degrade gracefully; without OPENFIGI_API_KEY holding resolution runs in anonymous mode.

Tools

Tool Purpose
get_company_facts(ticker) Normalized fundamentals (revenue, EPS, margins, debt)
get_financial_statement(ticker, statement, period) Income/balance/cashflow as structured JSON
get_filings(ticker, form_type, limit) Recent SEC filings (10-K/10-Q/8-K) with metadata and document URLs
parse_filing_section(url, section) Extract a 10-K section (Risk Factors, MD&A) as clean text
get_insider_trades(ticker, limit) Form 3/4/5 insider transactions (who, role, buy/sell, volume)
get_macro_series(series_id, start, end) FRED macro series (rates, inflation, unemployment) with metadata
get_quote(ticker) Real-time L1 quote (last/bid/ask/volume) via the Tradernet WebSocket feed
get_etf_holdings(ticker, limit) ETF/fund holdings (top by weight) + AUM, NAV, asset/country mix from SEC NPORT-P
get_holdings_analysis(symbol, limit) Look-through of an ETF/index: sector breakdown + weighted net-margin/ROE with coverage
get_index(index) Index snapshot (S&P 500, NASDAQ-100, Dow, NASDAQ Composite): level from FRED, tracking ETF, holdings preview

Configuration

Variable Description Default
EDGAR_USER_AGENT User-Agent for SEC requests EdgarMCP/0.1 (contact: info+sec@birthday.tools)
EDGAR_RATE_LIMIT Requests per second 10
EDGAR_CACHE_DIR File cache directory edgar_cache
FRED_API_KEY Free FRED key for get_macro_series / index levels
OPENFIGI_API_KEY Optional OpenFIGI key for higher CUSIP/ISIN rate limit

Variables are read from the environment; locally you can put them in a .env file.

Architecture

Three isolated layers: a platform-independent data layer (HTTP client with a host allowlist, ticker/name/CUSIP/ISIN resolution, XBRL normalizers, filing/ownership/NPORT-P parsers, FRED, the Tradernet WebSocket client, OpenFIGI identifier mapping, look-through and index analytics); a cache layer (aggressive caching of immutable filings and FIGI mappings; mutable FRED series are not cached); and a thin MCP layer. The data layer knows nothing about MCP and ports unchanged between a marketplace and self-hosting.

Security

  • Outbound requests are restricted to an HTTPS host allowlist (SSRF defense), centralized across all sources (SEC, FRED, OpenFIGI).
  • Ownership and NPORT XML is parsed with defusedxml (XXE / billion-laughs defense).
  • Secrets (FRED / OpenFIGI keys) are redacted from error messages and never placed in URLs or cache keys.
  • Real-time quotes come from Tradernet's public anonymous WebSocket feed (wss://wss.tradernet.com/); a dedicated client with a hardcoded URL.
  • CUSIP/ISIN holding resolution goes through OpenFIGI (api.openfigi.com, allowlisted); on failure it falls back to name matching.

Data licenses

SEC EDGAR data is public domain, used with a descriptive User-Agent and the 10 req/s limit. FRED data is provided by the Federal Reserve Bank of St. Louis under its terms of use. Real-time quotes come from Tradernet's public anonymous WebSocket feed. CUSIP/ISIN → ticker mapping uses OpenFIGI (Bloomberg; free tier, 25 req/min anonymous, 250 req/min with a key).

License

MIT © 2026 birthday.tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_edgar-0.1.0.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_edgar-0.1.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_edgar-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_edgar-0.1.0.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcp_edgar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf6557cc48b63347a244e5714253d688c00430bf68ed7c4233492e781aa01cf9
MD5 e1b600f951d1d4284f2a6abca867706d
BLAKE2b-256 710cb78d93ebe379f41bef127e9677f4cfc0a100a894f5dcb0b18c1e34c88254

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_edgar-0.1.0.tar.gz:

Publisher: publish.yml on birthday-tools/edgarmcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_edgar-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_edgar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcp_edgar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9055daf1dab8b6f067e0ed86cf14b84e78c39d90f6e27b83d932157800b7439
MD5 8ce9b6eb6ca4aa12b57b8b658f791d8b
BLAKE2b-256 eaf2f4e9a86fcbf6dbabbd1d4a2447adffc2773fa196f083240eb87c9cab92f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_edgar-0.1.0-py3-none-any.whl:

Publisher: publish.yml on birthday-tools/edgarmcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page