RealMarketAPI
MCP Β· Model Context Protocol Β· PRO+

MCP ServerAI-Native Market Data

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.

What is MCP?

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.

πŸ€–AI-native access: Your AI agent can ask β€œWhat is the RSI for EURUSD on H1?” and MCP routes it to get_rsi automatically.

Connection

Endpoint

POST https://ai.realmarketapi.com/mcp
Content-Type: application/json

The server uses Streamable HTTP transport. All operations (session init, tool listing, tool calls) go through this single endpoint.

Session Flow

1POST /mcp→initializeGet Mcp-Session-Id
2POST /mcp→tools/listDiscover tools
3POST /mcp→tools/callCall a tool

Claude Desktop Configuration

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "realtimemarket": {
      "url": "https://ai.realmarketapi.com/mcp?apiKey={API_KEY}"
    }
  }
}

VS Code Configuration

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": []
}

Authentication & Plan Requirements

API Key

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 Requirements

PlanMCP Access
FREEβœ•
STARTERβœ•
PROβœ“
SCALEβœ“
BUSINESSβœ“
ENTERPRISEβœ“
⚠️Rejected plans return: { "error": "MCP access requires a PRO plan or higher." }

Error Response Format

All errors (auth, validation, data-not-found) are returned as a JSON string:

{ "error": "<human-readable message>" }
ScenarioMessage
Missing / invalid API keyInvalid or unauthorized API key
Email not verifiedAccount email address has not been verified
Plan too lowMCP access requires a PRO plan or higher. Current plan: STARTER
Symbol not in planSymbol 'XYZABC' is not included in your subscription plan
Timeframe not in planTimeframe 'M1' is not included in your subscription plan. Available: H1, H4, D1
No live feed dataNo live price data found for EURUSD/H1. The feed may not be active.
Historical not in planHistorical data access is not included in your subscription plan
Invalid time rangestartTime must be earlier than endTime
Invalid periodperiod must be between 2 and 500
Invalid MACD periodsfastPeriod must be less than slowPeriod

Tool Reference

get_symbols
Auth: OptionalPRO (if key)

Returns all trading symbols with display name and market class. Filtered to the subscription plan when apiKey is provided.

Parameters

NameTypeRequiredDescription
apiKeystringβ€”Omit for full public list

Response

[
  { "symbolCode": "BTCUSDT", "displayName": "Bitcoin / USDT", "marketClass": "Crypto" },
  { "symbolCode": "EURUSD",  "displayName": "Euro / US Dollar", "marketClass": "Forex" }
]
get_timeframes
Auth: OptionalPRO (if key)

Returns supported OHLCV timeframe codes. Filtered to plan when apiKey is provided.

Parameters

NameTypeRequiredDescription
apiKeystringβ€”Omit for full list

Response

["M1", "M5", "M15", "H1", "H4", "D1"]
get_price
Auth: RequiredPRO

Returns the latest real-time ticker for a symbol. Data is served from Redis β€” sub-second latency.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“e.g. "EURUSD", "BTCUSDT"
timeframestringβœ“M1, M5, M15, H1, H4, D1
apiKeystringβœ“Your API key

Response

{
  "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_candles
Auth: RequiredPRO

Returns the most recent 10 OHLCV bars for a symbol from the real-time feed.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Trading symbol
timeframestringβœ“Timeframe code
apiKeystringβœ“Your API key

Response

[
  {
    "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_history
Auth: RequiredPRO + history

Returns paginated historical OHLCV candles from the database. Lookback capped by plan.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Must be in plan
startTimeDateTimeOffsetβœ“ISO 8601, before endTime
endTimeDateTimeOffsetβœ“ISO 8601
apiKeystringβœ“Your API key
pageNumberintβ€”Page number(default: 1)[β‰₯ 1]
pageSizeintβ€”Items per page(default: 50)[1–200]

Response

{
  "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_candles
Auth: NoneNone

Returns 24-hour baseline metrics for every tracked symbol. No API key required.

Response

[
  {
    "symbolCode": "BTCUSDT",
    "lastOpenTime": "2025-03-19T10:00:00+00:00",
    "lastClosePrice": 67500.00,
    "closePrice24hAgo": 66000.00,
    "change24hPercent": 2.27
  }
]
get_sma
Auth: RequiredPRO

Calculates Simple Moving Average from the real-time feed.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Trading symbol
timeframestringβœ“Timeframe code
apiKeystringβœ“Your API key
periodintβ€”SMA period(default: 20)[2–500]

Response

[
  { "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_ema
Auth: RequiredPRO

Calculates Exponential Moving Average from the real-time feed.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Trading symbol
timeframestringβœ“Timeframe code
apiKeystringβœ“Your API key
periodintβ€”EMA period(default: 20)[2–500]

Response

[{ "openTime": "2025-03-19T10:00:00+00:00", "value": 1.08425 }]

Same shape as get_sma.

get_rsi
Auth: RequiredPRO

Calculates Relative Strength Index from the real-time feed. Above 70 = overbought, below 30 = oversold.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Trading symbol
timeframestringβœ“Timeframe code
apiKeystringβœ“Your API key
periodintβ€”RSI period(default: 14)[2–500]

Response

[
  { "openTime": "2025-03-19T10:00:00+00:00", "value": 62.35 },
  { "openTime": "2025-03-19T09:00:00+00:00", "value": 58.12 }
]
get_macd
Auth: RequiredPRO

Calculates MACD β€” line, signal line, and histogram.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Trading symbol
timeframestringβœ“Timeframe code
apiKeystringβœ“Your API key
fastPeriodintβ€”Fast EMA period(default: 12)[2–500, must be < slowPeriod]
slowPeriodintβ€”Slow EMA period(default: 26)[2–500]
signalPeriodintβ€”Signal line period(default: 9)[1–500]

Response

[
  {
    "openTime": "2025-03-19T10:00:00+00:00",
    "macd": 0.000234,
    "signal": 0.000182,
    "histogram": 0.000052
  }
]
get_support_resistance
Auth: RequiredPRO

Identifies support and resistance levels via pivot-point analysis. Levels with more touches ranked higher.

Parameters

NameTypeRequiredDescription
symbolCodestringβœ“Trading symbol
timeframestringβœ“Timeframe code
apiKeystringβœ“Your API key

Response

{
  "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" }
  ]
}

Data Types Reference

TypeFormatExample
stringUTF-8"EURUSD"
int32-bit integer14
decimalHigh-precision1.08523
doubleFloating-point12345.67
DateTimeOffsetISO 8601 UTC"2025-03-19T10:00:00+00:00"

All timestamps are UTC (+00:00).

Quick-Start Examples

πŸ“¦TypeScript: npm install @modelcontextprotocol/sdk
Python: pip install mcp
mcp-client.ts
import { 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();
πŸ’‘Always parse result.content[0].text as JSON β€” the MCP response wraps tool output as a text string.

Tool Summary

ToolAuthMin Plan
get_symbolsOptionalPRO (if key)
get_timeframesOptionalPRO (if key)
get_priceRequiredPRO
get_candlesRequiredPRO
get_historyRequiredPRO + history
get_baseline_candlesβ€”None
get_smaRequiredPRO
get_emaRequiredPRO
get_rsiRequiredPRO
get_macdRequiredPRO
get_support_resistanceRequiredPRO
▢️

Try it live in the Playground

Test MCP tool calls alongside REST and WebSocket β€” run real requests against the API directly in your browser.

Open Playground