mcp-chart-forge

mcp-chart-forge

A professional chart generation MCP server for Claude Code. Drop a charts-theme.json into any project and Claude can generate beautiful, on-brand charts output as slide-ready PNG and SVG files — fully local, no API keys required.

Category
Visit Server

README

mcp-chart-forge

A professional chart generation MCP server for Claude Code. Drop a charts-theme.json into any project and Claude can generate beautiful, on-brand charts output as slide-ready PNG and SVG files — fully local, no API keys required.

How it works

  1. You add mcp-chart-forge to your Claude Code MCP config (once)
  2. You drop a charts-theme.json into your project root (optional — ships with sensible defaults)
  3. Claude generates charts via natural language: "Make a bar chart of Q1 revenue by region"
  4. PNG + SVG files land in ./charts/ (or wherever your theme configures)

The server uses Vega-Lite for chart specs and sharp for server-side PNG rendering — no browser, no Electron, no API keys.


Installation

1. Install dependencies and build

git clone https://github.com/you/mcp-chart-forge.git
cd mcp-chart-forge
npm install
npm run build

2. Add to Claude Code

claude mcp add --transport stdio chart-forge -- node /absolute/path/to/mcp-chart-forge/dist/index.js

Replace /absolute/path/to/mcp-chart-forge with the actual path on your machine.

Or add manually to ~/.claude/claude_desktop_config.json:

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

3. Set up your theme (optional)

cp /path/to/mcp-chart-forge/charts-theme.example.json ./charts-theme.json
# Edit charts-theme.json to match your brand colors, fonts, and output size

chart-forge walks up the directory tree from wherever Claude Code is running, so placing charts-theme.json at your project root (or monorepo root) is all you need.


Available tools

Tool Description
generate_bar_chart Bar chart (vertical or horizontal, optionally grouped/stacked)
generate_line_chart Line chart with optional multiple series, smoothing
generate_area_chart Area chart with optional stacking
generate_donut_chart Donut/ring chart
generate_scatter_chart Scatter plot with optional bubble size, labels, and trendline

Common parameters (all tools)

Parameter Type Description
data object[] Array of data objects
xField string Field name for X axis
yField string Field name for Y axis
title string Chart title
subtitle string? Optional subtitle
colorField string? Field for color grouping
outputName string? Filename stem (defaults to slugified-title-{timestamp})
format "png" | "svg" | "both" Output format (default: "both")

Tool-specific parameters

generate_bar_chart

  • horizontal: boolean — render as horizontal bars (default: false)

generate_line_chart

  • xType: "temporal" | "ordinal" | "quantitative" — X axis field type (default: "ordinal")
  • smooth: boolean — apply monotone curve smoothing (default: false)

generate_area_chart

  • xType: same as line chart
  • stacked: boolean — stack series instead of overlapping (default: false)

generate_donut_chart

  • innerRadiusRatio: number 0.1–0.9 — hole size as fraction of outer radius (default: 0.55)

generate_scatter_chart

  • sizeField: string? — field for bubble size (creates a bubble chart)
  • labelField: string? — field for point labels
  • showTrendline: boolean — overlay a linear regression line (default: false)

Theme file reference

// charts-theme.json
{
  // Brand colors — used as the categorical color range for all charts
  "palette": ["#1B4F8A", "#E8A020", "#4CAF8A", "#C94040", "#7B5EA7"],

  "background": "#FFFFFF",
  "fontFamily": "sans-serif",

  "fontSize": {
    "title":      20,   // Chart title
    "subtitle":   14,   // Chart subtitle
    "axis":       12,   // Axis labels and titles
    "legend":     12,   // Legend labels
    "annotation": 11    // In-chart labels
  },

  "fontWeight": {
    "title":    "bold",
    "subtitle": "normal"
  },

  "textColor":  "#1A1A1A",   // All text
  "axisColor":  "#CCCCCC",   // Axis lines and ticks
  "gridColor":  "#F0F0F0",   // Grid lines

  "padding": { "top": 48, "right": 40, "bottom": 56, "left": 64 },

  "outputSize": {
    "width":  1920,   // Output PNG width in pixels
    "height": 1080,   // Output PNG height in pixels
    "scale":  1       // Use 2 for @2x / HiDPI
  },

  "outputDir": "./charts",   // Relative to project root (process.cwd())

  "logoPath": null            // Reserved for future logo overlay support
}

Example prompts for Claude

Generate a bar chart of monthly revenue.
Data: Jan $42k, Feb $38k, Mar $51k, Apr $49k, May $63k

Make a line chart comparing website traffic vs conversions over the last 6 months.
Use "month" for X, "visitors" and "conversions" as separate series via colorField.

Create a donut chart showing market share:
Company A 38%, Company B 27%, Company C 19%, Others 16%

Generate a scatter plot of marketing spend vs revenue, with company name labels,
and show a trendline.

Troubleshooting

Could not load the "sharp" module on Windows

Sharp ships prebuilt binaries per-platform. If you see this error, force the Windows x64 binary:

npm install --os=win32 --cpu=x64 sharp

Then rebuild: npm run build.

Could not load the "sharp" module on macOS (Apple Silicon)

npm install --os=darwin --cpu=arm64 sharp

Development

npm run dev      # Run via ts-node (no build step)
npm run build    # Compile TypeScript → dist/
npm start        # Run compiled output

Tech stack

  • Vega-Lite — declarative chart spec compiler
  • Vega — rendering engine (view.toSVG() — no canvas/browser needed)
  • sharp — SVG → PNG via libvips (prebuilt binaries, no native compilation)
  • @modelcontextprotocol/sdk — MCP server + tool registration
  • Zod — tool input validation

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured