SEC Intelligence

io.github.jahanv01由 GitHub 帳號 jahanv01 發布v0.1.1更新於 Oct 25, 2026

SEC 10-K/10-Q/8-K search, RAG Q&A, comparison, and anomaly detection with citations.

概覽

AI 產生的概覽

本機 MCP 伺服器,索引 SEC 文件(10-K、10-Q、8-K),讓助理帶引用地回答問題、比較與摘要。

可以做什麼
擷取、解析並索引公司近期 SEC 文件,供後續提問使用(ingest_company_filings)。對已索引文件做語意檢索,回傳附引用的段落(search_filings)。針對特定問題給出有依據、附引用的回答,或產生整份文件的結構化摘要(analyze_filing、get_filing_summary)。就某一主題對 2 至 4 家公司做並列比較,各自依據其自身文件(compare_companies)。標記 MD&A 與風險揭露的同期變動,並從 8-K 財報中擷取關鍵指標、財測與管理層說法(detect_financial_anomalies、get_earnings_summary)。
適用情境
適合需要了解公司在 SEC 文件中實際寫了什麼、並附上章節引用的情境,而不是從資料 API 取數字。適用於風險因素、管理層說法、財測語氣以及跨公司比較的研究。
執行需求
以 Python 套件形式透過 uvx 在本機執行(或複製後用 uv 執行)。需要 GEMINI_API_KEY、LANGFUSE_PUBLIC_KEY 和 LANGFUSE_SECRET_KEY,以及指向本機 Docker Qdrant 或 Qdrant Cloud 叢集的 QDRANT_URL;QDRANT_API_KEY 僅在使用 Qdrant Cloud 時需要。選用 EMBEDDING_MODEL、GEMINI_MODEL 和 SEC_EDGAR_USER_AGENT。需能連線 SEC EDGAR、Gemini、LangFuse 和 Qdrant。
安裝前請注意
需要多項第三方憑證:GEMINI_API_KEY、LANGFUSE_PUBLIC_KEY 和 LANGFUSE_SECRET_KEY,使用託管 Qdrant 時還需 QDRANT_API_KEY。文件文字與問題會傳送給 Google Gemini 產生回答,追蹤資料會傳送到 LangFuse。索引過程會下載文件與向量並存放在本機或你的 Qdrant 執行個體中。README 說明自架部署使用未加密的 HTTP。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SEC Intelligence,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

🔎 SEC Intelligence MCP — Document-Grounded Financial AI

Ask Claude Desktop real questions about SEC filings — 10-Ks, 10-Qs, 8-Ks — and get answers quoted directly from the actual filing text, with a citation to the exact section (and page, where available) on every claim. Not a summary from training data. Not a guess.

Try it now: uvx sec-intelligence-mcp — see Quick install below.

Why this is different

Most finance-related MCP servers are data-API wrappers: they hand back numbers (revenue, EPS, price) from a database. None of the ones we surveyed read the actual filing documents, so none can answer a question that requires understanding what a company's management actually said — e.g. "how did NVIDIA's management explain the datacenter revenue surge?" or "did Amazon's forward guidance tone change between quarters?"

This server retrieves and quotes the real filing text with a citation on every claim, and its answer-generation prompt explicitly refuses to use prior/general knowledge when the retrieved passages don't contain the answer — verified live: asking about NVIDIA's non-existent "Mars operations" correctly returns "not present in the filing" rather than an invented answer. It also ships an automated RAGAS evaluation harness (see Evaluation results) that measures this claim on 50 real questions rather than just asserting it.


🚀 Quick install

Published on PyPI: https://pypi.org/project/sec-intelligence-mcp/. No clone, no build step — uv fetches and runs it on demand:

uvx sec-intelligence-mcp

That's the whole install. Two more things and you're ready to use it in Claude Desktop:

1. Get your free API keys

All four take under 5 minutes total, no credit card anywhere.

