Metadata-Version: 2.4
Name: chart-genius-mcp
Version: 1.0.2
Summary: The Ultimate Chart Generation MCP Server - Built for Performance, Powered by AI
Project-URL: Homepage, https://github.com/your-org/chart-genius-mcp
Project-URL: Documentation, https://chart-genius.readthedocs.io
Project-URL: Repository, https://github.com/your-org/chart-genius-mcp
Project-URL: Bug Reports, https://github.com/your-org/chart-genius-mcp/issues
Project-URL: Feature Requests, https://github.com/your-org/chart-genius-mcp/discussions
Author-email: ChartGenius Team <team@chart-genius.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,charts,dashboard,data-analysis,matplotlib,mcp,performance,plotly,visualization
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: aioredis>=2.0.1
Requires-Dist: asyncio-throttle>=1.0.2
Requires-Dist: bokeh>=3.2.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: httpx>=0.25.0
Requires-Dist: kaleido>=0.2.1
Requires-Dist: loguru>=0.7.0
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: mcp>=1.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: orjson>=3.9.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: plotly>=5.17.0
Requires-Dist: polars>=0.20.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: redis>=5.0.0
Requires-Dist: reportlab>=4.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: scipy>=1.11.0
Requires-Dist: seaborn>=0.12.0
Requires-Dist: statsmodels>=0.14.0
Requires-Dist: typer>=0.9.0
Requires-Dist: uvicorn[standard]>=0.24.0
Provides-Extra: ai
Requires-Dist: openai>=1.0.0; extra == 'ai'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'ai'
Requires-Dist: torch>=2.1.0; extra == 'ai'
Requires-Dist: transformers>=4.35.0; extra == 'ai'
Provides-Extra: all
Requires-Dist: bandit>=1.7.5; extra == 'all'
Requires-Dist: black>=23.0.0; extra == 'all'
Requires-Dist: cython>=3.0.0; extra == 'all'
Requires-Dist: flake8>=6.0.0; extra == 'all'
Requires-Dist: isort>=5.12.0; extra == 'all'
Requires-Dist: line-profiler>=4.1.0; extra == 'all'
Requires-Dist: memory-profiler>=0.61.0; extra == 'all'
Requires-Dist: mkdocs-material>=9.2.0; extra == 'all'
Requires-Dist: mkdocs-mermaid2-plugin>=1.1.0; extra == 'all'
Requires-Dist: mkdocs>=1.5.0; extra == 'all'
Requires-Dist: mypy>=1.5.0; extra == 'all'
Requires-Dist: numba>=0.58.0; extra == 'all'
Requires-Dist: openai>=1.0.0; extra == 'all'
Requires-Dist: py-spy>=0.3.14; extra == 'all'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'all'
Requires-Dist: pytest-benchmark>=4.0.0; extra == 'all'
Requires-Dist: pytest-cov>=4.1.0; extra == 'all'
Requires-Dist: pytest>=7.4.0; extra == 'all'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'all'
Requires-Dist: torch>=2.1.0; extra == 'all'
Requires-Dist: transformers>=4.35.0; extra == 'all'
Requires-Dist: ujson>=5.8.0; extra == 'all'
Requires-Dist: uvloop>=0.19.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: bandit>=1.7.5; extra == 'dev'
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: flake8>=6.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Requires-Dist: line-profiler>=4.1.0; extra == 'dev'
Requires-Dist: memory-profiler>=0.61.0; extra == 'dev'
Requires-Dist: mkdocs-material>=9.2.0; extra == 'dev'
Requires-Dist: mkdocs-mermaid2-plugin>=1.1.0; extra == 'dev'
Requires-Dist: mkdocs>=1.5.0; extra == 'dev'
Requires-Dist: mypy>=1.5.0; extra == 'dev'
Requires-Dist: py-spy>=0.3.14; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-benchmark>=4.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Provides-Extra: performance
Requires-Dist: cython>=3.0.0; extra == 'performance'
Requires-Dist: numba>=0.58.0; extra == 'performance'
Requires-Dist: ujson>=5.8.0; extra == 'performance'
Requires-Dist: uvloop>=0.19.0; extra == 'performance'
Description-Content-Type: text/markdown

# 📊 ChartSmith MCP Server

**A high-performance chart generation MCP server** — built for speed, powered by AI, production-ready.

