Skip to main content
Connect a client to https://api.stockcontext.com/mcp and the 21 public stockcontext_* tools load. Auth is the same X-API-Key header REST uses. This page gets you from zero to a verified stockcontext_snapshot call.
Keep the key in your client config, shell env, or a secret manager. Do not paste a full key into chat, logs, screenshots, or committed config.
1

Get a key

Create one at stockcontext.com/dashboard/keys. The raw secret (prefix sctx_) is shown once at creation. Export it so the client config below can reference it:
export STOCKCONTEXT_API_KEY="sctx_your_key_here"
2

Add the server

In Claude Code, register the hosted server over HTTP:
claude mcp add --transport http StockContext https://api.stockcontext.com/mcp \
  --header "X-API-Key: $STOCKCONTEXT_API_KEY"
For a client that reads JSON config (Cursor, for example), add the server to its MCP config:
mcp.json
{
  "mcpServers": {
    "StockContext": {
      "url": "https://api.stockcontext.com/mcp",
      "headers": {
        "X-API-Key": "sctx_your_key_here"
      }
    }
  }
}
3

Smoke test

Confirm the tools loaded, then call stockcontext_snapshot for AAPL:
{
  "tool": "stockcontext_snapshot",
  "arguments": { "symbol": "AAPL" }
}
You get the REST { "data": ... } envelope unchanged, as text JSON, structured content, or both, depending on the client:
stockcontext_snapshot AAPL (trimmed)
{
  "data": {
    "symbol": "AAPL",
    "name": "Apple Inc",
    "currency": "USD",
    "as_of": "2026-06-05T20:00:00Z",
    "freshness": "end_of_day",
    "market_status": "closed",
    "cache_age_seconds": 2,
    "quote": {
      "price": 307.34,
      "change_pct": -1.25,
      "previous_close": 311.23,
      "volume": 65310502
    },
    "asset_type": "stock",
    "sector": "Technology",
    "industry": "Consumer Electronics"
  }
}
Every success envelope carries freshness, as_of, market_status, and cache_age_seconds (int; 0 when freshly computed). Trimmed here; the live response also returns performance, range_52w, and a fundamentals_quick block where each headline multiple (pe_ttm, ps_ttm, pb, ev_ebitda_ttm) is a {value, vs_5y} object, not a bare float. See snapshot for the full payload.
4

What failure looks like

A REST error comes back in the { "error": ... } envelope, which most clients render as a tool-error string [CODE] message (retryable: ...). Two you should expect:
[UNAUTHORIZED] Missing or invalid X-API-Key header. (retryable: false)
[PLAN_UPGRADE_REQUIRED] This endpoint requires Starter or Builder. Free includes search, coverage, snapshot, and valuation. (retryable: false)
PLAN_UPGRADE_REQUIRED is an access result, not an outage. The full set of codes lives in error codes.

Troubleshooting

Two failure modes that look similar but have different causes:
  • No tools load at all. The client never reached or never authenticated with the server. Check the URL is exactly https://api.stockcontext.com/mcp, the transport is HTTP (not stdio), and the X-API-Key header is actually being sent. At the wire, a missing or invalid key is rejected during the handshake with a plain HTTP 401 carrying the REST error envelope, and most clients surface that as “no tools” or a connection error, not as a tool failure.
  • Tools load but a call errors. The connection and key work; the plan or arguments do not. Tool failures render as the bracket string: [PLAN_UPGRADE_REQUIRED] This endpoint requires Starter or Builder. … (retryable: false) means a Free key called a paid tool.
On Free, only stockcontext_search, stockcontext_coverage, stockcontext_snapshot, and stockcontext_valuation are available. See plans and limits for what each plan includes.

Custom clients

Writing your own client instead of using a turnkey one? The server speaks standard MCP over Streamable HTTP: POST JSON-RPC to https://api.stockcontext.com/mcp with your X-API-Key header plus Accept: application/json, text/event-stream, run the usual initializenotifications/initialized handshake, then tools/list and tools/call. Nothing here is StockContext-specific: any spec-compliant MCP client implementation works unchanged.

Tools reference

All 21 public tools, their REST routes, and argument conventions.