The MCP Chart Server generates customizable TradingView charts via Chart-IMG API with real-time updates through Server-Sent Events (SSE). With this server, you can:
- Generate various chart types (candlestick, line, area, Heikin Ashi, baseline, hi-lo) with customizable parameters
- Track chart generation progress in real-time via SSE
- Check status of specific chart generation requests
- Retrieve lists of available trading symbols
- View history of recent chart generation requests
- Perform health checks to verify server and API configuration
- Customize charts with annotations, themes, timezones, and technical indicators
- Choose from multiple time intervals (1 minute to 1 month)
- Access a built-in web interface for API testing, SSE monitoring, and chart preview
- Interact with the server using the Model Context Protocol over STDIO or HTTP
Supports Apple Inc. (NASDAQ:AAPL) stock data visualization as one of the available trading symbols.
Supports Binance cryptocurrency trading pairs (e.g., BINANCE:BTCUSDT) for chart generation using the TradingView format.
Supports Bitcoin trading pairs for chart visualization when using appropriate exchange prefixes.
Uses .env files for configuration management, particularly for storing the Chart-IMG API key.
Supports Git for version control and initial project setup through cloning.
Provides specific configuration paths for Claude Desktop on macOS systems.
Utilizes npm for package management and running scripts within the server environment.
Supports Tesla Inc. (NYSE:TSLA) stock data visualization as one of the available trading symbols.
Generates TradingView chart visualizations with customizable parameters like chart types (candlestick, line, area, bar, Heikin Ashi), technical indicators (moving averages, oscillators, Bollinger Bands), and symbol formats.
MCP Chart Server
A Model Context Protocol (MCP) server that integrates with Chart-IMG API to generate TradingView chart visualizations using Server-Sent Events (SSE) for real-time updates.
Features
- Real-time Chart Generation: Generate TradingView charts with live progress updates
- MCP Protocol Support: Works with Claude Desktop, Cline, and other MCP clients
- SSE Integration: Real-time event streaming for chart generation progress
- Professional Web Interface: Built-in API testing interface with live preview
- Comprehensive API: Full REST API with status tracking and event history
Quick Start
1. Get API Key
Register at chart-img.com to get your free API key.
2. Setup Environment
3. Run the Server
Option A: Web Interface (Development)
Option B: STDIO MCP Server (Traditional)
Option C: HTTP MCP Server with SSE (Recommended)
The HTTP mode provides Server-Sent Events (SSE) for real-time chart generation updates and supports multiple concurrent clients.
MCP Client Configuration
Claude Desktop
STDIO Mode (Traditional):
Add to claude_desktop_config.json
:
HTTP Mode (Recommended):
Config File Locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Cline/Continue
STDIO Mode:
HTTP Mode:
HTTP MCP Server with SSE
The HTTP MCP server provides real-time communication through Server-Sent Events (SSE) and standard REST endpoints:
Core MCP Endpoints:
POST /mcp/initialize
- Initialize MCP connectionPOST /mcp/tools/list
- List available toolsPOST /mcp/tools/call
- Execute tools
Real-time Communication:
GET /mcp/events/:clientId
- SSE event stream for live updates- Chart generation progress, completion notifications, and errors
Management Endpoints:
GET /mcp/health
- Server health and configuration statusGET /
- Server information and endpoint documentation
SSE Event Types:
connection
- Client connection statuschart_progress
- Real-time chart generation updatesheartbeat
- Keep-alive messages
Example SSE Usage:
Available Tools
generate_chart
Generate TradingView charts with customizable parameters.
Example:
get_chart_status
Check generation progress and retrieve completed charts.
get_available_symbols
List available trading symbols from Chart-IMG API.
get_recent_requests
View recent chart generation history.
health_check
Verify API configuration and service status.
Supported Chart Types
- Candlestick - Traditional OHLC candles
- Line - Simple price line
- Area - Filled area chart
- Bar - OHLC bars
- Heikin Ashi - Modified candlesticks
Technical Indicators
- Moving Averages: SMA, EMA, WMA
- Oscillators: RSI, MACD, Stochastic
- Bollinger Bands
- Volume indicators
- And many more from TradingView
Symbol Format
Use TradingView symbol format: EXCHANGE:SYMBOL
Examples:
NASDAQ:AAPL
- Apple Inc.NYSE:TSLA
- Tesla Inc.BINANCE:BTCUSDT
- Bitcoin/USDTFOREX:EURUSD
- EUR/USD pair
Rate Limits
Depends on your Chart-IMG subscription:
- Basic: 1 req/sec, 50/day
- Pro: 10 req/sec, 500/day
- Mega: 15 req/sec, 1000/day
- Ultra: 35 req/sec, 3000/day
Web Interface
Access the built-in interface at http://localhost:5000
for:
- Interactive API testing
- Real-time SSE event monitoring
- Chart preview and download
- Request/response inspection
API Endpoints
POST /api/v2/chart/generate
- Generate chartGET /api/v2/chart/status/:id
- Check statusGET /api/v2/symbols
- Available symbolsGET /api/v2/events
- SSE connectionGET /api/health
- Health check
Troubleshooting
Missing API Key
Invalid Symbol
Rate Limited
Server Modes Comparison
Feature | Web Interface | STDIO MCP | HTTP MCP + SSE |
---|---|---|---|
Purpose | Development/Testing | Claude Desktop | Universal Clients |
Transport | HTTP | Standard I/O | HTTP + SSE |
Real-time Updates | WebSocket | None | Server-Sent Events |
Multiple Clients | Yes | No | Yes |
Language Support | Browser | MCP Clients Only | Any HTTP Client |
Debugging | Browser DevTools | Logs | HTTP Tools + SSE |
SSE Integration Details
The HTTP MCP server uses Server-Sent Events for real-time communication:
Connection Flow:
- Client connects to
/mcp/events/:clientId
- Server establishes SSE stream
- Real-time events sent during chart generation
- Automatic reconnection on disconnect
Event Structure:
Client Implementation:
Development
Client Examples
See examples/client-examples.md
for complete implementations in:
- JavaScript/Node.js - Full SSE client with real-time updates
- Python - Threading-based SSE client with error handling
- cURL - Command-line testing and debugging
Each example includes proper SSE event handling, chart generation tracking, and error management.
MCP Client Connection Issues
If your MCP client shows "Waiting for server to respond to initialize
request...", the HTTP MCP server is working correctly. This typically indicates:
- Incorrect server URL - Ensure client connects to
http://localhost:3001
- Missing Content-Type header - Include
Content-Type: application/json
- Network connectivity - Verify port 3001 is accessible
- Client timeout - Increase timeout settings in your MCP client
Quick Test:
See MCP_CLIENT_TROUBLESHOOTING.md
for detailed debugging steps and client configuration examples.
License
MIT License - see LICENSE file for details.
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that generates TradingView chart visualizations with real-time updates, enabling AI assistants to create and display financial charts through an integration with Chart-IMG API.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with the Deriv trading API, providing access to active trading symbols and account balance information.Last updated -2Python
- -securityAlicense-qualityA Model Context Protocol server that enables interaction with the Tradovate API for managing trading contracts, positions, orders, and accounts.Last updated -JavaScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI models to create and manipulate PowerPoint presentations with advanced features like financial charts, formatting, and template management.Last updated -1Python
- TypeScriptMIT License