Connect AI clients like Claude Desktop, Cursor, and custom agents to live market data via the Model Context Protocol. 11 tools, Streamable HTTP transport, sub-second latency.
MCP (Model Context Protocol) is an open standard that lets AI clients (Claude Desktop, Cursor, custom agents) call server-side tools via a structured JSON-RPC protocol over HTTP.
Each tool corresponds to a market data operation. Clients discover available tools automatically and call them with typed parameters â no manual route wiring required.
get_rsi automatically.POST https://ai.realmarketapi.com/mcpContent-Type: application/jsonThe server uses Streamable HTTP transport. All operations (session init, tool listing, tool calls) go through this single endpoint.
POST /mcpâinitializeGet Mcp-Session-IdPOST /mcpâtools/listDiscover toolsPOST /mcpâtools/callCall a toolAdd this to your claude_desktop_config.json:
{ "mcpServers": { "realtimemarket": { "url": "https://ai.realmarketapi.com/mcp?apiKey={API_KEY}" } } }
Add this to your VS Code MCP settings (mcp.json):
{ "servers": { "mcp.manifest.realmarketapi": { "type": "http", "url": "https://ai.realmarketapi.com/mcp?apiKey={API_KEY}" } }, "inputs": [] }
Pass an API key as a plain string argument named apiKey. Keys are obtained from the account dashboard.
The account linked to the API key must also have a verified email address.
| Plan | MCP Access |
|---|---|
| FREE | â |
| STARTER | â |
| PRO | â |
| SCALE | â |
| BUSINESS | â |
| ENTERPRISE | â |
{ "error": "MCP access requires a PRO plan or higher." }All errors (auth, validation, data-not-found) are returned as a JSON string:
{ "error": "<human-readable message>" }
| Scenario | Message |
|---|---|
| Missing / invalid API key | Invalid or unauthorized API key |
| Email not verified | Account email address has not been verified |
| Plan too low | MCP access requires a PRO plan or higher. Current plan: STARTER |
| Symbol not in plan | Symbol 'XYZABC' is not included in your subscription plan |
| Timeframe not in plan | Timeframe 'M1' is not included in your subscription plan. Available: H1, H4, D1 |
| No live feed data | No live price data found for EURUSD/H1. The feed may not be active. |
| Historical not in plan | Historical data access is not included in your subscription plan |
| Invalid time range | startTime must be earlier than endTime |
| Invalid period | period must be between 2 and 500 |
| Invalid MACD periods | fastPeriod must be less than slowPeriod |
get_symbolsReturns all trading symbols with display name and market class. Filtered to the subscription plan when apiKey is provided.
| Name | Type | Required | Description |
|---|---|---|---|
apiKey | string | â | Omit for full public list |
[ { "symbolCode": "BTCUSDT", "displayName": "Bitcoin / USDT", "marketClass": "Crypto" }, { "symbolCode": "EURUSD", "displayName": "Euro / US Dollar", "marketClass": "Forex" } ]
get_timeframesReturns supported OHLCV timeframe codes. Filtered to plan when apiKey is provided.
| Name | Type | Required | Description |
|---|---|---|---|
apiKey | string | â | Omit for full list |
["M1", "M5", "M15", "H1", "H4", "D1"]
get_priceReturns the latest real-time ticker for a symbol. Data is served from Redis â sub-second latency.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | e.g. "EURUSD", "BTCUSDT" |
timeframe | string | â | M1, M5, M15, H1, H4, D1 |
apiKey | string | â | Your API key |
{ "symbolCode": "EURUSD", "openPrice": 1.08500, "closePrice": 1.08523, "highPrice": 1.08530, "lowPrice": 1.08490, "volume": 12345.67, "openTime": "2025-03-19T10:00:00+00:00", "bid": 1.08520, "ask": 1.08526 }
get_candlesReturns the most recent 10 OHLCV bars for a symbol from the real-time feed.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Trading symbol |
timeframe | string | â | Timeframe code |
apiKey | string | â | Your API key |
[ { "symbolCode": "EURUSD", "openPrice": 1.08500, "closePrice": 1.08523, "highPrice": 1.08530, "lowPrice": 1.08490, "volume": 12345.67, "openTime": "2025-03-19T10:00:00+00:00" } ]
Up to 10 bars, newest first.
get_historyReturns paginated historical OHLCV candles from the database. Lookback capped by plan.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Must be in plan |
startTime | DateTimeOffset | â | ISO 8601, before endTime |
endTime | DateTimeOffset | â | ISO 8601 |
apiKey | string | â | Your API key |
pageNumber | int | â | Page number(default: 1)[â„ 1] |
pageSize | int | â | Items per page(default: 50)[1â200] |
{ "totalCount": 1440, "pageNumber": 1, "pageSize": 50, "totalPages": 29, "items": [ { "symbolCode": "EURUSD", "openTime": "2025-03-19T10:00:00+00:00", "openPrice": 1.08500, "highPrice": 1.08530, "lowPrice": 1.08490, "closePrice": 1.08523, "volume": 12345.67, "bid": 1.08520, "ask": 1.08526 } ] }
Items ordered newest first. If startTime is before the plan's allowed lookback it is auto-clamped.
get_baseline_candlesReturns 24-hour baseline metrics for every tracked symbol. No API key required.
[ { "symbolCode": "BTCUSDT", "lastOpenTime": "2025-03-19T10:00:00+00:00", "lastClosePrice": 67500.00, "closePrice24hAgo": 66000.00, "change24hPercent": 2.27 } ]
get_smaCalculates Simple Moving Average from the real-time feed.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Trading symbol |
timeframe | string | â | Timeframe code |
apiKey | string | â | Your API key |
period | int | â | SMA period(default: 20)[2â500] |
[ { "openTime": "2025-03-19T10:00:00+00:00", "value": 1.08410 }, { "openTime": "2025-03-19T09:00:00+00:00", "value": 1.08395 } ]
Newest first.
get_emaCalculates Exponential Moving Average from the real-time feed.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Trading symbol |
timeframe | string | â | Timeframe code |
apiKey | string | â | Your API key |
period | int | â | EMA period(default: 20)[2â500] |
[{ "openTime": "2025-03-19T10:00:00+00:00", "value": 1.08425 }]
Same shape as get_sma.
get_rsiCalculates Relative Strength Index from the real-time feed. Above 70 = overbought, below 30 = oversold.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Trading symbol |
timeframe | string | â | Timeframe code |
apiKey | string | â | Your API key |
period | int | â | RSI period(default: 14)[2â500] |
[ { "openTime": "2025-03-19T10:00:00+00:00", "value": 62.35 }, { "openTime": "2025-03-19T09:00:00+00:00", "value": 58.12 } ]
get_macdCalculates MACD â line, signal line, and histogram.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Trading symbol |
timeframe | string | â | Timeframe code |
apiKey | string | â | Your API key |
fastPeriod | int | â | Fast EMA period(default: 12)[2â500, must be < slowPeriod] |
slowPeriod | int | â | Slow EMA period(default: 26)[2â500] |
signalPeriod | int | â | Signal line period(default: 9)[1â500] |
[ { "openTime": "2025-03-19T10:00:00+00:00", "macd": 0.000234, "signal": 0.000182, "histogram": 0.000052 } ]
get_support_resistanceIdentifies support and resistance levels via pivot-point analysis. Levels with more touches ranked higher.
| Name | Type | Required | Description |
|---|---|---|---|
symbolCode | string | â | Trading symbol |
timeframe | string | â | Timeframe code |
apiKey | string | â | Your API key |
{ "symbolCode": "EURUSD", "timeframe": "H1", "supports": [ { "price": 1.08200, "touchCount": 5, "lastTouchedAt": "2025-03-18T14:00:00+00:00" } ], "resistances": [ { "price": 1.08800, "touchCount": 4, "lastTouchedAt": "2025-03-19T08:00:00+00:00" } ] }
| Type | Format | Example |
|---|---|---|
string | UTF-8 | "EURUSD" |
int | 32-bit integer | 14 |
decimal | High-precision | 1.08523 |
double | Floating-point | 12345.67 |
DateTimeOffset | ISO 8601 UTC | "2025-03-19T10:00:00+00:00" |
All timestamps are UTC (+00:00).
npm install @modelcontextprotocol/sdkpip install mcpimport { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(
new StreamableHTTPClientTransport(new URL("https://ai.realmarketapi.com/mcp"))
);
// Live price
const price = await client.callTool({
name: "get_price",
arguments: { symbolCode: "EURUSD", timeframe: "H1", apiKey: "YOUR_API_KEY" }
});
console.log(JSON.parse(price.content[0].text));
// RSI(14)
const rsi = await client.callTool({
name: "get_rsi",
arguments: { symbolCode: "EURUSD", timeframe: "H1", apiKey: "YOUR_API_KEY" }
});
console.log(JSON.parse(rsi.content[0].text));
// 24h market overview â no key needed
const baseline = await client.callTool({
name: "get_baseline_candles",
arguments: {}
});
console.log(JSON.parse(baseline.content[0].text));
await client.close();result.content[0].text as JSON â the MCP response wraps tool output as a text string.| Tool | Auth | Min Plan |
|---|---|---|
| get_symbols | Optional | PRO (if key) |
| get_timeframes | Optional | PRO (if key) |
| get_price | Required | PRO |
| get_candles | Required | PRO |
| get_history | Required | PRO + history |
| get_baseline_candles | â | None |
| get_sma | Required | PRO |
| get_ema | Required | PRO |
| get_rsi | Required | PRO |
| get_macd | Required | PRO |
| get_support_resistance | Required | PRO |
Try it live in the Playground
Test MCP tool calls alongside REST and WebSocket â run real requests against the API directly in your browser.