svgscholar
v2.1.0
Published
MCP server that generates publication-quality SVG diagrams, figures, plots, and images for research papers. Powered by Gemini.
Maintainers
Readme
svgscholar
MCP server that generates publication-quality SVG diagrams, figures, plots, posters, and images for research papers.
Uses Gemini 3.1 Pro for SVG generation and Nano Banana 2 (Gemini 3.1 Flash Image) for image generation and editing.
Quick Start
Get a Gemini API key from Google AI Studio, then add the server to your client:
Claude Code
claude mcp add svgscholar -t stdio -e GEMINI_API_KEY=your-key -- npx -y svgscholarCursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"svgscholar": {
"command": "npx",
"args": ["-y", "svgscholar"],
"env": {
"GEMINI_API_KEY": "your-key"
}
}
}
}Windsurf / VS Code / Other MCP Clients
Add to your MCP config file:
{
"mcpServers": {
"svgscholar": {
"command": "npx",
"args": ["-y", "svgscholar"],
"env": {
"GEMINI_API_KEY": "your-key"
}
}
}
}Vertex AI (Alternative)
Use Vertex AI instead of an API key:
claude mcp add svgscholar -t stdio \
-e GOOGLE_CLOUD_PROJECT=your-project \
-e GOOGLE_CLOUD_LOCATION=us-central1 \
-- npx -y svgscholarTools
generate_svg
Generate publication-ready SVG visuals: architecture diagrams, conference posters, paper figures, data plots, LaTeX equations, presentation slides, and teaser/hero figures.
Parameters:
| Parameter | Required | Description |
|-----------|----------|-------------|
| type | Yes | diagram · poster · figure · plot · equation · slides · teaser |
| description | Yes | Detailed description of what to generate |
| options | No | Type-specific options (e.g., data for plots, latex for equations) |
| filename | No | Output filename (default: auto-generated) |
generate_image
Generate raster images (PNG) for concept illustrations, visual abstracts, or photorealistic content.
Parameters:
| Parameter | Required | Description |
|-----------|----------|-------------|
| description | Yes | What to generate |
| filename | No | Output filename |
edit_image
Annotate existing images with arrows, labels, bounding boxes, or other overlays.
Parameters:
| Parameter | Required | Description |
|-----------|----------|-------------|
| image_path | Yes | Absolute path to the input image |
| edit_description | Yes | What edits to make |
| filename | No | Output filename |
All outputs are saved to a svgscholar-output/ directory in your current working directory.
Example Prompts
- "Draw my model architecture — we have a shared encoder that feeds into two task-specific heads with a gating mechanism between them"
- "I need a figure comparing our method against three baselines across four datasets, like a grouped bar chart with error bars"
- "Make a poster for my EMNLP submission on cross-lingual transfer, here's the abstract and key results..."
- "Can you turn this pipeline into a proper figure: we take raw clinical notes, run NER, link to UMLS, then feed into a graph neural network"
- "Plot our ablation results from this table and make it camera-ready"
- "I need a teaser figure that shows the gap between supervised and zero-shot, and how our method closes it"
- "Render the ELBO objective with the KL term expanded"
- "Annotate this attention map — add arrows pointing to the key tokens and label the heads"
Configuration
| Variable | Required | Description |
|----------|----------|-------------|
| GEMINI_API_KEY | Yes* | Gemini API key from AI Studio |
| GEMINI_MODEL | No | Model for SVG generation (default: gemini-3.1-pro-preview) |
| GEMINI_VISION_MODEL | No | Model for image generation/editing — Nano Banana 2 (default: gemini-3.1-flash-image-preview) |
| GOOGLE_CLOUD_PROJECT | No | GCP project ID (for Vertex AI) |
| GOOGLE_CLOUD_LOCATION | No | GCP region (for Vertex AI, default: us-central1) |
*Required unless using Vertex AI.
Development
bun install
bun run src/index.tsLicense
MIT
