INNER CODE UNIT · Python
create_server
flukelaster/ai-trading-agent · backend/mcp_server/server.py:33
def create_server() -> FastMCP:
"""Create and configure the MCP server with all trading tools."""
mcp = FastMCP("trading-agent-tools")
# ─── Market Data Tools (read-only) ───────────────────────────────────
@mcp.tool()
async def get_tick(symbol: str) -> dict:
"""Get current bid/ask tick for a trading symbol."""
return await market_data.get_tick(symbol)
@mcp.tool()
async def get_ohlcv(symbol: str, timeframe: str = "M15", count: int = 100) -> dict:
"""Get OHLCV candlestick data for a symbol."""
return await market_data.get_ohlcv(symbol, timeframe, count)
@mcp.tool()
async def get_spread(symbol: str) -> dict: