Chart Canvas

io.github.gluip由 GitHub 账号 gluip 发布v0.3.2更新于 Oct 25, 2026

Create interactive visualizations and query data sources (SQLite, CSV, Parquet, JSON)

概览

AI 生成的概览

一个本地 MCP 服务器,让助手在浏览器仪表板上创建交互式图表、表格和 Mermaid 图,并查询本地数据文件。

可以做什么
在实时仪表板上创建、删除和清空可视化内容:折线图、柱状图、散点图、饼图、表格,以及 Mermaid 流程图和示意图,并可打开浏览器中的仪表板。查询 SQLite 数据库结构,了解表和列后再写查询。对 SQLite 执行只读 SQL SELECT 查询,并把结果转成图表或表格。通过 DuckDB 查询本地 CSV、Parquet、JSON 和 NDJSON 文件。
适用场景
适合在与助手协作时希望把图表、示意图或表格以可视化方式呈现,或想探索本地 SQLite 数据库和数据文件、直接以图表查看结果而无需把数据导出到别处。
运行要求
通过 npm 包 @gluip/chart-canvas-mcp 在桌面本地运行(可用 npx 或全局安装),需要 Node.js。服务器会在 3000 端口启动本地 Web 服务并打开浏览器仪表板。未声明需要账号、API 密钥或环境变量。
安装前请注意
服务器会按路径读取本地文件,包括 SQLite 数据库以及 CSV、Parquet、JSON 和 NDJSON 文件,因此只应指向你愿意在助手会话中暴露的数据。查询仅限只读的 SELECT 和 WITH 语句,最多 10,000 行,但 README 所称数据不离开本机的说法需按你的环境自行核实。它会开放本地端口并打开浏览器窗口。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Chart Canvas,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Chart Canvas MCP Server

Interactive visualization dashboard for AI assistants via Model Context Protocol

Create beautiful charts, diagrams, and tables directly from your AI conversations. Chart Canvas provides a real-time dashboard that displays visualizations as you work with LLMs like Claude.

Demo

[Chart Canvas Demo]

Watch the full demo on YouTube to see Chart Canvas in action!

Features

✨ Multiple Chart Types: Line, bar, scatter, pie charts, tables, and Mermaid diagrams
🎨 Interactive Dashboard: Drag-and-drop grid layout with real-time updates
🔄 Live Synchronization: Changes appear instantly in your browser
📊 Rich Visualizations: Powered by ECharts and Mermaid
💾 Universal Data Sources: Query SQLite, CSV, Parquet, JSON, and NDJSON files directly
⚡ Smart Data Flow: Execute queries server-side - data stays local, never sent to LLM
🔒 Privacy First: Your data never leaves your machine
🚀 Easy Setup: One command to get started
🌐 Production Ready: Built-in production mode with optimized builds

Supported Data Sources

Chart Canvas can query and visualize data from multiple file formats:

  • SQLite (.db, .sqlite, .sqlite3) - Relational databases
  • CSV (.csv) - Comma-separated values
  • Parquet (.parquet) - Columnar storage format
  • JSON (.json) - JSON arrays of objects
  • NDJSON (.jsonl, .ndjson) - Newline-delimited JSON

Privacy & Performance: All queries execute locally on your machine using DuckDB. Query results are transformed into visualizations server-side - only metadata (chart configuration) is sent to the LLM, never your actual data. This makes it fast, scalable, and private.

Quick Start

Installation

bash
npm install -g @gluip/chart-canvas-mcp

Or use directly with npx (no installation needed):

bash
npx @gluip/chart-canvas-mcp

Configuration

Add to your MCP client configuration (e.g., Claude Desktop):

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

json
{  "mcpServers": {    "chart-canvas": {      "command": "npx",      "args": ["-y", "@gluip/chart-canvas-mcp"]    }  }}

Usage

  1. Start your MCP client (e.g., Claude Desktop)
  2. The server will automatically start on port 3000
  3. Use the showCanvas tool to open the dashboard in your browser
  4. Ask the AI to create visualizations!

