Purpose
siftingio-mcp is the official TypeScript Model Context Protocol (MCP) server provided by SiftingIO, whose purpose is to expose the capabilities of the SiftingIO market data SDK (@siftingio/sdk) to AI assistants. Once the server is running, the model can pull real-time prices, query SEC/EDGAR fundamentals, fetch OHLCV candlesticks, query 13F holdings, check market status, and scan the macroeconomic calendar in the form of tools.
Main Capabilities
- Market data tools: real-time prices (last_trade, last_quote), historical OHLCV, fundamentals (stocks_profile, stocks_ratios), SEC/EDGAR filings (stocks_filings), earnings (stocks_earnings), insider transactions (stocks_insiders), ownership (stocks_ownership), events (stocks_events), compensation (stocks_compensation), search (stocks_search), DEX pool TVL (last_tvl), etc.
- Pagination tools support cursor / limit and return meta.next_cursor for paging; stocks_* list tools also support max_items, which can automatically collect a specified number of entries across pages in a single call.
- High-frequency tools (last_trade, last_quote, last_tvl, stocks_profile, stocks_search) have output schemas and return structuredContent in addition to human-readable text, making it easy for clients to read by machine.
- All tools have MCP annotations: data tools are readOnlyHint: true and openWorldHint: true (because they access external APIs); WebSocket tools that change connection state are readOnlyHint: false, destructiveHint: false.
- Result size is capped at about 60k characters (see MAX_RESULT_CHARS in src/util.ts). When heavy endpoints (full XBRL financial data, screeners, OHLCV candlesticks) return more than this limit, the server trims the largest arrays and appends a _truncated note indicating how to narrow the query.
- Real-time WebSocket streaming: the server maintains one persistent WebSocket connection, buffers incoming frames, and tools read from the buffer. Channels (the product field) include cex (crypto), dex (DEX trades), fx (forex), us (US stocks), tvl (DEX pool TVL). Two approaches are supported: subscribe + poll (after ws_subscribe, keep calling ws_poll; the first poll returns the recent tail, and passing the returned next_seq as after_seq retrieves only newer frames; ws_status shows connection and subscription status, ws_disconnect disconnects) and one-shot collection (ws_collect subscribes, waits up to duration_ms or until the maximum number of frames is reached, then returns and cleans up the subscription). The connection automatically reconnects and replays subscriptions; the buffer is a rolling window, old frames are dropped, and dropped / gap notifications are sent.
- Guided multi-tool workflows (clients can present them as slash commands): company_snapshot (ticker) combines stocks_profile, stocks_ratios, the latest stocks_filings, and last_trade; compare_companies (tickers) compares key ratios of multiple tickers side by side; market_now shows the current open/closed market status and upcoming high-impact macroeconomic events.
- Logging and shutdown: the server declares MCP logging capabilities, pushes structured notifications/message to the client on connection events (WebSocket open/close/reconnect/error) or shutdown, and also outputs them to stderr. On receiving SIGINT or SIGTERM, it closes the real-time WebSocket and cleanly shuts down the server before exiting.
Usage
An API key is required, available at https://sifting.io Obtain. To point at a different backend, override the defaults with SIFTING_BASE_URL and SIFTING_WS_URL. For local development, copy .env.example to .env; npm run dev and npm start load it automatically (Node loads it via --env-file-if-exists); when connecting to a real MCP client, pass secrets through the server's env block rather than a file.
Available commands:
- npm run build — compile TypeScript to dist/.
- npm start — run the compiled server over stdio (node dist/index.js).
- npm run start:http — run over Streamable HTTP (node dist/http.js).
- npm run dev / npm run dev:http — run directly from source with tsx, no build needed.
- npm test — run the vitest test suite (npm run test:watch to keep it running).
- npm run lint / npm run format — ESLint (typescript-eslint) and Prettier.
- npm run typecheck — tsc --noEmit.
CI (.github/workflows/ci.yml) runs on every push and PR: format check → lint → typecheck → build → test. The server transports JSON-RPC over stdio; stdout belongs entirely to the protocol, and diagnostics go to stderr.
For interactive inspection, use the MCP inspector. The HTTP (Streamable HTTP) transport is suited to remote or hosted scenarios: it is stateful, each client has its own session (tracked via the mcp-session-id header) and its own McpServer, while the upstream SiftingIO connection is shared across the whole process. For security, it binds only to the loopback address and rejects non-local browser Origins (DNS rebinding protection). The port is set via PORT(or MCP_HTTP_PORT), defaulting to 3000. For authentication, set MCP_AUTH_TOKEN, and the server will require every request to carry Authorization: Bearer <token> (missing or incorrect returns 401); combined with a reverse proxy handling TLS and tokens, this allows you to safely expose the server beyond localhost. Then point any MCP client that supports HTTP at http://127.0.0.1:3000/mcp .
Connecting an MCP client: place the configuration in the client config (such as Claude Desktop's claude_desktop_config.json), or use claude mcp add in Claude Code.
When to use
Suited to scenarios that need to give an AI assistant access to real-time and historical market data (stocks, forex, crypto, commodities, DEX), fundamentals, SEC filings, and market calendars, and also to workflows that need streaming quotes or guided company snapshots, company comparisons, and market status queries.
Limitations
Requires a SiftingIO API key; result size is capped at about 60k characters, and anything beyond is truncated; the WebSocket buffer is a rolling window, so old frames drop off; the HTTP transport by default binds only to the loopback address, so exposing it externally requires configuring authentication and a reverse proxy yourself.