SEC Financial Analyst MCP
An MCP server that gives AI assistants source-cited financial analysis of US public companies from SEC EDGAR filings.
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
nullwith 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
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
-
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
-
SEC requires every request to identify its sender. Copy
.env.exampleto.envand add your name and email:SEC_USER_AGENT="Your Name your.email@example.com" -
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"] } } }
-
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
nullfor 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
Metadata
Release files for sec-financial-analyst-mcp 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sec_financial_analyst_mcp-1.0.2.tar.gz | 13.9 kB | Without provenance | Details for sec_financial_analyst_mcp-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sec_financial_analyst_mcp-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for sec_financial_analyst_mcp-1.0.2-py3-none-any.whl |
Total release size: 32.3 kB
Release files / sec_financial_analyst_mcp-1.0.2.tar.gz
| Download URL | sec_financial_analyst_mcp-1.0.2.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee2dd8dcd62c75a31e94dcb36955b3b2458367dc8467e611c56cff159b7d3282
|
|
BLAKE2b-256 checksum How to use checksums |
a395e73e1b80783be259b02587d2410ef142f5624292f30ff34c275c5a029cda
|
| 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.2-py3-none-any.whl
| Download URL | sec_financial_analyst_mcp-1.0.2-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98743f34864ce4e18822b8195fb1950f74157a979426edb287dd68b0946a6d94
|
|
BLAKE2b-256 checksum How to use checksums |
fd1d79ef119294cc2105ed13c1550038662cd2b42166fced4514df69f3594dea
|
| 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.2
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.