> TickerLayer documentation for AI agents and LLMs, the Markdown version of https://tickerlayer.com/docs/mcp
> REST base URL https://api.tickerlayer.com, API key in the `x-api-key` header. WebSocket wss://stream.tickerlayer.com?apiKey=YOUR_API_KEY.
> Any docs page reads as Markdown at its URL plus `.md`. Index: https://tickerlayer.com/llms.txt · Full API reference: https://tickerlayer.com/llms-full.txt

# MCP Server

Give Claude, ChatGPT, Cursor, Gemini, the OpenAI API, or any MCP-compatible agent direct access to live and historical market data across seven asset classes plus 24/7 perpetual markets. One config block, one API key or OAuth sign-in.

## What it is

The [Model Context Protocol](https://modelcontextprotocol.io) (MCP) is the open standard AI assistants use to call external tools. The TickerLayer MCP server exposes the REST API as typed tools, so an agent asks for data directly instead of guessing HTTP paths.

- **Endpoint:** `https://mcp.tickerlayer.com/mcp` (Streamable HTTP)
- **Coverage:** Crypto, forex, stocks, indices, ETFs, commodities, perpetuals, bond yields and market status.
- **Sign-in:** Your TickerLayer API key, or an OAuth 2.1 sign-in for OAuth-capable clients such as the ChatGPT app.
- **Limits:** Every tool call passes the same plan entitlements and rate limits as a direct REST request.

## Connect your client

Copy your key from **Dashboard → API key** ([create a free account](https://tickerlayer.com/signup) if you need one), then add the server:

**Claude Code**

```bash
claude mcp add --transport http tickerlayer https://mcp.tickerlayer.com/mcp \
  --header "x-api-key: YOUR_API_KEY"
```

**Cursor**

```javascript
// .cursor/mcp.json
{
  "mcpServers": {
    "tickerlayer": {
      "url": "https://mcp.tickerlayer.com/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}
```

**OpenAI API**

```javascript
// Responses API with the hosted MCP tool: POST /v1/responses
// (the same tool block works in the Realtime API and the Agents SDK):
{
  "model": "gpt-5",
  "tools": [{
    "type": "mcp",
    "server_label": "tickerlayer",
    "server_url": "https://mcp.tickerlayer.com/mcp",
    "headers": { "x-api-key": "YOUR_API_KEY" },
    "require_approval": "never"
  }],
  "input": "How is Bitcoin doing vs gold today?"
}
```

**ChatGPT**

```javascript
// ChatGPT connects natively via OAuth, no API key to paste.
// (Developer mode is available on Plus, Pro, Business, Enterprise, Edu.)
//
// 1. ChatGPT (web) -> Settings -> Apps & Connectors
//    -> Advanced settings -> enable Developer mode.
// 2. Create a connector:
//      Name:            TickerLayer
//      MCP server URL:  https://mcp.tickerlayer.com/mcp
//      Authentication:  OAuth
// 3. Create -> ChatGPT redirects to the TickerLayer sign-in;
//    approve access once.
// 4. In a chat: open the + menu -> Developer mode -> enable TickerLayer.
//
// Requests run under your TickerLayer plan, rate limits, and quota.
```

**Gemini CLI**

```javascript
// ~/.gemini/settings.json
{
  "mcpServers": {
    "tickerlayer": {
      "httpUrl": "https://mcp.tickerlayer.com/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}
```

**VS Code / Copilot**

```javascript
// .vscode/mcp.json
{
  "servers": {
    "tickerlayer": {
      "type": "http",
      "url": "https://mcp.tickerlayer.com/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}
```

**Windsurf**

```javascript
// ~/.codeium/windsurf/mcp_config.json
// (note: Windsurf uses "serverUrl", not "url")
{
  "mcpServers": {
    "tickerlayer": {
      "serverUrl": "https://mcp.tickerlayer.com/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}
```

**Claude Desktop**

```javascript
// claude_desktop_config.json (Settings -> Developer -> Edit Config)
// Local mcp-remote bridge; requires Node.js 18+.
// The tested bridge version is pinned, and the key stays out of command args.
{
  "mcpServers": {
    "tickerlayer": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote@0.1.38", "https://mcp.tickerlayer.com/mcp",
        "--transport", "http-only",
        "--header", "x-api-key:${TICKERLAYER_API_KEY}"
      ],
      "env": { "TICKERLAYER_API_KEY": "YOUR_API_KEY" }
    }
  }
}
```

```json
{
  "mcpServers": {
    "tickerlayer": {
      "type": "http",
      "url": "https://mcp.tickerlayer.com/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}
```

- **After saving:** Reload configuration-file clients; API integrations need no restart. You should see `tickerlayer` with 12 tools, then ask a market question in plain language.
- **Claude Desktop:** Uses a local `mcp-remote` bridge and needs Node.js 18 or newer.
- **Other clients:** Grok, the OpenAI Agents SDK, LangChain, the Vercel AI SDK and any client that sets custom HTTP headers: the endpoint URL plus an `x-api-key` header.
- **ChatGPT app:** Signs in with OAuth 2.1 (PKCE, dynamic client registration, refresh tokens). In the **ChatGPT** tab: enable Developer mode, create a connector with the endpoint URL and OAuth, approve the TickerLayer sign-in, then enable TickerLayer from the `+` menu in a chat.
- **Other OAuth clients:** The URL alone: sign in when prompted, no API key needed.

## Available tools

Stocks use `COUNTRY:TICKER` (`US:KO`, `DE:SAP`, `SA:2222`); crypto and forex use joined pairs (`BTCUSD`, `EURUSD`). `list_symbols` tells an agent what the account can read.

| Tool | Returns |
| --- | --- |
| `get_quote` | Latest bid/ask quote for any symbol in any asset class. |
| `get_last_trade` | Most recent trade: price, size, timestamp. |
| `get_snapshot` | Consolidated view: last trade, quote, previous close, change and change percent. The best single call for "how is X doing right now". |
| `get_previous_close` | Previous completed daily OHLCV bar. |
| `get_history` | Historical OHLCV bars between two UTC dates: minute, hour, and day intervals. |
| `list_symbols` | Discover enabled symbols per asset class, with optional search filter. |
| `get_market_status` | Open / closed / pre-market / post-market across crypto, forex, and stock regions. |
| `get_market_sessions` | Session windows for a market or symbol on a date. |
| `get_market_holidays` | Holiday calendar: closures and early closes by region. |
| `get_bond_yield` | Latest government bond yield by country and tenor, e.g. US:10Y, DE:10Y. |
| `open_markets_board` | An interactive markets board for clients that render MCP Apps: ten widely followed markets with daily change, a chart for any of them, and search across every symbol. Opening it reads ten symbols, so it counts as ten requests; each chart is one more. |
| `search_symbols` | Search every symbol the account can read, across all asset classes, by ticker or name. Called by the board's search box; hosts keep it out of the model's tool list. |

## Example prompts

- “How is Bitcoin doing today? Compare it to gold.”
- “Pull daily EURUSD bars for June and summarize the trend.”
- “Is the US stock market open right now? When does Tokyo open next?”
- “What is the 10-year US Treasury yield, and how does Germany compare?”
- “Build me a watchlist snapshot: US:KO, US:JPM, BTCUSD, XAUUSD, with daily change.”

## Authentication & limits

- **API key:** Your standard key as an `x-api-key` header, or as `Authorization: Bearer`, on the hosted endpoint.
- **OAuth 2.1:** The server implements the MCP authorization spec: the client discovers the flow and requests run under the signed-in account.
- **Quota:** None of its own: plan entitlements, symbol access and [rate limits](https://tickerlayer.com/docs/limits) apply exactly as for REST.
- **403 in a tool result:** The plan does not include that data; see [pricing](https://tickerlayer.com/pricing).
- **Browsers:** The endpoint serves MCP clients and server runtimes; direct browser-origin requests are denied.

## llms.txt for code generation

Writing integration code with an AI assistant instead? Point it at the machine-readable reference so it never invents endpoints; both files follow the deployed API.

**Fetch the reference**

```bash
https://tickerlayer.com/llms.txt        # overview
https://tickerlayer.com/llms-full.txt   # every endpoint, symbol convention, and response shape
```
