This paper proposes a lightweight Market Context Protocol (MCP) server that ingests real-time bid/ask quotes from Swissquote’s public forex data feed and exposes normalized price and candle data as reusable tools for downstream applications. The system is designed for macro analysis, market orientation, and local-first architectures where free and consistent data is preferred over institutional-grade feeds.
Most free financial APIs provide aggregated or delayed data with limited transparency. Swissquote’s public BBO feed offers a rare combination of:
However, it lacks:
This project addresses these gaps by introducing an MCP-compatible data layer.
Data Flow:
Swissquote Feed → Ingestion Layer → Tick Store → Candle Engine → MCP Server → Client Apps
Ingestion Layer
Tick Store
Candle Engine
00:00–00:05, 00:05–00:10Handles:
MCP Server
Exposes tools:
get_price(symbol)get_candles(symbol, timeframe, limit)get_last_candle(symbol, timeframe)Stateless interface over stateful backend
{
"symbol": "XAU/USD",
"bid": 2334.12,
"ask": 2334.45,
"mid": 2334.285,
"timestamp": 1710000000000
}
{
"symbol": "XAU/USD",
"timeframe": "1m",
"open": 2330.10,
"high": 2335.00,
"low": 2329.80,
"close": 2334.20,
"start": 1710000000000
}
Determinism over accuracy Consistent data is more valuable than theoretically perfect data.
Clock-aligned candles A fixed 5-minute window is the primary market unit, even if not every trade is observed.
Raw data preservation Store ticks when useful, but the system can remain simple if 5m candles are the base layer.
Separation of concerns Ingestion, aggregation, and serving are independent layers.
Market orientation first The goal is perception and regime reading, not execution.
Stateless interface MCP tools should not depend on internal state assumptions.
A Swissquote-based MCP server provides a robust and flexible foundation for macro-level analysis and experimental trading systems. While not suitable for high-frequency trading, it offers an excellent balance between cost, control, and data quality for independent developers.