> ## Documentation Index
> Fetch the complete documentation index at: https://stockcontext.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP

> Connect an MCP client to StockContext's hosted Streamable HTTP endpoint.

StockContext has a hosted MCP endpoint:

```text theme={null}
https://stockcontext.com/mcp
```

Use the Streamable HTTP transport. Authenticate with the same API key you use for the REST API, sent as a bearer token:

```text theme={null}
Authorization: Bearer <your_stockcontext_api_key>
```

Create a key on the dashboard keys page: `https://stockcontext.com/dashboard/keys`.

<Warning>
  Keep the key server-side. Do not paste it into public repos, client bundles, logs, screenshots, or prompts.
</Warning>

## Claude Code

```bash theme={null}
export KEY="<your_stockcontext_api_key>"
claude mcp add --transport http stockcontext https://stockcontext.com/mcp --header "Authorization: Bearer $KEY"
```

## claude.ai and Claude Desktop

Add a custom connector with:

| Field     | Value                                               |
| --------- | --------------------------------------------------- |
| Name      | `stockcontext`                                      |
| URL       | `https://stockcontext.com/mcp`                      |
| Transport | Streamable HTTP / HTTP                              |
| Header    | `Authorization: Bearer <your_stockcontext_api_key>` |

If the client asks for an MCP server URL only, use `https://stockcontext.com/mcp` and add the bearer header in the connector's authentication or advanced headers section.

## Cursor and generic MCP JSON

Use a remote HTTP MCP server entry:

```json theme={null}
{
  "mcpServers": {
    "stockcontext": {
      "url": "https://stockcontext.com/mcp",
      "headers": {
        "Authorization": "Bearer ${STOCKCONTEXT_API_KEY}"
      }
    }
  }
}
```

For clients that only support local stdio MCP servers, use the bridge recommended by that client and configure it to send the same `Authorization: Bearer <key>` header to `https://stockcontext.com/mcp`.

## Tools

Tool surface: 10 data tools + stock\_flag, a feedback endpoint (not a data tool, not exposed over MCP). The MCP server exposes only those data tools and forwards each call to schema 2. The `schema` parameter may be omitted or sent; MCP always serves schema 2.

| MCP tool           | Mirrors REST endpoint             |
| ------------------ | --------------------------------- |
| `stock_search`     | `POST /v1/tools/stock_search`     |
| `stock_universe`   | `POST /v1/tools/stock_universe`   |
| `stock_reference`  | `POST /v1/tools/stock_reference`  |
| `stock_overview`   | `POST /v1/tools/stock_overview`   |
| `stock_financials` | `POST /v1/tools/stock_financials` |
| `stock_prices`     | `POST /v1/tools/stock_prices`     |
| `stock_technicals` | `POST /v1/tools/stock_technicals` |
| `stock_filings`    | `POST /v1/tools/stock_filings`    |
| `stock_insider`    | `POST /v1/tools/stock_insider`    |
| `stock_ownership`  | `POST /v1/tools/stock_ownership`  |

Tool results are the raw JSON response body as text. Non-`200` API responses are passed through too, because they are typed envelopes the agent should read.

## Refusals

A refused value is a first-class answer. In schema 2, unprovable values and unavailable blocks use typed `unavailable` / `reason` fields with recovery guidance. Do not retry a refusal hoping for a number; read the reason, report it, or follow the recovery action when one is provided.

For the full request parameters, see the [API reference](/docs/api-reference/overview) and the [Schema 2 docs](/docs/schema-2/overview).
