Skip to main content

Ship-ready MCP server for Gemini + Imagen diagram/plot generation. Runs on Claude, ChatGPT, VSCode Copilot, Cursor.

Project description

figurify-mcp

PyPI Python CI License

MCP server for Google Gemini + Imagen image generation. Works with Claude Desktop, Claude Code, Cursor, VSCode Copilot, and any MCP-compatible host.

  • 5 generation tools — diagrams, infographics, paper figures, matplotlib plots, VLM judging
  • Smart model routing across Gemini 2.5 / 3 / 3.1 + Imagen 4 / Nano Banana
  • 1K by default to stay under Claude's 1 MB inline tool-result cap
  • Stdio + streamable HTTP transports

Install

pip install figurify-mcp        # or: uv pip install figurify-mcp

Get a free Gemini API key: aistudio.google.com/apikey

Configure your host

Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "figurify": {
      "command": "uvx",
      "args": ["figurify-mcp"],
      "env": { "GOOGLE_API_KEY": "your-key" }
    }
  }
}

Claude Code / Cursor

claude mcp add figurify -s user \
  -e GOOGLE_API_KEY=$GOOGLE_API_KEY \
  -- uvx figurify-mcp

VSCode Copilot — .vscode/mcp.json

{
  "servers": {
    "figurify": {
      "command": "uvx",
      "args": ["figurify-mcp"],
      "env": { "GOOGLE_API_KEY": "your-key" }
    }
  }
}

Restart the host. The tools appear automatically.


Tools

Tool What it does Typical cost
create_simple_diagram Quick prompt → image ~$0.04
create_infographic Topic → styled poster (VLM layout + Imagen render) ~$0.12
create_methodology_diagram Paper figure with N critique rounds ~$0.25
create_statistical_plot Data → matplotlib chart via VLM codegen ~$0.002
evaluate_diagram VLM-as-judge comparison of two diagrams ~$0.015

Meta (save host context): search_tools, describe_tool, recommend_model, estimate_cost, list_available_models.

Prompts: draft_methodology_figure, plan_visual_output.

Resources: figurify://styles/methodology_guidelines, figurify://styles/infographic_guidelines, figurify://catalog/models.

Images return as MCP ImageContent blocks with audience: ["user"] — they render inline in every compliant host.


Configuration

All env vars are optional.

Variable Default Purpose
GOOGLE_API_KEY (required) Gemini + Imagen API key
FIGURIFY_OUTPUT_DIR ~/.figurify/outputs Where generated PNGs are saved
FIGURIFY_VLM_MODEL (auto-routed) Pin a specific VLM model
FIGURIFY_IMAGE_MODEL (auto-routed) Pin a specific image model
FIGURIFY_MAX_METHODOLOGY_ITERATIONS 4 Upper bound for critique loops

Transports

figurify-mcp                                            # stdio (default)
figurify-mcp --transport http --host 0.0.0.0 --port 8765

Security

This server runs VLM-generated matplotlib code in a subprocess. Shipped mitigations:

  • AST + pattern allowlist rejects any code importing os, subprocess, socket, urllib, requests, pickle, etc.
  • python -I isolated mode, minimal env, POSIX setrlimit (512 MB RAM / 120 s CPU / 100 MB fsize)
  • load_image restricts filesystem reads to {output_dir, /tmp, CWD} — no path traversal
  • API-key patterns and home paths stripped from every error message

Report vulnerabilities privately: genaimanoj@gmail.com. Full threat model in SECURITY.md.

Development

git clone https://github.com/genaimanoj/figurify-mcp
cd figurify-mcp
uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'
cp .env.example .env   # set GOOGLE_API_KEY
pytest -q              # 64 tests, ~6 s

Contributions welcome — see CONTRIBUTING.md.

License

MIT © 2026 Manoj Bhandari. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figurify_mcp-0.2.1.tar.gz (33.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

figurify_mcp-0.2.1-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file figurify_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: figurify_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 33.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for figurify_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d6cc94821e4fc5daafc83abe5c0f29b0f65e4aa17cb8238aac228be6de3f7404
MD5 f91e38be1620b4f43a72ae800aba3264
BLAKE2b-256 1d342cfea7bcf04f4ff0a278bfb8b7f06e1a31c624b1a279a2688daeaaa04513

See more details on using hashes here.

Provenance

The following attestation bundles were made for figurify_mcp-0.2.1.tar.gz:

Publisher: ci.yml on genaimanoj/figurify-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file figurify_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: figurify_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for figurify_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2e140f2b9657c36b9e14bcc8c84d781fda8fb1722d2c5edbad14b70fac99d00
MD5 6ee5263908bb2d64e594d8fb6d9b255d
BLAKE2b-256 144f275e09c38507710152b041ba5475736c01d033638248bc8312f4e6524883

See more details on using hashes here.

Provenance

The following attestation bundles were made for figurify_mcp-0.2.1-py3-none-any.whl:

Publisher: ci.yml on genaimanoj/figurify-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page