Real-time & AI · Pro+
MCP server
Connect AI clients like Claude Desktop, Cursor and custom agents to live market data over the Model Context Protocol. Streamable HTTP transport and quota-free tool calls.
What is MCP?
AI-native access
get_rsi automatically.Connection
POST https://ai.realmarketapi.com/mcp
Content-Type: application/jsonSession flow
| Step | Request | Method | Purpose |
|---|---|---|---|
| 1 | POST /mcp | initialize | Get Mcp-Session-Id |
| 2 | POST /mcp | tools/list | Discover tools |
| 3 | POST /mcp | tools/call | Call a tool |
Claude Desktop
Add this to claude_desktop_config.json:
{
"mcpServers": {
"realtimemarket": {
"url": "https://ai.realmarketapi.com/mcp?apiKey={API_KEY}"
}
}
}VS Code
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
apiKey. Keys come from the account dashboard. The account linked to the key must have a verified email address.| Plan | MCP access |
|---|---|
| FREE | No |
| STARTER | No |
| PLUS | No |
| PRO | Yes |
| SCALE | Yes |
| BUSINESS | Yes |
| ENTERPRISE | Yes |
Rejected plans return
{ "error": "MCP access requires a PRO plan or higher." }Error response format
{ "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 |
Tool reference
Returns all trading symbols with display name and market class. Filtered to the subscription plan when apiKey is provided.
Parameters
| Name | Type | Description |
|---|---|---|
| apiKey | string | Omit for full public list |
[
{ "symbolCode": "BTCUSD", "displayName": "Bitcoin/USD", "marketClass": "Crypto" },
{ "symbolCode": "EURUSD", "displayName": "Euro / US Dollar", "marketClass": "Forex" }
]Returns supported OHLCV timeframe codes. Filtered to plan when apiKey is provided.
Parameters
| Name | Type | Description |
|---|---|---|
| apiKey | string | Omit for full list |
["M1", "M5", "M15", "H1", "H4", "D1"]Returns the latest real-time ticker for a symbol. Data is served from Redis — sub-second latency.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | e.g. "EURUSD", "BTCUSD" |
| timeframerequired | string | M1, M5, M15, H1, H4, D1 |
| apiKeyrequired | 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
}Returns the most recent 10 OHLCV bars for a symbol from the real-time feed.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeframerequired | string | Timeframe code |
| apiKeyrequired | 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.
Returns paginated historical OHLCV candles from the database. Lookback capped by plan.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Must be in plan |
| startTimerequired | DateTimeOffset | ISO 8601, before endTime |
| endTimerequired | DateTimeOffset | ISO 8601 |
| apiKeyrequired | string | Your API key |
| pageNumber | int | Page number (≥ 1) Default: 1 |
| pageSize | int | Items per page (1–200) Default: 50 |
{
"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.
Returns 24-hour baseline metrics for every tracked symbol. No API key required.
[
{
"symbolCode": "BTCUSD",
"lastOpenTime": "2025-03-19T10:00:00+00:00",
"lastClosePrice": 67500.00,
"closePrice24hAgo": 66000.00,
"change24hPercent": 2.27
}
]Calculates Simple Moving Average from the real-time feed.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeframerequired | string | Timeframe code |
| apiKeyrequired | string | Your API key |
| period | int | SMA period (2–500) Default: 20 |
[
{ "openTime": "2025-03-19T10:00:00+00:00", "value": 1.08410 },
{ "openTime": "2025-03-19T09:00:00+00:00", "value": 1.08395 }
]Newest first.
Calculates Exponential Moving Average from the real-time feed.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeframerequired | string | Timeframe code |
| apiKeyrequired | string | Your API key |
| period | int | EMA period (2–500) Default: 20 |
[{ "openTime": "2025-03-19T10:00:00+00:00", "value": 1.08425 }]Same shape as get_sma.
Calculates Relative Strength Index from the real-time feed. Above 70 = overbought, below 30 = oversold.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeframerequired | string | Timeframe code |
| apiKeyrequired | string | Your API key |
| period | int | RSI period (2–500) Default: 14 |
[
{ "openTime": "2025-03-19T10:00:00+00:00", "value": 62.35 },
{ "openTime": "2025-03-19T09:00:00+00:00", "value": 58.12 }
]Calculates MACD — line, signal line, and histogram.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeframerequired | string | Timeframe code |
| apiKeyrequired | string | Your API key |
| fastPeriod | int | Fast EMA period (2–500, must be < slowPeriod) Default: 12 |
| slowPeriod | int | Slow EMA period (2–500) Default: 26 |
| signalPeriod | int | Signal line period (1–500) Default: 9 |
[
{
"openTime": "2025-03-19T10:00:00+00:00",
"macd": 0.000234,
"signal": 0.000182,
"histogram": 0.000052
}
]Identifies support and resistance levels via pivot-point analysis. Levels with more touches ranked higher.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeframerequired | string | Timeframe code |
| apiKeyrequired | 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" }
]
}Returns composite market sentiment combining RSI(14), MACD histogram(12/26/9), and EMA-50/100 into a Fear & Greed score, trend label, and sentiment classification.
Parameters
| Name | Type | Description |
|---|---|---|
| symbolCoderequired | string | Trading symbol |
| timeFramerequired | string | Timeframe code |
| apiKeyrequired | string | Your API key |
{
"symbolCode": "EURUSD",
"timeFrame": "H1",
"calculatedAt": "2026-03-29T08:00:00Z",
"trend": "StrongUptrend",
"sentiment": "Greed",
"fearGreedScore": 68,
"rsi": 61.4,
"macdHistogram": 0.000312,
"ema50": 1.082540,
"ema100": 1.079810,
"currentClose": 1.084200
}RSI period is fixed at 14. MACD settings are fixed at fast=12, slow=26, signal=9. EMA periods are fixed at 50 and 100.
Data types
| 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).
Quick-start examples
TypeScript: npm install @modelcontextprotocol/sdk
Python: pip install mcp
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();import asyncio, json
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async def main():
async with streamablehttp_client("https://ai.realmarketapi.com/mcp") as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
# Support & resistance
result = await session.call_tool("get_support_resistance", {
"symbolCode": "BTCUSD",
"timeframe": "H4",
"apiKey": "YOUR_API_KEY"
})
data = json.loads(result.content[0].text)
print(data["supports"])
# Historical data
result = await session.call_tool("get_history", {
"symbolCode": "EURUSD",
"startTime": "2025-03-01T00:00:00Z",
"endTime": "2025-03-19T00:00:00Z",
"apiKey": "YOUR_API_KEY",
"pageSize": 100
})
history = json.loads(result.content[0].text)
print(f"Total candles: {history['totalCount']}")
asyncio.run(main())# Step 1 — Initialize (save Mcp-Session-Id header)
POST /mcp Content-Type: application/json
{ "jsonrpc":"2.0","id":1,"method":"initialize",
"params":{ "protocolVersion":"2024-11-05",
"clientInfo":{"name":"my-client","version":"1.0"},
"capabilities":{} } }
# Step 2 — List tools
POST /mcp Mcp-Session-Id: <id>
{ "jsonrpc":"2.0","id":2,"method":"tools/list","params":{} }
# Step 3 — Call a tool
POST /mcp Mcp-Session-Id: <id>
{
"jsonrpc": "2.0", "id": 3,
"method": "tools/call",
"params": {
"name": "get_macd",
"arguments": { "symbolCode":"EURUSD","timeframe":"H1","apiKey":"YOUR_API_KEY" }
}
}result.content[0].text as JSON. The MCP response wraps tool output as a text string.Tool summary
| 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 | None |
| get_sma | Required | PRO |
| get_ema | Required | PRO |
| get_rsi | Required | PRO |
| get_macd | Required | PRO |
| get_support_resistance | Required | PRO |
| get_sentiment | Required | PRO |
Try it in the Playground
Test MCP tool calls alongside REST and WebSocket, directly in your browser.