Skip to main content

SEC EDGAR MCP server for company filings and financial data

Project description

SEC EDGAR MCP

mcp-name: io.github.stefanoamorelli/sec-edgar-mcp

License: AGPL-3.0 Python: 3.11+ Platform: Windows | Mac | Linux Build Status PyPI Conda Version Verified on MseeP

https://github.com/user-attachments/assets/d310eb42-b3ca-467d-92f7-7d132e6274fe

[!IMPORTANT] EDGAR® and SEC® are trademarks of the U.S. Securities and Exchange Commission. This open-source project is not affiliated with or approved by the U.S. Securities and Exchange Commission.

Introduction 📣

SEC EDGAR MCP is an open-source MCP server that connects AI models to the rich dataset of SEC EDGAR filings. EDGAR (Electronic Data Gathering, Analysis, and Retrieval) is the U.S. SEC's primary system for companies to submit official filings. It contains millions of filings and "increases the efficiency, transparency, and fairness of the securities markets" by providing free public access to corporate financial information. This project makes that trove of public company data accessible to AI assistants (LLMs) for financial research, investment insights, and corporate transparency use cases.

Using the Model Context Protocol (MCP) – an open standard that "enables seamless integration between LLM applications and external data sources and tools" – the SEC EDGAR MCP server exposes a comprehensive set of tools for accessing SEC filing data. Under the hood, it leverages the EdgarTools Python library to fetch data from official SEC sources and performs direct XBRL parsing for exact financial precision. This means an AI agent can ask questions like "What's the latest 10-K filing for Apple?" or "Show me Tesla's exact revenue from their latest 10-K" and the MCP server will retrieve the answer directly from EDGAR's official data with complete accuracy and filing references.

[!TIP] If you use this software, please cite it following CITATION.cff, or the following APA entry:

Amorelli, Stefano (2025). SEC EDGAR MCP (Model Context Protocol) Server [Computer software]. GitHub. https://github.com/stefanoamorelli/sec-edgar-mcp

Usage 🚀

Once the SEC EDGAR MCP server is running, you can connect to it with any MCP-compatible client (such as an AI assistant or the MCP CLI tool). The client will discover the available EDGAR tools and can invoke them to get real-time data from SEC filings. For example, an AI assistant could use this server to fetch a company's recent filings or query specific financial metrics without manual web searching.

For comprehensive guides, examples, and tool documentation, visit the SEC EDGAR MCP Documentation.

Docker Configuration

To use SEC EDGAR MCP with Docker, add the following configuration to your MCP client:

{
  "mcpServers": {
    "sec-edgar-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SEC_EDGAR_USER_AGENT=Your Name (name@domain.com)",
        "stefanoamorelli/sec-edgar-mcp:latest"
      ],
      "env": {}
    }
  }
}

Demo: Here's a demonstration of an AI assistant using SEC EDGAR MCP to retrieve Apple's latest filings and financial facts (click to view the video):

In the demo above, the assistant uses SEC EDGAR MCP tools to retrieve Apple's filings and financial data, showcasing how EDGAR information is fetched and presented in real-time with exact precision and filing references. 📊

Documentation 📚

For installation and setup instructions, visit the SEC EDGAR MCP Quickstart Guide. For complete tool documentation, usage examples, and configuration guides, visit the SEC EDGAR MCP Documentation.

Architecture 🏗️

The SEC EDGAR MCP server acts as a middleman between an AI (MCP client) and the SEC's EDGAR backend:

  • 🔸 MCP Client: Could be an AI assistant (like Claude or other MCP-compatible tools) or any app that speaks the MCP protocol. The client sends JSON-RPC requests to invoke tools and receives JSON results.

  • 🔸 MCP Server (SEC EDGAR MCP): This server defines comprehensive EDGAR tools and handles incoming requests. It features:

    • Company Tools: CIK lookup, company information, and company facts
    • Filing Tools: Recent filings, filing content, 8-K analysis, and section extraction
    • Financial Tools: Financial statements with direct XBRL parsing for exact precision
    • Insider Trading Tools: Form 3/4/5 analysis with detailed transaction data
  • 🔸 EDGAR Data Sources: The server uses the edgartools Python library to access:

    • SEC EDGAR REST API: Official SEC endpoint for company data and filing metadata
    • Direct XBRL Parsing: Extracts financial data directly from SEC filings using regex patterns for exact numeric precision
    • Filing Content: Downloads and parses complete SEC filing documents (.txt format)