[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io/)
[![Performance](https://img.shields.io/badge/Performance-39k+%20RPS-green)](./benchmarks/)
[![Charts](https://img.shields.io/badge/Chart%20Types-50+-orange)](./docs/chart-types.md)
[![Engines](https://img.shields.io/badge/Engines-4-purple)](./docs/engines.md)

> 🚀 **First-ever comprehensive chart generation MCP server** - Turn your SQL results into stunning visualizations with zero configuration and maximum performance.

## 🎯 **Why ChartGenius?**

### **💡 Inspired by Industry Leaders**
- **Hex.tech's $70M success** proves chart generation is core business infrastructure
- **Built to solve real bottlenecks** like O(n²) algorithms and blocking operations
- **MCP-native design** for seamless integration with any client

### **⚡ Performance First**
- Optimized O(n) data paths
- Concurrent rendering with guardrails (timeouts, semaphores, input caps)
- Intelligent caching (memory/Redis)

### **🧠 AI-Powered Intelligence**
- **Smart chart type detection** based on data patterns
- **Natural language to visualization** conversion
- **Automatic insight generation** for business intelligence
- **Accessibility optimization** for WCAG compliance

## 🚀 **Quick Start**

### **Installation**
```bash
pip install chart-genius-mcp  # package name remains; server id: chartsmith
```

### **Docker Quick Start**
```bash
docker build -t chartsmith-mcp .
docker run --rm -it chartsmith-mcp                 # stdio
docker run --rm -it -p 8000:8000 -e RUN_HTTP=1 chartsmith-mcp  # http
```

Using docker-compose:
```bash
docker compose up -d mcp-stdio
docker compose up -d mcp-http
```

## 🔌 Transports
- Stdio (MCP stdio)
- HTTP JSON (`POST /mcp`) and SSE (`POST /sse`)
- Health: `/health`, Readiness: `/ready`, Metrics: `/metrics`

## ⚙️ Environment
- `CHART_MAX_CONCURRENCY` (default 8)
- `CHART_TOOL_TIMEOUT_MS` (default 60000)
- `CHART_TOOL_TIMEOUT_MS_IMAGES` (image timeouts)
- `CHART_TOOL_TIMEOUT_MS_HEAVY` (batch/dashboard)
- `CHART_MAX_ROWS` (input size guard)
- `DISABLED_TOOLS` (comma-separated)
- AI: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `CHART_AI_PROVIDER`

## 🧰 Tools
- Per-chart: bar, line, scatter, histogram, area, box, violin, bubble, pie, heatmap, treemap, sunburst, sankey, choropleth
- Full-auto: `generate_chart_auto`
- Deprecated: `generate_chart`
- Cache: `manage_cache` (stats/clear/optimize)
- Perf: `get_performance_stats`
- Prompts/Resources: `list_prompts`/`get_prompt`, `list_resource_templates`/`read_resource`

## 📦 Resources
- Datasets: `dataset:sample/sales_small`, `.../scatter_small`, `.../heatmap_pivot`, `.../choropleth_iso3`
- Themes: `theme:modern`, `theme:corporate`, `theme:dark`, `theme:accessible`

## 🧪 Tests & Benchmarks
- Pytest suite: tools, engines, formats, AI (mock/live), cache, guardrails, MCP stdio/HTTP
- Benchmark harness: p50/p90 latency script and smoke tests

## 📈 Prometheus Metrics
- Endpoint: `/metrics` (Prometheus exposition format)
- Metrics include: request counts, tool call totals, tool errors, and duration histograms.
- Example scrape config:
```yaml
scrape_configs:
  - job_name: chartsmith
    static_configs:
      - targets: ['localhost:8000']
```

## 🔐 Security & Limits
- Input size caps, timeouts, concurrency limits
- Tool filtering via env

## 🧭 Smithery
- Stdio: configure Smithery to invoke `python -m chart_genius_mcp` with server id `chartsmith`
- HTTP: point Smithery at the container’s `/mcp` endpoint (port 8000)

## 📦 Docker Images (CI)
- GitHub Action builds and publishes multi-arch images to GHCR on tags `v*`.
- Image: `ghcr.io/<owner>/<repo>:<tag>` and `:latest`.
- Example pull:
```bash
docker pull ghcr.io/<owner>/<repo>:latest
``` 