How to Search SEC EDGAR from Codex
Codex CLI keeps you in the terminal and moves fast, but it can’t reach out to external data sources on its own. If you need to look up a public company’s CIK number, verify a ticker symbol, or resolve a company name against SEC EDGAR, you’d normally have to do that separately. AgentPatch’s SEC Company Search tool wires that capability directly into Codex.
Why This Matters
Any project that involves SEC filings starts with the same step: figure out the company’s CIK number. The CIK is how EDGAR identifies every registrant, and you need it to fetch filings, financial statements, or ownership data. It’s a simple lookup, but it interrupts your flow when you have to leave the terminal to do it.
With SEC Company Search available, Codex can resolve company names and ticker symbols to CIK numbers inline. You ask, it looks it up, and you keep moving. The tool searches the SEC’s company tickers database, prioritizing exact ticker matches and falling back to company name substring matching.
Setup
Add AgentPatch to ~/.codex/config.toml:
[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"
Then set your API key:
export AGENTPATCH_API_KEY=your_api_key
Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.
Example
You’re scripting a pipeline that ingests quarterly financials and need CIK numbers for a batch of companies. You tell Codex:
“Search SEC EDGAR for Tesla and give me its CIK number.”
Codex searches the SEC database:
Searching SEC EDGAR for "Tesla"...
Found:
Company: Tesla, Inc.
Ticker: TSLA
CIK: 0001318605
I can use this CIK with the sec-company-financials tool to pull Tesla's
latest financial statements. Should I grab the most recent 10-Q?
Codex resolved the name to a CIK and is ready to chain into the next step. This works just as well for partial matches — searching “micro” would surface Microsoft, Micron, and other matches so you can pick the right entity.
Each lookup costs 50 credits ($0.005), so batch lookups across dozens of companies stay cheap.
Wrapping Up
AgentPatch gives Codex direct access to SEC EDGAR’s company database from the terminal. Pair SEC Company Search with the SEC Company Financials tool and Codex can go from a company name to actual financial data in a single session. Explore both tools and more at agentpatch.ai.