Key Features:

  • Deterministic Responses: All tools include strict instructions to prevent AI hallucination and ensure responses are based only on SEC filing data
  • Exact Precision: Financial data maintains exact numeric precision (no rounding) as filed with the SEC
  • Filing References: Every response includes clickable SEC URLs for independent verification
  • Flexible XBRL Extraction: Uses pattern matching to find financial concepts without hardcoded mappings

How it works: The MCP client discovers available tools (company lookup, financial statements, insider transactions, etc.). When invoked, each tool fetches data from SEC sources, applies deterministic processing rules, and returns structured JSON with filing references. This ensures AI responses are accurate, verifiable, and based solely on official SEC data.

Integrations

In its current form, the MCP server is configured to use the stdio transport. Integrations with platforms such as Dify will require switching to streamable HTTP, or possibly SSE depending on the required backwards compatibility). This can be done by passing a different --transport argument to server.py. However, it may also require editing server.py, because other arguments such as host may need to be passed to the FastMCP constructor.

References 📚

  • SEC EDGAR – About EDGAR, SEC.gov (2024). EDGAR is the SEC's database for electronic company filings.

  • Model Context Protocol (MCP) – Official documentation and SDKs. ModelContextProtocol.io – An open standard for connecting LLMs to tools.

  • EdgarTools – A modern Python library for accessing SEC EDGAR data with powerful filing analysis capabilities. GitHub repo, Documentation.

Contributors 🤝

A big thank you to all the contributors who have helped make this project better!

License ⚖️

This open-source project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). This means:

  • You can use, modify, and distribute this software
  • If you modify and distribute it, you must release your changes under AGPL-3.0
  • If you run a modified version on a server, you must provide the source code to users
  • See the LICENSE file for full details

For commercial licensing options or other licensing inquiries, please contact stefano@amorelli.tech.


© 2025 Stefano Amorelli – Released under the GNU Affero General Public License v3.0. Enjoy! 🎉

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

sec_edgar_mcp-1.0.5.tar.gz (48.3 kB view details)

Uploaded Source

Built Distribution

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

sec_edgar_mcp-1.0.5-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file sec_edgar_mcp-1.0.5.tar.gz.

File metadata

  • Download URL: sec_edgar_mcp-1.0.5.tar.gz
  • Upload date:
  • Size: 48.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sec_edgar_mcp-1.0.5.tar.gz
Algorithm Hash digest
SHA256 01758d46836038b2a3c9771ffee6318dd50df9bc9bdcc2d550a357f254008e6f
MD5 aeb4a19562781650eb7466c3905fc608
BLAKE2b-256 07c2d5f2a96672d93e03b3aaf6d34cd9239422a49768790a1ff11fecf281aea8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sec_edgar_mcp-1.0.5.tar.gz:

Publisher: publish_pypi.yml on stefanoamorelli/sec-edgar-mcp

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

File details

Details for the file sec_edgar_mcp-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: sec_edgar_mcp-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sec_edgar_mcp-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a3eeb8f9501f1f7a4d4e4f47fec374aa4f861a19766966ed385466a31d24b1ba
MD5 513ea27cf7d143717ff5ce7d14616985
BLAKE2b-256 71f4a57180933bcbf8b4be33a688879d736abd87072c60d66d5b76e1202a22c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sec_edgar_mcp-1.0.5-py3-none-any.whl:

Publisher: publish_pypi.yml on stefanoamorelli/sec-edgar-mcp

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