Install Omni in LangChain
LangChain has first-party MCP support vialangchain-mcp-adapters (Python) and @langchain/mcp-adapters (JS). Both speak streamable HTTP and pass headers verbatim, so wiring up Omni is one config block.
Prerequisites
- Omni API key (free — 250 calls/month). Sign up at secapi.ai. Set
OMNI_DATASTREAM_API_KEY. - Python:
langchain-mcp-adapters≥ 0.2 withlangchain≥ 1.0 andlanggraph. - JavaScript / TypeScript (Node only):
@langchain/mcp-adapters≥ 1.1 with@langchain/core≥ 0.3.
Python
JavaScript / TypeScript
Verify
Run either snippet. The agent should call thefilings.latest tool with ticker: AAPL, form: 8-K and print the filing URL plus a short summary.
Troubleshooting
401 Unauthorized—x-api-keyis missing or wrong. Sanity check:curl https://api.secapi.ai/v1/limits -H "x-api-key: $OMNI_DATASTREAM_API_KEY".429 Too Many Requests— rate limit hit. SeeGET https://api.secapi.ai/v1/billingfor your plan’s cap.- No tools returned — confirm the URL ends in
/mcp(not/sse); the SSE transport is deprecated as of MCP 2025-03-26. - JS only: streaming notifications missing —
@langchain/mcp-adaptersdoes not yet propagate real-time MCP notifications over streamable HTTP. Tool calls and results work; long-running progress events do not.
Next
- Available tools — SEC + market data tools
- Give this prompt to your agent — canonical agent briefing for richer workflows