Example Prompts

"Show me a line chart comparing sales data for 2023 and 2024"
"Create a pie chart showing market share by region"
"Draw a flowchart for the user authentication process"
"Make a table with team member information"
"Show me the database schema for my SQLite database"
"Query the athletes table and show the top 10 with most personal records"
"Create a chart showing sales trends from the database grouped by region"

MCP Tools

addVisualization

Create charts, diagrams, and tables on the canvas.

Supported Types:

  • line - Line charts with multiple series
  • bar - Bar charts for comparisons
  • scatter - Scatter plots for data distribution
  • pie - Pie charts with labels
  • table - Data tables with headers
  • flowchart - Mermaid diagrams (flowcharts, sequence diagrams, Gantt charts, etc.)

Example:

typescript
{  type: "line",  title: "Monthly Sales",  series: [    { name: "2023", data: [[1, 120], [2, 132], [3, 101]] },    { name: "2024", data: [[1, 220], [2, 182], [3, 191]] }  ],  xLabels: ["Jan", "Feb", "Mar"]}

removeVisualization

Remove a specific visualization by ID.

clearCanvas

Remove all visualizations from the canvas.

showCanvas

Open the dashboard in your default browser.

getDatabaseSchema

Inspect the structure of a SQLite database to understand available tables and columns before writing queries.

Parameters:

  • databasePath - Path to SQLite database file (e.g., ./data/mydb.sqlite or absolute path)

Example:

typescript
{  databasePath: "/path/to/database.db";}

Returns: Formatted schema showing all tables, columns, data types, and constraints.

queryAndVisualize

Execute a SQL query on a SQLite database and create a visualization from the results. Queries are executed server-side and must be read-only (SELECT only). Maximum 10,000 rows.

Parameters:

  • databasePath - Path to SQLite database file
  • query - SQL SELECT query (read-only)
  • visualizationType - Type of chart: line, bar, scatter, pie, or table
  • columnMapping (optional for table) - Mapping of columns to chart axes:
    • xColumn - Column for X-axis (required for charts)
    • yColumns - Array of columns for Y-axis (required for charts)
    • seriesColumn - Column to group data into separate series (optional)
    • groupByColumn - Alternative grouping column (optional)
  • title - Optional title for visualization
  • description - Optional description
  • useColumnAsXLabel - If true, use X column values as labels instead of numbers

Example:

typescript
{  databasePath: "./data/sales.db",  query: "SELECT region, SUM(revenue) as total FROM sales GROUP BY region",  visualizationType: "bar",  columnMapping: {    xColumn: "region",    yColumns: ["total"]  },  title: "Revenue by Region",  useColumnAsXLabel: true}

Security: Only SELECT and WITH (CTE) queries are allowed. INSERT, UPDATE, DELETE, DROP, and other modifying operations are blocked.

Architecture

  • Backend: Node.js + TypeScript + Express + MCP SDK
  • Frontend: Vue 3 + ECharts + Mermaid + Grid Layout
  • Communication: Real-time polling for instant updates

Development

Local Development

bash
# Clone repositorygit clone https://github.com/gluip/chart-canvas.gitcd chart-canvas
# Install backend dependenciescd backendnpm install
# Install frontend dependenciescd ../frontendnpm install
# Development mode (backend + frontend separate)# Terminal 1 - Backendcd backendnpm run dev
# Terminal 2 - Frontendcd frontendnpm run dev
# Production mode (single server)cd backendnpm run build:allnpm run start:prod

MCP Configuration for Local Development

json
{  "mcpServers": {    "chart-canvas": {      "command": "/path/to/node",      "args": [        "/path/to/chart-canvas/backend/node_modules/.bin/tsx",        "/path/to/chart-canvas/backend/src/index.ts"      ]    }  }}

License

MIT © 2026 Martijn

Links

来源:backend/README.md,提交 a403c18

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分