TA-Lib MCP Server
Technical analysis indicators MCP server for Model Context Protocol.
Quick Start
Logging Configuration
The server requires a logging.conf file for configuration. Copy the example configuration:
You can customize the logging levels, format, and output file in logging.conf. The server logs to console.log to maintain MCP protocol compliance.
Core Indicators: SMA, RSI, MACD
Advanced Indicators: Bollinger Bands, Stochastic, ADX
Dual Transport: Both STDIO and HTTP support
Performance: Optimized for high-volume calculations
Error Handling: Comprehensive error handling with detailed messages
Monitoring: Metrics and health endpoints
Client Configuration
Claude Desktop Integration
Create a configuration file at
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or appropriate location for your OS.Add the MCP server configuration:
Restart Claude Desktop to load the TA-Lib server.
Verify installation by asking Claude: "What technical analysis tools do you have?"
HTTP Client Configuration
For HTTP transport, configure your client to connect to:
The server supports Server-Sent Events (SSE) for real-time updates.
MCP.js Client Example
Available Tools
The server provides the following MCP tools:
calculate_sma- Simple Moving Averagecalculate_ema- Exponential Moving Averagecalculate_rsi- Relative Strength Index
Documentation
See specs/001-ta-lib-mcp-server/quickstart.md for detailed usage instructions.
Development
License
MIT
HTTP API & CLI
This project now exposes the same MCP tools as both HTTP JSON endpoints and a Typed CLI (Typer).
HTTP endpoint:
POST /api/tools/{tool_name}Request JSON:
{ "close": [..], ...params }(e.g.timeperiod)Response JSON:
{ "success": true, "values": [...], "metadata": {...} }Example curl:
MCP endpoint remains at
/mcpfor MCP clients (MCP Inspector, MCP.js, etc.). The HTTP API mounts the MCP app so both APIs coexist.CLI (Typer):
src/mcp_talib/cli_tools.pyList tools:
Call a tool from the CLI:
Notes:
Requests are validated using Pydantic (
ToolRequest/ToolResult).The underlying indicator implementations remain the single source of truth (registered in the MCP
registry) — the HTTP API and CLI call the same code so results match.For browser clients, CORS is enabled and
mcp-session-idis exposed in responses.
This server cannot be installed