Loading repository data…
Loading repository data…
aaronmeis / repository
MCP Chart Agent is an AI-powered data visualization tool that generates charts from natural language descriptions. Built with React, Node.js, WebSocket, and Ollama, it uses a multi-agent system to create charts with custom backgrounds and watermarks. Features real-time streaming chat, chart export, and an experimentation for prompt optimization.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A single-page application for generating charts via a Model Context Protocol (MCP) server using Ollama.
┌─────────────┐ WebSocket ┌─────────────┐ HTTP ┌─────────────┐
│ React SPA │ ←───────────────→ │ MCP Server │ ←──────────→ │ Ollama │
│ (Vite) │ │ (Node.js) │ │ (phi3:mini) │
└─────────────┘ └──────┬──────┘ └─────────────┘
│ (3 Agents)
↓ ┌──────────────┐
┌─────────────┐ │ Agent 1: │
│ Chart │ │ Chart Data │
│ Generator │ │ Generation │
│ (Chart.js) │ ├──────────────┤
└──────┬──────┘ │ Agent 2: │
│ │ Background │
┌──────▼──────┐ │ Generation │
│ Watermark │ ├──────────────┤
│ Generator │ │ Agent 3: │
│ (Ollama) │ │ Watermark │
└─────────────┘ │ Generation │
└──────────────┘
Flow: User Request → Agent 1 (Chart) → Agent 2 (Background) → Chart Render → Agent 3 (Watermark) → Final Chart
# Clone the repository
git clone <repository-url>
cd image-mcp-generation
# Install dependencies
npm install
# Pull the Ollama model
ollama pull phi3:mini
# Start development servers
npm run dev
The SPA will be at http://localhost:3000 (or next available port) and the MCP server at ws://localhost:8080.
Just type naturally! The agent will detect chart requests. You can also click on the sample prompt buttons above the input field for quick suggestions.
Example requests:
Click the status indicator button in the header to view:
| Method | Description |
|---|---|
chat | Send a chat message |
generateChart | Generate a chart from data or prompt |
getStatus | Get server status (MCP, Ollama, model) |
listTools | List available MCP tools |
ping | Health check |
image-mcp-generation/
├── spa/ # React SPA
│ ├── src/
│ │ ├── components/ # React components (Chat, Message, ChartImage, StatusModal)
│ │ ├── hooks/ # Custom hooks (useWebSocket)
│ │ ├── services/ # API services (mcpClient)
│ │ └── config/ # Configuration files (prompts.json)
│ └── package.json
│
├── mcp-server/ # MCP Server
│ ├── src/
│ │ ├── agent/ # Agent and Ollama client
│ │ ├── tools/ # MCP tools
│ │ └── utils/ # Utilities
│ └── package.json
│
├── experiments/ # Experiment tracking
│ ├── prompts/ # Prompt versions and logs
│ └── results/ # Benchmark results
│
├── docs/ # Documentation
│ ├── INSTALL.md # Installation guide
│ ├── UPDATE.md # Update procedures
│ └── ARCHITECTURE.md # System architecture
│
└── scripts/ # Utility scripts
├── benchmark.js # Performance benchmarks
└── analyze-prompts.js # Prompt analysis
Create a .env file (optional, defaults are provided):
# Server
PORT=8080
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=phi3:mini
# SPA
VITE_WS_URL=ws://localhost:8080
# Logging
DISABLE_PROMPT_LOGGING=false
Sample prompts are stored in spa/src/config/prompts.json. The application randomly displays 3 prompts from the 30 available options on each page load.
| Script | Description |
|---|---|
npm run dev | Start both SPA and server in dev mode |
npm run dev:spa | Start SPA only |
npm run dev:server | Start server only |
npm run build | Build for production |
npm run benchmark | Run performance benchmarks |
All prompts are version-controlled in experiments/prompts/:
system-prompts.md - Chat system promptschart-prompts.md - Chart generation promptsprompt-registry.json - Central prompt configurationprompt-log.jsonl - Runtime logs (gitignored)Sample user prompts are stored in spa/src/config/prompts.json (30 prompts, 3 shown randomly).
Run A/B tests on prompt variations:
prompt-registry.jsonnpm run analyze-promptsRun benchmarks:
npm run benchmark
Outputs latency percentiles, success rates, and token throughput.
MIT