npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-visual-chart

v0.2.0

Published

MCP server for creating chart visualizations using Chart.js and Vega-Lite

Downloads

29

Readme

mcp-visual-chart

A Model Context Protocol (MCP) server that enables AI agents to create chart visualizations using Chart.js. Charts are rendered server-side as PNG or SVG and returned inline to the agent, while also being saved to disk and optionally opened in the system viewer.

Features

  • 10 chart types: bar, line, pie, doughnut, scatter, area, radar, bubble, polar area, histogram
  • PNG & SVG output: render charts as PNG (default) or SVG via outputFormat
  • Server-side rendering via chartjs-node-canvas (no browser needed)
  • Smart defaults: professional color palette, sizing, and styling out of the box
  • Data labels: optionally display values directly on chart elements
  • Smooth curves: configurable line tension for line/area charts
  • Logarithmic scale: support for logarithmic y-axis
  • Input validation: descriptive error messages for data shape mismatches and invalid configurations
  • Dual output: returns base64 image to the agent + saves to disk
  • Auto-open: optionally opens the chart in the system's default image viewer
  • Customizable: titles, subtitles, axis labels, colors, dimensions, stacked mode, horizontal bars

Installation

npm install -g mcp-visual-chart

Or run directly:

npx mcp-visual-chart

Setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "visual-chart": {
      "command": "npx",
      "args": ["-y", "mcp-visual-chart"]
    }
  }
}

VS Code (GitHub Copilot / MCP extensions)

Create .vscode/mcp.json in your project:

{
  "servers": {
    "visual-chart": {
      "command": "npx",
      "args": ["-y", "mcp-visual-chart"]
    }
  }
}

For local development

{
  "servers": {
    "visual-chart": {
      "command": "node",
      "args": ["/path/to/mcp-visual-chart/dist/index.js"]
    }
  }
}

Tool: create_chart

Parameters

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | type | string | yes | bar, line, pie, doughnut, scatter, area, radar, bubble, polarArea, histogram | | labels | string[] | no | Labels for data points | | datasets | object[] | yes | Array of { label, data, backgroundColor, borderColor, borderWidth, fill } | | options | object | no | See options below | | outputFormat | string | no | png (default) or svg | | outputPath | string | no | Custom file path for the saved chart | | autoOpen | boolean | no | Open in default viewer (default: true) |

Options

| Option | Type | Description | |--------|------|-------------| | title | string | Chart title | | subtitle | string | Chart subtitle | | showLegend | boolean | Show legend (default: true) | | width | number | Image width in pixels (default: 800) | | height | number | Image height in pixels (default: 600) | | backgroundColor | string | Background color (default: white) | | xAxisLabel | string | X-axis label | | yAxisLabel | string | Y-axis label | | stacked | boolean | Stack datasets | | indexAxis | "x" | "y" | Set to "y" for horizontal bar chart | | yAxisType | "linear" | "logarithmic" | Y-axis scale type (default: linear) | | beginAtZero | boolean | Force y-axis to start at zero | | tension | number | Line smoothing: 0 = straight (default), 0.4 = smooth. For line/area charts | | showDataLabels | boolean | Show data values on chart elements (default: false) |

Example prompts

  • "Create a bar chart showing Q1 revenue: Jan $50k, Feb $65k, Mar $70k"
  • "Make a pie chart of market share: Apple 30%, Samsung 25%, Others 45%"
  • "Generate a smooth line chart tracking website visitors over the last 7 days"
  • "Create a stacked bar chart comparing actual vs budget for 3 months"
  • "Make a horizontal bar chart of the top 5 programming languages"
  • "Create a bar chart with data labels showing exact values"
  • "Generate an SVG line chart with logarithmic y-axis for exponential growth data"

Development

git clone <repo-url>
cd mcp-visual-chart
npm install
npm run build       # build to dist/
npm run dev         # watch mode
npm test            # run tests
npm run test:watch  # tests in watch mode

System requirements

  • Node.js 18+
  • On Linux, canvas native dependencies are needed:
    sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

License

MIT