Skip to main content
Glama

sec-finance-ai MCP server

PyPI License: MIT

AI-powered SEC EDGAR integration: 23 tools on the official sec.gov APIs, in one Python file.

šŸš€ Thousands of downloads on ClawHub and OpenWebUI

10-K, 10-Q, 8-K, 20-F and proxy filings, the full text of any filing read in pages or searched, XBRL company facts and cross-company rankings, Form 4 insider trades, 13D/13G ownership, 13F fund portfolios, IPOs, and full-text search of every filing since 2001.

Use it in

Install

Repo

Claude, Cursor, VS Code, LangChain, Google ADK, Strands Agents and other MCP clients

uvx sec-finance-ai@latest

sec-ai-mcp

ClawHub skill for OpenClaw šŸš€ Thousands of downloads

openclaw skills install @lkcair/sec

sec-ai-skill

OpenWebUI tool šŸš€ Thousands of downloads

Get it on openwebui.com

sec-finance-ai

Python

from sec_finance_ai import Tools

sec-finance-ai

Install

Needs uv. No API key.

Claude Code:

claude mcp add sec-ai -e SEC_USER_AGENT="Your Name you@example.com" -- uvx sec-finance-ai@latest

VS Code:

code --add-mcp '{"name":"sec-ai","type":"stdio","command":"uvx","args":["sec-finance-ai@latest"],"env":{"SEC_USER_AGENT":"Your Name you@example.com"}}'

Claude Desktop, Cursor, Windsurf and other clients, in the client's MCP config file:

{
  "mcpServers": {
    "sec-ai": {
      "command": "uvx",
      "args": [
        "sec-finance-ai@latest"
      ],
      "env": {
        "SEC_USER_AGENT": "Your Name you@example.com"
      }
    }
  }
}

@latest picks up new releases when the client starts. Without uv: pip install sec-finance-ai, then use "command": "sec-finance-ai" with no args.

SEC_USER_AGENT is the name and e-mail the SEC asks programs to send. If it is not set, a default is sent.

Listed in the MCP Registry as io.github.lkcair/sec-ai. Every tool is read-only.

Related MCP server: mcp-edgar

Agent frameworks

The server runs over stdio with uvx sec-finance-ai@latest, so any framework with MCP support can load all its tools.

SEC_USER_AGENT is optional. MCP starts the server with a minimal environment, so pass it as shown; **os.environ keeps PATH, so uvx is found.

LangChain: pip install "langchain[mcp]" langchain-anthropic

import asyncio
import os
from langchain.agents import create_agent
from langchain.mcp import MCPAdapter

async def main():
    config = {"mcpServers": {"sec-ai": {
        "command": "uvx", "args": ["sec-finance-ai@latest"],
        "env": {**os.environ, "SEC_USER_AGENT": "Your Name you@example.com"},  # optional
    }}}
    async with MCPAdapter(config) as adapter:
        tools = await adapter.list_tools()
        agent = create_agent("claude-sonnet-5", tools)
        result = await agent.ainvoke({"messages": [{"role": "user", "content": "What does Apple's latest 10-K say about Greater China?"}]})
        print(result["messages"][-1].content)

asyncio.run(main())

Google ADK: pip install "google-adk[mcp]"

import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool import McpToolset
from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
from mcp import StdioServerParameters

root_agent = LlmAgent(
    model="gemini-flash-latest",
    name="sec_ai",
    instruction="Answer with the sec-ai tools.",
    tools=[McpToolset(connection_params=StdioConnectionParams(
        server_params=StdioServerParameters(
            command="uvx", args=["sec-finance-ai@latest"],
            env={**os.environ, "SEC_USER_AGENT": "Your Name you@example.com"},  # optional
        ),
        timeout=60,
    ))],
)

Strands Agents: pip install strands-agents

import os
from mcp import stdio_client, StdioServerParameters
from strands import Agent
from strands.tools.mcp import MCPClient

sec_ai = MCPClient(lambda: stdio_client(StdioServerParameters(
    command="uvx", args=["sec-finance-ai@latest"],
    env={**os.environ, "SEC_USER_AGENT": "Your Name you@example.com"},  # optional
)))
agent = Agent(tools=[sec_ai])
agent("What does Apple's latest 10-K say about Greater China?")

