Recipes

SEC EDGAR filing analyst with promptfoo eval harness

From README links · today

Money, Bills & BenefitsResearch & Knowledge

MCP server plus promptfoo evals for grounded SEC filing Q&A.

What they did

They stood up the sec-edgar-mcp server so an AI assistant could pull primary-source SEC data instead of guessing: CIK lookup, company info and facts, 10-K/10-Q/8-K retrieval with section extraction, XBRL-parsed balance sheet, income statement and cash flow, and Form 3/4/5 insider transactions. Every response carries the SEC filing URL so a human can verify the number. They ran it over stdio via Docker (with the required -i flag for JSON-RPC) and set SEC_EDGAR_USER_AGENT to identify themselves per SEC fair-access norms. For platforms like Dify they switched to streamable HTTP on port 9870. To keep the assistant honest, they wired a promptfoo-based eval suite from the repo's evals/ directory, turning filing questions into repeatable test cases that check whether answers match the underlying filings rather than plausible-sounding fabrications.

How it went

A working, documented MCP server with a demo video, PyPI package, Docker image, and a CI eval workflow badge. The promptfoo suite gives regression coverage on filing Q&A, so prompt or tool changes can be checked before shipping. Numeric precision is the selling point: XBRL parsing plus source URLs means answers are traceable, not paraphrased.

Worth knowing

Not affiliated with or endorsed by the SEC; EDGAR and SEC are SEC trademarks. The HTTP transport ships with no authentication, so it is private-network only. You must supply a real user agent string with contact email. Eval coverage depends on the cases you write; the repo's suite is a starting point, not a guarantee of correctness on every filing type or edge-case XBRL tag.

Wiring

Install via Docker (docker run -i --rm -e SEC_EDGAR_USER_AGENT='Name (email)' stefanoamorelli/sec-edgar-mcp:latest) or pip/uv, then register it in the MCP client config under mcpServers. The -i flag is mandatory for stdio JSON-RPC. For HTTP-capable platforms, run python -m sec_edgar_mcp.server --transport streamable-http --port 9870 on a private network. The server wraps sec-edgar-toolkit and exposes company, filings, financials, and insider-trading tools. promptfoo sits outside the server: it drives an LLM that calls the MCP tools, then asserts on outputs, with the suite living in evals/ and running in GitHub Actions.

Try it yourself

Set up sec-edgar-mcp in this repo and build a promptfoo eval suite around it. 1) Add the MCP server config (Docker with -i and SEC_EDGAR_USER_AGENT set to a real name and email, or pip/uv install). 2) Create evals/ with promptfoo test cases that ask for revenue, net income, and risk-factor excerpts for three companies across a 10-K and a 10-Q, plus one insider-transaction question. 3) Assert each answer cites an SEC filing URL and that reported figures match the XBRL values. 4) Add a CI workflow that runs the evals on every push. Report pass/fail per case and flag any answer lacking a source URL.

Source

Tools in this stack

Run this stack

Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.

npx runchr install runchr/stack-promptfoo-and-sec-edgar-mcp
No CLI?curl -s https://api.runchr.com/api/recipes/runchr/stack-promptfoo-and-sec-edgar-mcp/manifest

This stack has no prompt yet. You get the tools and the wiring, not the prompt.

The manifest is also at api.runchr.com/api/recipes/runchr/stack-promptfoo-and-sec-edgar-mcp/manifest.