Skip to main content

SEC Financial Analyst MCP

An MCP server that gives AI assistants source-cited financial analysis of US public companies from SEC EDGAR filings.

PyPI Python 3.12+ License: MIT CI

Why

Ask a language model about a company's finances and it will answer confidently, but the numbers may be out of date, mixed up between years or invented. This server lets the model look up the figures instead:

  • Code computes, the model interprets. Ratios, cash metrics and growth rates are calculated deterministically from SEC XBRL data. The model only explains them.
  • Every number has a source. Each result names the 10-K it came from, its filing date, the formula used and the raw reported inputs.
  • Missing data stays missing. If a company does not report an input, the metric is null with a warning. It is never estimated.

Tools

Tool What it returns
search_company Companies matching a ticker or name, with their SEC CIK
get_company_profile Legal name, exchanges, industry, fiscal year end, state of incorporation
list_filings Recent 10-K or 10-Q filings with links to the original documents
get_financial_ratios Leverage, liquidity and profitability ratios, free cash flow and net debt for one fiscal year
get_metric_trend One metric over up to ten fiscal years, with year-over-year growth computed in code

All tools are read-only.

Example

Claude Desktop answering a question about Apple's revenue and free cash flow

Quick start

Requirements: uv.

Add the server to your Claude Desktop configuration (claude_desktop_config.json). SEC requires every request to identify its sender, so replace the placeholder with your name and email:

{
  "mcpServers": {
    "sec-financial-analyst": {
      "command": "uvx",
      "args": ["sec-financial-analyst-mcp"],
      "env": {
        "SEC_USER_AGENT": "Your Name your.email@example.com"
      }
    }
  }
}

Restart Claude Desktop and ask, for example: "How has Apple's free cash flow changed over the last five years?"

If Claude Desktop cannot find uvx, use its full path instead (where uvx on Windows, which uvx on macOS and Linux).

Run from source

  1. Clone the repository and install the dependencies:

    git clone https://github.com/Yigituysgl/sec-financial-analyst-mcp.git
    cd sec-financial-analyst-mcp
    uv sync
    
  2. SEC requires every request to identify its sender. Copy .env.example to .env and add your name and email:

    SEC_USER_AGENT="Your Name your.email@example.com"
    
  3. Add the server to your Claude Desktop configuration (claude_desktop_config.json), using the absolute path of the cloned folder:

    {
      "mcpServers": {
        "sec-financial-analyst": {
          "command": "uv",
          "args": ["--directory", "/path/to/sec-financial-analyst-mcp", "run", "sec-financial-analyst-mcp"]
        }
      }
    }
    
  4. Restart Claude Desktop.

How it works

Claude Desktop ──MCP (stdio)──▶ server.py         tool definitions and model instructions
                                    │
                                    ▼
                               services/          XBRL period selection, ratios, trends
                                    │
                                    ▼
                               clients/           SEC EDGAR HTTP client, rate limiting
                                    │
                                    ▼
                               SEC EDGAR APIs     submissions, company facts (XBRL)

The layers are separated so the financial logic can be tested without MCP and reused by other clients.

Design decisions

Decision Why
Values are selected by period end date, not by SEC's fy field Every 10-K repeats the prior year's figures, and both carry the same fy. Selecting by fy silently mixes two years.
When a period appears in several filings, the latest filing wins Companies restate past figures; the most recent filing has the corrected value.
Income and cash flow items must span about twelve months Annual reports also contain quarterly figures. Without this filter a quarter's revenue can replace a year's.
No proxy for an unreported item Apple does not report interest expense separately for fiscal 2026. A wrongly matched tag is more dangerous than an honest gap, so interest coverage is null.
Net debt = long-term debt + commercial paper − cash − short-term investments Long-term marketable securities are excluded as less liquid. LongTermDebt already includes its current portion, so the current and noncurrent tags are not added again.
Capital expenditure is subtracted from operating cash flow SEC reports it as a positive payment. Adding it by mistake would overstate free cash flow with no error raised.
Growth is null across a missing year or after a non-positive value A two-year change is never shown as one year's growth, and a percentage change from a negative base is meaningless.
Tool descriptions carry interpretation rules Large share buybacks inflate debt to equity and return on equity. The tool tells the model to judge leverage with net debt to free cash flow, and in testing it did.
SEC fair-access compliance Every request carries a User-Agent, requests are capped at 8 per second (SEC's limit is 10) and responses are cached in memory.

Development

uv run pytest        # unit tests
uv run ruff check    # lint
uv run ruff format   # format

The tests use small synthetic XBRL payloads, so they run offline and do not change when a company files a new report. Each one is built to fail if the rule it protects is removed.

Limitations

  • Covers US-listed companies that file XBRL financial statements with the SEC; annual 10-K data only.
  • Companies that report a line item under an uncommon tag will show null for that metric.
  • Net debt does not include lease liabilities.
  • Data is cached for the lifetime of the server process; restart it to pick up a newly filed report.

Roadmap

  • Risk factor extraction and comparison from 10-K text
  • Compound annual growth rate in trend results
  • MCP resources and prompts for methodology and common analyses

Disclaimer

This project is for research and educational use. It is not investment advice. Figures come from company filings with the SEC and may contain errors made by the filer.

License

MIT

Metadata

Release files for sec-financial-analyst-mcp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sec-financial-analyst-mcp 1.0.1
File Size Uploaded Provenance Actions
sec_financial_analyst_mcp-1.0.1.tar.gz 13.9 kB Without provenance Details for sec_financial_analyst_mcp-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sec-financial-analyst-mcp 1.0.1
File Interpreter ABI Platform Actions
sec_financial_analyst_mcp-1.0.1-py3-none-any.whl Python 3 none any Details for sec_financial_analyst_mcp-1.0.1-py3-none-any.whl

Total release size: 32.2 kB

Release files / sec_financial_analyst_mcp-1.0.1.tar.gz

Download URL sec_financial_analyst_mcp-1.0.1.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
375afccefea4ac6e5383b52dc1bb88fb1ba3ad48fbed2a2fcbd73d1e0e8412e4
BLAKE2b-256 checksum
How to use checksums
cbdc19c4b4048115479815e5639f2cad2c6dba8c326e64556cfa4b7af20b2b28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sec_financial_analyst_mcp-1.0.1-py3-none-any.whl

Download URL sec_financial_analyst_mcp-1.0.1-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e36eef4ca25dec86598a757078a07eeed3881d29bb9f67d20c35fbf2010e686
BLAKE2b-256 checksum
How to use checksums
cfc87a143f4a5ad752d8377c3fe9d3e7a95ac51edcce61783fa4966df69263f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for sec-financial-analyst-mcp 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page