Example questions

  • What does Apple's latest 10-K say about Greater China?

  • What are Berkshire Hathaway's top holdings in its latest 13F?

  • Find every 8-K this year that mentions 'going concern'.

  • Which companies had the highest revenue in 2024?

MCP tools (22)

Filings

Tool

Parameters

Description

get_company_filings

ticker, form_type=null, limit=10, start_date=null, end_date=null

Get SEC filings for a company by ticker symbol

get_latest_10k

ticker

Latest 10-K with a short preview of its text

get_latest_10q

ticker

Latest 10-Q with a short preview of its text

get_recent_8k_filings

ticker, limit=5

Recent 8-K filings with a short preview of each

analyze_8k_filing

ticker

Get and summarize the latest 8-K filing for a company

get_proxy_statements

ticker, limit=3

Get proxy statements (DEF 14A) for a company

get_recent_ipos

limit=20, days=30

Get recent IPO activity from EDGAR

Reading inside a filing

Tool

Parameters

Description

get_filing_size

filing_url

Exact size of a filing document before downloading it

download_filing_text

filing_url, max_length=50000, offset=0, search=null

Read a filing in 50,000-character pages, search inside it, or get the link when it is over 25 MB

get_filing_documents

filing_url

List every document in a filing (main document, exhibits, XBRL, XML) with sizes and links

get_filing_content

ticker, filing_type=null, get_full_content=false, specific_metrics=null

Key financial figures from XBRL, or the full filing text in pages

Tool

Parameters

Description

full_text_search

query, form_type=null, start_date=null, end_date=null, limit=20

Search the full text of every EDGAR filing since 2001 (words or "exact phrase")

search_filings

query, form_type=null, start_date=null, end_date=null, limit=20

Search SEC filings by company name or other criteria

Ownership and insiders

Tool

Parameters

Description

get_insider_transactions

ticker, limit=20

Get insider trading transactions (Forms 3, 4, 5) for a company

get_beneficial_ownership

ticker, limit=10, schedule="all"

Get beneficial ownership reports (13D, 13G) for a company

get_13f_holdings

ticker_or_cik, limit=25

Get the latest 13F portfolio of an institutional investment manager

Financial data (XBRL)

Tool

Parameters

Description

get_company_facts

ticker

Get company facts from SEC XBRL data

get_company_concept

ticker, concept

Get specific financial concept data for a company

get_available_metrics

ticker, search_term=null

Discover available financial metrics for a company from SEC XBRL data

get_xbrl_frames

concept, period, unit="USD", taxonomy="us-gaap", limit=20

One financial concept across all reporting companies for one period, ranked

Utility

Tool

Parameters

Description

get_sec_api_status

Check SEC API status and connectivity

run_self_test

Run comprehensive self-test of all SEC-AI tools

License

MIT. All data comes from public SEC EDGAR databases. Not affiliated with the U.S. Securities and Exchange Commission.

Available Tools

22 tools
analyze_8k_filingB
Read-onlyIdempotent

Get and summarize the latest 8-K filing for a company.

Args: ticker: Stock ticker symbol

Returns: Dictionary containing 8-K summary with actual content

Inputs: ticker (required). Returns: result

download_filing_textA
Read-onlyIdempotent

Read or search the text of one SEC filing document. Three modes, chosen automatically:

  • mode 'text': returns content in pages of max_length characters. If has_more is true, call again with offset=next_offset to keep reading.

  • mode 'search': when search is given, returns snippets around each match with its position (use offset=position to read that part).

  • mode 'link_only': when the document is larger than the size limit, returns only the link and size so the user can open it. The exact size is checked BEFORE downloading.

Args: filing_url: Filing document URL (https://www.sec.gov/Archives/edgar/data/...) max_length: Characters per page (default 50,000) offset: Character position to start reading from (default 0) search: Optional word or phrase to find inside the filing (case-insensitive)

Returns: Dictionary with mode, filing_url, size_mb, total_characters and content/snippets

Inputs: filing_url (required), offset, search, max_length. Returns: result

get_13f_holdingsA
Read-onlyIdempotent

Get the latest 13F portfolio of an institutional investment manager.

Args: ticker_or_cik: Manager ticker (e.g. 'BRK-B') or CIK (e.g. '1350694' for Bridgewater) limit: Number of top positions to return (default 25)

Returns: Report period, total value, top_issuers (one row per company, share classes combined; use this for "largest holdings") and top_positions (one row per security: CUSIP, share class, put/call)

Inputs: ticker_or_cik (required), limit. Returns: result

get_available_metricsA
Read-onlyIdempotent

Discover available financial metrics for a company from SEC XBRL data.

This function lists ALL available metrics that can be requested via specific_metrics. Useful for AI to find exactly which metrics are available before requesting them.

Args: ticker: Stock ticker symbol (e.g., 'GME', 'AAPL') search_term: Optional search term to filter metrics (e.g., 'EBITDA', 'Revenue', 'Debt')

Returns: Dict containing: - all_metrics: List of ALL available metric names - filtered_metrics: List of metrics matching search_term (if provided) - metric_categories: Organized by category (income, balance_sheet, cash_flow, etc) - total_available: Total number of available metrics - example_ttm_metrics: Example metrics useful for TTM calculations

Inputs: ticker (required), search_term. Returns: result

get_beneficial_ownershipB
Read-onlyIdempotent

Get beneficial ownership reports (13D, 13G) for a company.

Args: ticker: Stock ticker symbol limit: Number of reports to return schedule: 'all' (default), '13D' (activist or control intent) or '13G' (passive holder)

Returns: Dictionary containing beneficial ownership information

Inputs: ticker (required), limit, schedule. Returns: result

get_company_conceptB
Read-onlyIdempotent

Get specific financial concept data for a company.

Args: ticker: Stock ticker symbol concept: XBRL concept (e.g., 'Revenues', 'NetIncomeLoss', 'Assets')

Returns: Dictionary containing concept data over time

Inputs: ticker (required), concept (required). Returns: result

get_company_factsB
Read-onlyIdempotent

Get company facts from SEC XBRL data.

Args: ticker: Stock ticker symbol

Returns: Dictionary containing company facts and financial metrics

Inputs: ticker (required). Returns: result

get_company_filingsA
Read-onlyIdempotent

Get SEC filings for a company by ticker symbol.

Args: ticker: Stock ticker symbol (e.g., 'AAPL', 'TSLA') form_type: SEC form type (e.g., '10-K', '10-Q', '8-K'). Can be a single string or a list of strings. If None, returns all forms. limit: Maximum number of filings to return (default: 10) start_date: Start date for filing search (YYYY-MM-DD format) end_date: End date for filing search (YYYY-MM-DD format)

Returns: Dictionary containing filing information

Inputs: ticker (required), limit, end_date, form_type, +1 more. Returns: result

get_filing_contentA
Read-onlyIdempotent

Get SEC financial data - SMART & EFFICIENT dual-mode approach.

╔════════════════════════════════════════════════════════════════════╗ ā•‘ GENERIC MODE (no specific_metrics parameter) ā•‘ ā•‘ - Returns 13 essential metrics for any financial analysis ā•‘ ā•‘ - 5 historical values per metric (sufficient for TTM calc) ā•‘ ā•‘ - Most token-efficient for general questions ā•‘ ā•‘ - Includes: Net Income, Revenues, Interest Expense, Taxes, ā•‘ ā•‘ Operating Income, Gross Profit, Assets, Liabilities, Equity, ā•‘ ā•‘ Depreciation, Shares Outstanding, Cash, Long-term Debt ā•‘ ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•

╔════════════════════════════════════════════════════════════════════╗ ā•‘ SPECIFIC MODE (provide specific_metrics parameter) ā•‘ ā•‘ - Returns ONLY the requested metrics you specify ā•‘ ā•‘ - Perfect for targeted analysis (TTM EBITDA, leverage ratios) ā•‘ ā•‘ - Minimal token usage - only fetch what you need ā•‘ ā•‘ - Example: ['NetIncomeLoss', 'DepreciationDepletionAndAmortization',ā•‘ ā•‘ 'InterestExpense', 'IncomeTaxExpenseBenefit'] ā•‘ ā•‘ - Use get_available_metrics(ticker) to discover all metrics ā•‘ ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•

WORKFLOW FOR TTM CALCULATIONS:

  1. Call: get_available_metrics(ticker='GME', search_term='Depreciation')

  2. Find needed metrics from results

  3. Call: get_filing_content(ticker='GME', specific_metrics=['NetIncomeLoss', ...])

  4. Calculate TTM from 5 historical values (last 4 quarters + 1 prior)

FILE HANDLING (get_full_content=True):

  • The exact document size is checked first (EDGAR filing index)

  • Up to 25MB: first 50,000 characters in full_content; if has_more, continue with download_filing_text(filing_url, offset=next_offset) or search it with search='keyword'

  • Over 25MB: link only (file_too_large=True), AI told via ai_note

Args: ticker: Stock ticker symbol (e.g., 'GME', 'AAPL') filing_type: Type of filing - '10-Q', '10-K', '8-K', etc. (None = get latest) get_full_content: If True, check and optionally download full filing text specific_metrics: List of specific metric names to fetch. If None, returns 13 essential metrics (generic mode). Example: ['NetIncomeLoss', 'Revenues', 'DepreciationDepletionAndAmortization'] Use get_available_metrics() to discover what's available.

Returns: Dict containing: - ticker, cik, company_name: Company identification - financial_metrics: Dict of requested/essential metrics with 5 historical values each - filing_date, filing_type: Filing metadata - mode: "generic" or "specific" - metrics_returned, values_per_metric: Data shape info - content_mode: 'text' or 'link_only' - full_content, has_more, next_offset: first page of the filing text - file_size_mb, filing_url, ai_note: size, link and what to do next

Inputs: ticker (required), filing_type, get_full_content, specific_metrics. Returns: result

get_filing_documentsA
Read-onlyIdempotent

List every document in a filing (main document, exhibits, XBRL, XML) with sizes and links.

Args: filing_url: Any URL inside the filing folder (https://www.sec.gov/Archives/edgar/data/CIK/ACCESSION/...)

Returns: Dictionary with the filing folder and its documents (name, size_bytes, url)

Inputs: filing_url (required). Returns: result

get_filing_sizeA
Read-onlyIdempotent

Get the exact size of a filing document BEFORE downloading it.

Use this to decide between reading the text (download_filing_text) and giving the user the link only. Sizes come from the EDGAR filing index.

Args: filing_url: Filing document URL (https://www.sec.gov/Archives/edgar/data/...)

Returns: size_bytes, size_mb, recommendation ('read_text' or 'link_only') and filing_url

Inputs: filing_url (required). Returns: result

get_insider_transactionsB
Read-onlyIdempotent

Get insider trading transactions (Forms 3, 4, 5) for a company.

Args: ticker: Stock ticker symbol limit: Number of transactions to return

Returns: Dictionary containing insider transaction information

Inputs: ticker (required), limit. Returns: result

get_latest_10kA
Read-onlyIdempotent

Get the latest 10-K filing for a company: filing link plus a SHORT preview of its text.

The preview is only the first 10,000 characters (cover page and first statements). When preview_is_partial is true, follow read_more: download_filing_text(filing_url, offset=...) pages through the rest, download_filing_text(filing_url, search='...') jumps to a section.

Args: ticker: Stock ticker symbol

Returns: Dictionary with the 10-K filing: filing_url, content_preview, preview_characters, total_characters, preview_is_partial and read_more

Inputs: ticker (required). Returns: result

get_latest_10qA
Read-onlyIdempotent

Get the latest 10-Q filing for a company: filing link plus a SHORT preview of its text.

The preview is only the first 10,000 characters (cover page and first statements). When preview_is_partial is true, follow read_more: download_filing_text(filing_url, offset=...) pages through the rest, download_filing_text(filing_url, search='...') jumps to a section.

Args: ticker: Stock ticker symbol

Returns: Dictionary with the 10-Q filing: filing_url, content_preview, preview_characters, total_characters, preview_is_partial and read_more

Inputs: ticker (required). Returns: result

get_proxy_statementsB
Read-onlyIdempotent

Get proxy statements (DEF 14A) for a company.

Args: ticker: Stock ticker symbol limit: Number of proxy statements to return

Returns: Dictionary containing proxy statement information

Inputs: ticker (required), limit. Returns: result

get_recent_8k_filingsA
Read-onlyIdempotent

Get recent 8-K filings for a company with a SHORT preview of each.

Each preview is only the first 5,000 characters. When preview_is_partial is true, follow read_more: download_filing_text(filing_url, offset=...) or download_filing_text(filing_url, search='...').

Args: ticker: Stock ticker symbol limit: Number of recent 8-K filings to return

Returns: Dictionary with 8-K filings: filing_url, content_preview, preview_characters, total_characters, preview_is_partial, read_more and extracted items

Inputs: ticker (required), limit. Returns: result

get_recent_iposA
Read-onlyIdempotent

Get recent IPO activity from EDGAR.

Args: limit: Max companies per list (default 20) days: Look-back window in days (default 30)

Returns: priced: final prospectuses (424B4, filed when an offering is priced) registrations: new S-1 / F-1 registration statements (companies preparing to list)

Inputs: days, limit. Returns: result

get_sec_api_statusB
Read-onlyIdempotent

Check SEC API status and connectivity.

Returns: Dictionary containing API status information

Inputs: no named parameters. Returns: result

get_xbrl_framesA
Read-onlyIdempotent

Compare one financial concept across ALL reporting companies for one period.

Args: concept: XBRL tag, e.g. 'Revenues', 'NetIncomeLoss', 'Assets' period: 'CY2024' (annual), 'CY2024Q3' (quarter) or 'CY2024Q4I' (balance-sheet instant) unit: 'USD' (default), 'USD-per-shares', 'shares' taxonomy: 'us-gaap' (default), 'ifrs-full', 'dei' limit: Number of top companies to return (default 20)

Returns: Companies ranked by value for that concept and period

Inputs: period (required), concept (required), unit, limit, +1 more. Returns: result

run_self_testA
Read-onlyIdempotent

Run comprehensive self-test of all SEC-AI tools.

Returns: Dictionary containing test results

Inputs: no named parameters. Returns: result

search_filingsB
Read-onlyIdempotent

Search SEC filings by company name or other criteria.

Args: query: Search query (company name, ticker, etc.) form_type: SEC form type to filter by start_date: Start date for search (YYYY-MM-DD) end_date: End date for search (YYYY-MM-DD) limit: Maximum number of results

Returns: Dictionary containing search results

Inputs: query (required), limit, end_date, form_type, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 22 tools

    Disambiguation3/5

    Several tools overlap in retrieving filings and financial data: get_company_filings, search_filings, and full_text_search all return filings; get_filing_content, get_company_facts, get_company_concept, get_available_metrics and get_latest_10k/10q all expose XBRL/financial data. Descriptions provide detail, but an agent could easily misselect among these. Some distinctions are clear (e.g., ownership forms, IPO, admin), but the financial/filing cluster is crowded.

    Naming Consistency4/5

    Nearly all tools use snake_case and a get_* prefix for retrievals, with a few verb variations (analyze_8k_filing, download_filing_text, search_filings, full_text_search, run_self_test). The pattern is predictable overall, though full_text_search lacks an explicit verb and search_filings breaks the get_* convention. Minor deviations only.

    Tool Count3/5

    22 tools for a broad SEC data server is on the heavy side; several financial-data tools could potentially be consolidated (e.g., get_company_facts, get_company_concept, get_available_metrics, get_filing_content). Many tools cover distinct form types and data domains, but the count feels slightly over-scoped rather than lean.

    Completeness4/5

    The surface covers filings, financial metrics, ownership (13F, 13D/G, insider, proxy), IPOs, XBRL frames, and admin checks, which is comprehensive for SEC EDGAR data. Minor gaps exist (e.g., no explicit tool for comparing a company's metrics across periods beyond get_company_concept/get_filing_content's 5 values, and no section-level extraction beyond text search). Overall, agents can complete most SEC research workflows.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Provides access to SEC EDGAR financial data, enabling AI agents to fetch company filings, financial metrics, and narrative sections. It supports natural-language metric searching and extracts structured data from 10-K, 10-Q, and 8-K reports.
      6
      40 PyPI
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to access SEC EDGAR data: search filings, extract sections, pull structured financials, and track insider transactions.
      20 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying of SEC EDGAR filings and financial data via natural language, offering tools for company lookup, filing retrieval, XBRL data, and full-text search.
      146 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to research US public company filings, financials, and insider transactions using SEC EDGAR data, with no API keys required. Provides tools for company lookup, recent filings, full-text search, financial facts, and insider activity.
      5
      1
      MIT