Skip to main content
Glama
BI Chart MCP Server

BI Chart MCP Server

by c-cf

BI Chart MCP

An MCP server that answers business questions from PostgreSQL and local CSV / Parquet / JSON files (via DuckDB). It shows the answer as an interactive chart inside Claude Desktop.

  • Safe by construction. Access is read-only and enforced by the database (a read-only role, or a locked DuckDB connection). A sqlglot guard adds a second layer. Rejections come with reasons the model can act on.

  • Charts that explain themselves. Charts are Vega-Lite, rendered through MCP Apps. Each chart has a table view, the exact SQL that ran, and when it ran.

  • Small and predictable. Four tools: search_catalog, describe_table, query, visualize. The host model writes the SQL; the server needs no LLM API key.

Status: v2 rewrite, Phase 1 (alpha). See docs/architecture.md for the design and the roadmap below for what comes next.

Quickstart (5 minutes, no database needed)

Requires uv and Python 3.12+.

git clone https://github.com/c-cf/BI-Chart-MCP-Server.git
cd BI-Chart-MCP-Server
uv sync
uv run python examples/generate_demo_data.py

Add the server to Claude Desktop (Settings → Developer → Edit Config). Use absolute paths; see examples/claude_desktop_config.json:

{
  "mcpServers": {
    "bi-chart": {
      "command": "/absolute/path/to/uv",
      "args": ["--directory", "/absolute/path/to/BI-Chart-MCP-Server", "run", "bi-chart-mcp",
               "--config", "/absolute/path/to/BI-Chart-MCP-Server/examples/bi-chart-mcp.duckdb.yml"]
    }
  }
}

Restart Claude Desktop and ask:

  • "What does the shop data contain?"

  • "Show monthly revenue from paid orders by product category."

  • "Which region had the highest refund rate last quarter? Chart it."

With PostgreSQL

docker compose -f examples/docker-compose.yml up -d   # demo data + read-only role

Then use a config with a postgres source. The DSN goes in the server's env block, never in the config file:

"env": { "SHOP_DSN": "postgresql://bi_reader:bi_reader_demo@127.0.0.1:55432/shop" }

See docs/configuration.md for every option.

Related MCP server: data-analysis-mcp

Tools

Tool

What it does

search_catalog

Without arguments: every source, its SQL dialect and its tables. With words: matching tables and columns, ranked.

describe_table

Columns, types, descriptions, foreign keys, likely joins guessed from column names (customer_id -> customers.id), and optionally the most frequent values of chosen columns.

query

Runs one read-only query. Returns a preview, column types, a truncation flag and a handle.

visualize

Draws an interactive chart from a handle or from SQL. The chart type is chosen automatically unless the model specifies it.

Security

Read docs/security.md before pointing the server at company data. In short:

Development

uv sync
uv run pytest                      # unit + end-to-end
uv run pytest -m integration       # PostgreSQL via Docker (testcontainers)
uv run ruff check . && uv run ruff format --check . && uv run pyright
cd ui && npm ci && npm test && npm run build   # chart view; commit src/bi_chart_mcp/ui/chart.html

Roadmap

  • Phase 2: context layer and insights.

    • context.yml: glossary, metric definitions, verified queries, served via get_context.

    • Deterministic evals.

    • Saved insights (bi://insights/{id}).

  • Phase 3: interactivity.

    • Persistent handles.

    • Drill-down and paging from the chart view.

    • PNG fallback.

  • Phase 4: company deployment.

    • Streamable HTTP with OAuth and per-user database roles.

    • MCPB bundle and PyPI release.

License

Apache-2.0

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI-powered business intelligence and data analysis using pandas and LLM code generation. Supports automated data processing, statistical analysis, and visualization creation through natural language interactions.
      15
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables data analysis and visualization operations such as loading CSV/Excel/JSON files, computing summary statistics, generating charts, and exploring datasets via SSE/HTTP.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to create data visualizations like bar charts, line charts, pie charts, scatter plots, and histograms, returning inline SVG or PNG files.
      5
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM clients to load, clean, visualize, and analyze tabular datasets, and to generate multi-format analytic reports through natural language instructions.
      -