VariableWhere to get itRequired?
GEMINI_API_KEYhttps://aistudio.google.com/apikey — sign in with a Google accountYes
QDRANT_URLhttp://localhost:6333 if you run Qdrant locally via Docker (docker run -p 6333:6333 qdrant/qdrant), or a free cluster URL from https://cloud.qdrant.ioYes
LANGFUSE_SECRET_KEY / LANGFUSE_PUBLIC_KEYhttps://cloud.langfuse.com — free tier, create a project, copy both keys from Settings → API KeysYes
QDRANT_API_KEYOnly if using Qdrant Cloud instead of local DockerNo

Don't have Docker or want to skip signing up for Qdrant? See the note in Getting Qdrant running below.

2. Connect Claude Desktop

Add this to your claude_desktop_config.json (Windows: %APPDATA%\Claude\claude_desktop_config.json, macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "sec-intelligence-mcp": {      "command": "uvx",      "args": ["sec-intelligence-mcp"],      "env": {        "GEMINI_API_KEY": "your-key",        "QDRANT_URL": "http://localhost:6333",        "LANGFUSE_SECRET_KEY": "your-key",        "LANGFUSE_PUBLIC_KEY": "your-key"      }    }  }}

Restart Claude Desktop, open the tools list (hammer icon), and confirm sec-intelligence-mcp appears with a ping tool. That confirms the connection works before you rely on it for a real question.

3. Try it out

Every session starts by ingesting the company you want to ask about — that's what indexes its filings so they can be searched. Then just ask in plain English:

You: Ingest NVIDIA's last 2 annual filings

Claude (calls ingest_company_filings): Indexed 2 filings for NVIDIA — 312 chunks from FY2024's 10-K, 287 from FY2023's.

You: What did they say about risks from export controls?

Claude (calls analyze_filing): NVIDIA's FY2024 10-K identifies export control regulations as a primary risk: "The U.S. government has imposed, and may in the future impose, controls on the export of our products... restrictions to China, Hong Kong, and Russia have materially impacted our revenue." — [Item 1A — Risk Factors]

You: How does that compare to AMD?

