secapi-mcp
OfficialProvides SEC financial data tools within VS Code via GitHub Copilot, enabling AI-assisted analysis of filings, insider trades, and institutional holdings.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@secapi-mcp search for Apple's latest 10-Q filing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
secapi-mcp
Official Model Context Protocol server for secapi.dev.
Expose SEC filings, financial statements, insider trades, and institutional holdings as AI-native tools for Claude, Cursor, ChatGPT, Windsurf, VS Code, and any MCP-compatible client.
AI Client → MCP Tools → secapi.dev REST API → JSON Response → LLMThis server never talks to databases directly — it is a typed, validated interface over the secapi-node SDK.
Features
9 high-level AI tools designed for reasoning, not REST endpoint mirroring
SDK-first architecture — all API calls go through
secapi-nodeZod validation on every tool input
AI-friendly errors with categories, suggestions, and retry hints
Structured JSON responses with metadata and pagination
Extensible tool registry — add new tools in minutes
Production logging — structured, secrets-safe
Full test suite with Vitest
CI/CD with GitHub Actions and Changesets
Related MCP server: FinResearch MCP
Installation
npm install -g secapi-mcp
# or
pnpm add -g secapi-mcp
# or run via npx
npx secapi-mcpRequires Node.js 20+.
Quick Start
Get an API key from secapi.dev
Set your environment variable:
export SECAPI_API_KEY="your-api-key"Run the server (stdio transport):
secapi-mcpMCP Client Configuration
Cursor
Add to .cursor/mcp.json (or Cursor Settings → MCP):
{
"mcpServers": {
"secapi": {
"command": "npx",
"args": ["-y", "secapi-mcp"],
"env": {
"SECAPI_API_KEY": "your-api-key"
}
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"secapi": {
"command": "npx",
"args": ["-y", "secapi-mcp"],
"env": {
"SECAPI_API_KEY": "your-api-key"
}
}
}
}VS Code (GitHub Copilot)
Add to your VS Code MCP settings:
{
"mcp": {
"servers": {
"secapi": {
"command": "npx",
"args": ["-y", "secapi-mcp"],
"env": {
"SECAPI_API_KEY": "your-api-key"
}
}
}
}
}Windsurf
Add to Windsurf MCP configuration:
{
"mcpServers": {
"secapi": {
"command": "npx",
"args": ["-y", "secapi-mcp"],
"env": {
"SECAPI_API_KEY": "your-api-key"
}
}
}
}Available Tools
Tool | Description |
| Search SEC filings by ticker/CIK, form type, and date range |
| Get filing metadata and document list for deeper analysis |
| Search companies by name, ticker, or CIK |
| Company profile plus recent filings — ideal research starting point |
| Income statement, balance sheet, or cash flow |
| Financial ratio time series (ROE, margins, liquidity, etc.) |
| Insider buying/selling activity from Form 4 filings |
| Find institutional investors (13F filers) |
| 13F portfolio holdings for a given quarter |
Environment Variables
Variable | Required | Default | Description |
| Yes* | — | API key from secapi.dev |
| Yes* | — | Legacy alias for |
| No |
| API base URL |
| No |
| Request timeout in milliseconds |
| No |
| Retry count for transient failures |
| No |
| Enable debug logging to stderr |
| No |
| User-Agent header |
* One of SECAPI_API_KEY or SEC_API_KEY is required.
Architecture
src/
├── index.ts # stdio entry point
├── server/ # MCP server factory
├── client/ # secapi-node wrapper
├── config/ # Zod-validated configuration
├── errors/ # AI-friendly error categorization
├── logging/ # Structured, secrets-safe logging
├── schemas/ # Shared Zod schemas
├── utils/ # Response formatting
└── tools/
├── registry.ts # Tool registration system
├── types.ts # Tool definition interfaces
├── filings/ # Filing tools
├── companies/ # Company tools
├── financials/ # Financial statement tools
├── insiders/ # Insider trading tools
└── institutions/ # 13F institutional toolsAdding a New Tool
Create a tool definition in the appropriate
src/tools/<domain>/index.ts:
{
name: "my_new_tool",
description: "Clear description for the LLM...",
inputSchema: z.object({ ticker: tickerSchema }),
handler: async (input, { client }) => {
const data = await client.filings.search({ ticker: input.ticker });
return createToolResponse("my_new_tool", data.data, {
pagination: data.pagination,
});
},
}Export the module from
src/tools/index.tsif it's a new domain.
That's it — the registry handles validation, error formatting, and MCP registration.
Development
git clone https://github.com/secapi-dev/secapi-mcp.git
cd secapi-mcp
pnpm install
pnpm test
pnpm buildRun locally:
SECAPI_API_KEY=your-key pnpm startScripts
Script | Description |
| Build to |
| Run Vitest test suite |
| TypeScript type checking |
| ESLint |
| Prettier format |
Troubleshooting
"API key is required" — Set SECAPI_API_KEY in your MCP client config env block.
"Invalid or missing API key" — Verify your key at secapi.dev. Keys are never logged.
"API rate limit exceeded" — Wait and retry, or upgrade your plan.
Server not appearing in Cursor — Restart Cursor after editing MCP config. Check stderr logs with SECAPI_DEBUG=true.
FAQ
Why not mirror REST endpoints 1:1?
AI agents work better with semantic, high-level tools. company_overview is more useful than GET /entities/:id + GET /entities/:id/filings.
Can I self-host?
Yes. Set SECAPI_BASE_URL if using a custom API deployment.
How do I add more tools? See Adding a New Tool. The framework is designed for fast extension.
License
MIT — see LICENSE.
Links
secapi.dev — API platform
secapi-node — TypeScript SDK
Model Context Protocol — MCP specification
Available Tools
9 toolsanalyze_filingA
Retrieve a filing's metadata and list of attached documents (HTML, XBRL, exhibits). Use when you need to understand filing contents before deeper analysis. Requires CIK and accession number.
Examples:
analyze_filing({ cik: "0000320193", accessionNumber: "0000320193-24-000123" })
Inputs: cik (required), accessionNumber (required).
company_financialsA
Retrieve standardized financial statements for a company — income statement, balance sheet, or cash flow. Uses the latest available filing when no accession number is provided.
Examples:
company_financials({ identifier: "MSFT", statement: "income" })
company_financials({ identifier: "AAPL", statement: "balance" })
Inputs: identifier (required), statement, accessionNumber.
company_overviewB
Get a comprehensive overview of a public company by ticker or CIK, including recent SEC filings. Ideal starting point for company research.
Examples:
company_overview({ identifier: "AAPL" })
company_overview({ identifier: "0000320193", filingLimit: 10 })
Inputs: identifier (required), filingLimit.
company_ratiosB
Get financial ratio time series for a company (profitability, liquidity, leverage, efficiency). Useful for valuation and comparative analysis.
Examples:
company_ratios({ identifier: "AAPL", ratio: "roe" })
company_ratios({ identifier: "GOOGL", limit: 12 })
Inputs: identifier (required), limit, ratio.
insider_tradesB
Search insider trading transactions (Form 4 filings) by company ticker. Filter by buy/sell activity, transaction type, and date range. Returns officer and director trades.
Examples:
insider_trades({ ticker: "TSLA", activity: "buying", limit: 10 })
insider_trades({ ticker: "NVDA", activity: "latest" })
Inputs: ticker (required), limit, endDate, activity, +2 more.
institution_holdingsA
Get an institutional investor's 13F portfolio holdings for a given quarter. Shows positions, share counts, and market values. Requires institution CIK.
Examples:
institution_holdings({ cik: "0001067983", quarter: "2024-Q3" })
institution_holdings({ cik: "0001166559", limit: 50, sort: "weight" })
Inputs: cik (required), sort, limit, quarter.
search_companiesA
Search SEC-registered companies by name, ticker, or CIK. Returns entity metadata including company name, ticker, CIK, and entity type.
Examples:
search_companies({ query: "Apple" })
search_companies({ ticker: "MSFT" })
Inputs: cik, page, limit, query, +1 more.
search_filingsA
Search SEC EDGAR filings by company ticker or CIK. Filter by form type (10-K, 10-Q, 8-K, etc.) and date range. Use for discovering recent or historical regulatory filings.
Examples:
search_filings({ ticker: "AAPL", form: ["10-K", "10-Q"], limit: 5 })
search_filings({ cik: "0000320193", startDate: "2024-01-01" })
Inputs: cik, form, page, limit, +3 more.
search_institutionsA
Search institutional investment managers (13F filers) by name or CIK. Returns hedge funds, asset managers, and other institutions that file Form 13F.
Examples:
search_institutions({ query: "Berkshire" })
search_institutions({ query: "Vanguard", limit: 5 })
Inputs: page, limit, query.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: filing analysis, financials, company overview, ratios, insider trades, institutional holdings, and search functions for companies, filings, and institutions. No overlapping responsibilities.
All tool names use snake_case, but there is a mix of verb-first (analyze_filing, search_*) and noun-first (company_*, institution_holdings) patterns. While readable, the inconsistency prevents a perfect score.
With 9 tools, the server covers the essential SEC data retrieval operations without being bloated or too sparse. Each tool serves a well-defined need.
Core SEC filing and company data operations are covered (search, retrieve, analyze). Minor gaps exist, such as direct XBRL data extraction or historical filing comparisons, but the surface is largely complete for common workflows.
Maintenance
Related MCP Connectors
Primary-source SEC filing intelligence and financial/disclosure reconciliation for AI agents.
Provide AI assistants with real-time access to official SEC EDGAR filings and financial data. Enab…
SEC EDGAR financials, insider trading, and economic data for AI agents. US GAAP + IFRS.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables to search and retrieve SEC EDGAR filings, insider transactions, major shareholders, and executive compensation data through natural language.12 npmMIT
- FlicenseBqualityNot gradedmaintenanceEnables SEC EDGAR financial research, analysis, valuation, and chart data generation through natural language.24-
- FlicenseNot gradedqualityAmaintenanceEnables natural-language research and structured, source-backed answers across SEC filings, earnings transcripts, company financials, stock and crypto market data, and prediction markets news and research.-
- AlicenseNot gradedqualityAmaintenanceEnables users to ask natural-language questions and receive structured, source-backed answers across SEC filings, earnings transcripts, company financials, stock and crypto market data, and prediction markets news and research.MIT