| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- """Pure MCP server over stdio."""
- from mcp.server.fastmcp import FastMCP
- import services
- from mcp_tools import MCP_TOOLS
- mcp = FastMCP("crypto-mcp")
- @mcp.tool()
- async def get_price(symbol: str):
- return await services.get_price(symbol)
- @mcp.tool()
- async def get_ohlcv(symbol: str, timeframe: str = "1h", limit: int = 100):
- return await services.get_ohlcv(symbol, timeframe, limit)
- @mcp.tool()
- async def get_indicator(symbol: str, indicator: str, timeframe: str = "1h", params: dict | None = None):
- return await services.get_indicator(symbol, indicator, timeframe, params or {})
- @mcp.tool()
- async def get_market_snapshot(symbol: str):
- return await services.get_market_snapshot(symbol)
- @mcp.tool()
- async def get_top_movers(limit: int = 10):
- return await services.get_top_movers(limit)
- @mcp.tool()
- async def get_capabilities():
- return await services.get_capabilities()
- @mcp.tool()
- async def get_regime(symbol: str, timeframe: str = "1h"):
- return await services.get_regime(symbol, timeframe)
- if __name__ == "__main__":
- mcp.run()
|