Claude (calls compare_companies): [grounded side-by-side answer, cited to each company's own filing]

No prompt engineering, no special syntax — Claude picks the right tool automatically based on what you ask.


🧰 Available tools

ToolWhat it doesExample question
ingest_company_filingsFetches, parses, and indexes a company's recent SEC filings"Ingest NVIDIA's last 3 10-Ks"
search_filingsSemantic search across ingested filings, returns passages with citations"Search Apple's 10-K for anything about AI investment"
analyze_filingAnswers a specific question with a grounded, cited answer (RAG)"What were Apple's main risk factors in their 2024 10-K?"
get_filing_summaryStructured executive summary of a full filing (business, financials, MD&A, risks, outlook)"Summarize NVIDIA's latest 10-K"
compare_companiesSide-by-side comparison of 2-4 companies on a specific aspect, grounded in each company's own filing"Compare NVIDIA and AMD's AI chip strategy"
detect_financial_anomaliesFlags notable year-over-year changes in a company's MD&A/risk disclosures"Did NVIDIA's risk language around China change between 2023 and 2024?"
get_earnings_summaryExtracts headline metrics, guidance, and management commentary from a quarterly earnings release (8-K)"Summarize Apple's Q2 2024 earnings"

🛠️ Tech stack

Open source and free-tier first — no paid API is required to run this end to end.

LayerToolWhy
MCP protocolmcp Python SDKOfficial Anthropic SDK
SEC dataSEC EDGAR Full-Text & Submissions APIOfficial, free, no API key
Embeddingssentence-transformers — intfloat/e5-base-v2Runs on CPU, no GPU needed
Vector storeQdrantFree self-host (Docker) or Qdrant Cloud
Local cacheDuckDBTicker lookups, filing metadata, BM25 text
Keyword searchrank-bm25Hybrid retrieval alongside dense search
Rerankingsentence-transformers CrossEncoder (ms-marco-MiniLM-L-6-v2)Re-scores top candidates before the LLM sees them
HTML/PDF parsingbeautifulsoup4, pdfplumberCleans raw filing documents to text
LLMGoogle Gemini (free tier)Answer generation
ObservabilityLangFuseTracing, spans, faithfulness scores
EvaluationRAGASAutomated faithfulness/correctness/recall scoring
Testingpytest, pytest-asyncio120+ tests, fully mocked, no network calls
LintingRuff
CI/CDGitHub ActionsLint, test, Docker build, eval-gate on every PR
ContainerizationDocker + Docker Compose
DeploymentOracle Cloud "Always Free" tierReal persistent disk, up to 24GB RAM, $0
PackagingPyPI + uv/uvx, HatchlingOne-command install, no clone needed

🏗️ Architecture

mermaid
flowchart LR    A[Claude Desktop / MCP client] -->|MCP tool calls| B[sec-intelligence-mcp server]    B --> C[SEC EDGAR API]    B --> D[Qdrant<br/>vector search]    B --> E[Gemini<br/>answer generation]    B --> F[LangFuse<br/>tracing + eval scores]    C -->|filings| B    D -->|cited passages| B    E -->|grounded answer| B

📊 Evaluation results

Measured with RAGAS on 50 hand-verified question/ground-truth pairs across 5 companies (full methodology and raw results in eval/README.md):

Retrieval strategyFaithfulnessCorrectnessContext Recall
v1: semantic-only (dense embeddings)0.920.670.84
v2: hybrid (BM25 + semantic via RRF) — production default0.950.780.99
v3: hybrid + cross-encoder reranking0.980.821.00

CI's eval-gate fails any PR to main that drops faithfulness below 0.75 on a real, live-ingested subset of these questions — see .github/workflows/ci.yml.

LangFuse dashboard

A real trace of analyze_filing answering "What risks does NVIDIA face from export controls?" — the span tree shows retrieval and embedding nested under the tool call, alongside the LLM generation, with a faithfulness: 1.00 score attached automatically:

[LangFuse trace showing analyze_filing's span tree and a 1.00 faithfulness score]


👩‍💻 For developers

Want to run from source, contribute, or self-host instead of using the published package?

Getting Qdrant running

The simplest path is Docker: docker run -p 6333:6333 qdrant/qdrant. No Docker? Use a free Qdrant Cloud cluster instead and set QDRANT_API_KEY too.

Run from a local clone

  1. Install uv.
  2. Clone the repo and install dependencies:
    git clone https://github.com/jahanv01/sec-intelligence-mcp.gitcd sec-intelligence-mcpuv sync
  3. Copy .env.example to .env and fill in the keys from the table above.
  4. Start Qdrant locally:
    docker compose up -d qdrant
  5. Run the server directly:
    uv run python src/server.py
    Or with the MCP Inspector (dev UI, requires Node.js):
    uv run mcp dev src/server.py

For Claude Desktop, point it at your clone instead of the published package:

json
{  "mcpServers": {    "sec-intelligence-mcp": {      "command": "uv",      "args": [        "--directory",        "C:\\ABSOLUTE\\PATH\\TO\\sec-intelligence-mcp",        "run",        "python",        "src/server.py"      ]    }  }}

src/config.py fails fast at import time (raises RuntimeError) if any required key is missing.

Running via Docker

docker compose up -d builds the server image and starts it alongside Qdrant. The app service reads secrets from your local .env via env_file, and QDRANT_URL is overridden to http://qdrant:6333 (the in-network service name) since localhost inside the container would not reach the qdrant container.

Testing locally

uv run python -c "import mcp"                    # SDK installed correctlyuv run python scripts/test_server_stdio.py        # server responds over stdio (ping -> pong)docker compose up -d qdrantuv run python scripts/test_qdrant.py               # Qdrant round-trip works
# EDGAR data layer (each hits the real EDGAR API)uv run python scripts/test_edgar_lookup.py         # ticker -> CIK, DuckDB-cacheduv run python scripts/test_edgar_filings.py        # recent 10-K filings for a tickeruv run python scripts/test_edgar_parser.py         # download + clean a real filinguv run python scripts/test_edgar_sections.py       # section detection + metadata
# Embedding & retrieval pipeline (real model + real Qdrant)uv run python scripts/test_chunker.py              # section/paragraph chunkinguv run python scripts/test_encoder.py              # E5 embedding shape/latencyuv run python scripts/test_ingest.py               # chunk -> embed -> upsert to Qdrantuv run python scripts/test_search.py               # semantic search with citations
# MCP tools (real pipeline + real Gemini calls)uv run python scripts/test_tool_ingest_company_filings.pyuv run python scripts/test_tool_search_filings.pyuv run python scripts/test_tool_analyze_filing.pyuv run python scripts/test_tool_get_filing_summary.py
# Full mocked suite (no network calls)uv run pytest tests/ -m "not integration"

Project structure

src/├── server.py         # MCP server entrypoint├── tools/             # One file per MCP tool├── edgar/             # SEC EDGAR fetching + parsing├── embeddings/        # Chunking + embedding pipeline├── retrieval/         # Qdrant client + search + hybrid + rerank├── evaluation/         # RAGAS eval pipeline└── config.py          # Env var loading (fail-fast)tests/                  # Unit/integration testsprompts/                # Prompt templates (.txt)data/                   # Gitignored local cache (DuckDB, filing PDFs, Qdrant storage)eval/                   # Test questions + ground truth answersscripts/                # One-off dev/test scripts

Deploy your own instance

The published PyPI package is enough for personal use via Claude Desktop — you only need this if you want a standalone, publicly reachable server (e.g. for a remote MCP client).

Deployed on an Oracle Cloud "Always Free" compute VM (Ampere A1, ARM) rather than Render or Hugging Face Spaces: both of those give the container an ephemeral filesystem (wiped on every restart/redeploy) and cap free-tier RAM at 512MB, which doesn't comfortably fit the embedding model (e5-base-v2, CPU-only, ~440MB loaded) alongside the rest of the process. A real Always Free VM has neither constraint — genuine persistent disk and up to 24GB RAM — so Qdrant runs locally via the same docker-compose.yml used for local dev, with no separate Qdrant Cloud account needed.

Setup (one-time):

  1. Create an Always Free Ampere A1 compute instance (Ubuntu image) in the Oracle Cloud console, and note its public IP.
  2. In the VCN's Security List (not just the instance's own firewall — both must allow it), add an ingress rule for TCP port 8000 (and 22 for SSH, usually already open).
  3. SSH in, install Docker + the Compose plugin, then:
    git clone https://github.com/jahanv01/sec-intelligence-mcp.gitcd sec-intelligence-mcpcp .env.example .env   # fill in GEMINI_API_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEYecho "MCP_TRANSPORT=sse" >> .envsudo docker compose up -d --build
    QDRANT_URL doesn't need to be set in .env here — docker-compose.yml already overrides it to http://qdrant:6333, the in-network service name, for the app service.
  4. Also open the instance's own firewall for the port (Ubuntu ships iptables/ufw rules that block it even after the Security List allows it):
    sudo iptables -I INPUT -p tcp --dport 8000 -j ACCEPTsudo netfilter-persistent save   # or: sudo ufw allow 8000/tcp
  5. Confirm: curl http://<instance-public-ip>:8000/health returns ok.

Both services have restart: unless-stopped, so a VM reboot brings the whole stack back up without manual intervention. Plain HTTP (no TLS/domain) is used for now — fine for a demo, but a real production deployment would put Caddy or Nginx in front for HTTPS.

Alternative: Hugging Face Spaces. Also possible via the Docker SDK, using Qdrant Cloud instead of a local container (Spaces storage is ephemeral on restart, unlike a real VM). huggingface.co → New Space → SDK: Docker → add GEMINI_API_KEY, QDRANT_URL, QDRANT_API_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY as secrets and MCP_TRANSPORT=sse as a variable in Space Settings, then git push this repo to the Space's git remote.

🤝 Contributing

Issues and PRs welcome. See docs/edgar-api.md for EDGAR API quirks (rate limits, required User-Agent header) and eval/README.md before changing anything in the retrieval pipeline — a PR that regresses RAGAS faithfulness below 0.75 will fail CI's eval-gate job.

來源:README.md,提交 db8a295

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分