New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

chart-img-mcp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

chart-img-mcp

MCP for generating chart images

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

chart-img-mcp

This project is an MCP (Model Context Protocol) server designed for generating chart images using the chart-img.com API.

Features

  • Generates daily, 4-hour, and 1-hour stock chart images.
  • Supports configurable technical indicators for each chart interval.
  • Integrates with chart-img.com API for image generation.

Setup

  • Clone the repository:

    git clone https://github.com/your-username/chart-img-mcp.git
    cd chart-img-mcp
    
  • Install dependencies:

    npm install
    
  • Environment Variables: Create a .env file in the root of the project and add your chart-img.com API key:

    CHART_IMG_API_KEY=YOUR_ACTUAL_CHART_IMG_API_KEY
    

    Replace YOUR_ACTUAL_CHART_IMG_API_KEY with your API key obtained from chart-img.com.

Usage

Running the MCP Server

To start the MCP server in development mode:

npm run dev

To inspect the MCP server using the MCP Inspector UI:

npm run inspect

Building the Project

To compile the TypeScript code to JavaScript:

npm run build

This command will clean the dist directory and then compile the TypeScript files.

Using the generateChartImages Tool

The generateChartImages tool allows you to generate stock chart images with specified intervals and technical indicators.

Tool Name: generateChartImages

Parameters:

  • symbol (string, required): The stock symbol (e.g., 'BINANCE:ETHUSDT').
  • chartConfigs (array of objects, optional): Configuration for different chart intervals and studies. If not provided, it defaults to 1D, 4h, 1h intervals with 'Volume' and 'MACD' studies. Each object in chartConfigs should have:
    • interval (string, required): Chart interval (e.g., '1D', '4h', '1h').
    • studies (array of objects, optional): Array of technical indicators. Each object should have a name property (e.g., [{ name: 'Volume' }, { name: 'MACD' }]).

Example Usage (from a MCP client):

To generate daily, 4-hour, and 1-hour charts for BINANCE:ETHUSDT with default studies:

{
  "tool": "generateChartImages",
  "arguments": {
    "symbol": "BINANCE:ETHUSDT"
  }
}

To generate a daily chart with 'RSI' and 'SMA' studies, and a 4-hour chart with 'Volume' study:

{
  "tool": "generateChartImages",
  "arguments": {
    "symbol": "BINANCE:ETHUSDT",
    "chartConfigs": [
      {
        "interval": "1D",
        "studies": [
          { "name": "RSI" },
          { "name": "SMA" }
        ]
      },
      {
        "interval": "4h",
        "studies": [
          { "name": "Volume" }
        ]
      }
    ]
  }
}

Return Value:

The tool returns a JSON object where keys are the chart intervals and values are the URLs of the generated images.

{
  "1D": "https://example.com/daily_chart.png",
  "4h": "https://example.com/4h_chart.png",
  "1h": "https://example.com/1h_chart.png"
}

Config MCP tool

To configure the MCP tool, you can specify the default chart configurations in the config.json file located in the root directory. This file allows you to set default intervals and studies for the generateChartImages tool.

{
  "mcpServers": {
    "chart-img-mcp": {
      "command": "npx",
      "args": [
        "@gabriel3615/chart-img-mcp@latest"
      ],
      "env": {
        "CHART_IMG_API_KEY": "KEY_HERE"
      }
    }
  }
}

Publishing to npmjs

To publish this package to npmjs, ensure your package.json name and version are unique and updated. Then run:

npm publish --access public

The prepublishOnly script will automatically run npm run build before publishing.

Keywords

chart

FAQs

Package last updated on 28 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts