paper-banana
Integrates with Google's Gemini API for AI-powered image generation and analysis, enabling proposal diagram creation and iterative refinement.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@paper-banana Generate a CONOPS diagram for the missile defense proposal"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Paper Banana — Proposal Image Generator
A multiagent AI pipeline for generating process diagrams and CONOPS visuals for government and defense proposals. Based on the Paper Banana framework (arXiv 2601.23265), adapted for proposal-domain aesthetics and distributed as an MCP server.
Architecture
User Input (proposal text + caption/intent)
|
v
[1] Classifier Agent Determines: process diagram vs. CONOPS image
|
v
[2] Retriever Agent Selects N most relevant examples from library
| (library starts empty; grows via add_example)
v
[3] Planner Agent Synthesizes detailed visual description (few-shot)
|
v
[4] Stylist Agent Applies proposal-specific aesthetic guidelines
|
v
[5] Visualizer Agent Calls gemini-3-pro-image-preview -> generates PNG
| ^
| | (refined description, up to T=3 rounds)
v |
[6] Critic Agent Evaluates image, produces refined description
|
v
Final Image (PNG)
Related MCP server: mmc-mcp
Models
Agent | Model | Role |
Extractor | gemini-3.6-flash | Pulls the relevant section from a full document |
Optimizer | gemini-3.6-flash | Enriches context + sharpens caption (2 concurrent calls) |
Classifier | gemini-3.6-flash | Fast classification, no deep reasoning needed |
Retriever | gemini-3.6-flash | Relevance scoring across examples |
Planner | gemini-3.1-pro-preview | Best reasoning for synthesizing visual descriptions |
Stylist | gemini-3.1-pro-preview | Creative + domain-aware aesthetic refinement |
Visualizer | gemini-3-pro-image | Image generation |
Critic | gemini-3.6-flash | Different model family from Planner/Stylist (anti-bias) |
Prerequisites
A Gemini API key with access to the models listed above (get one at aistudio.google.com/apikey)
SSH or HTTPS access to the repo
Quick Start
Automatic (recommended)
git clone git@github.com:lexicalninja/paper-banana.git
cd paper-banana
./install.shThe install script will:
Install
uvif neededPrompt for your
GOOGLE_API_KEYDetect Claude Code and/or VS Code and configure them
Optionally seed the example library
On Windows, use install.ps1 instead.
Manual — Claude Code
claude mcp add paper-banana -e GOOGLE_API_KEY=your-key -- \
uvx --from "git+ssh://git@github.com/lexicalninja/paper-banana.git" paper-bananaManual — VS Code
You can install at the user level (available in every workspace) or the workspace level (scoped to one project).
User-level — edit ~/Library/Application Support/Code/User/mcp.json (macOS) or ~/.config/Code/User/mcp.json (Linux) or %APPDATA%\Code\User\mcp.json (Windows). Add paper-banana inside the top-level servers object:
{
"servers": {
"paper-banana": {
"command": "uvx",
"args": ["--from", "git+ssh://git@github.com/lexicalninja/paper-banana.git", "paper-banana"],
"env": { "GOOGLE_API_KEY": "your-key" }
}
}
}Workspace-level — add the same block to .vscode/mcp.json in your project root. This is safe to commit so teammates get the server automatically.
Local Development
pip install -e .
export GOOGLE_API_KEY=your-key
paper-bananaAfter setup, the generate_proposal_image and add_example tools will appear in your MCP client.
MCP Tools
generate_proposal_image
Generate a proposal diagram image.
Parameter | Type | Default | Description |
| string | required | Communicative intent for the diagram |
| string |
| Raw proposal text to diagram |
| string |
| Path to a document file; |
| string |
| Section heading to extract from |
| string |
|
|
| integer |
| Max visualizer/critic refinement cycles (1–5) |
| string |
| Where to save the generated PNG |
| boolean |
| Save per-iteration PNGs + critique JSON to |
| boolean |
| Append structured diagram YAML/JSON to critique file |
| string |
| Visual identity profile: |
| string |
| Pin output dimensions: |
| string |
| Path to a |
| string |
| Freeform feedback about the prior output; overrides original intent in the critic |
Returns the absolute path to the saved PNG.
Resuming a run
Each run saves state to {output_stem}_run/run_input.json. Pass that directory to resume_from to skip the full pipeline and iterate from where you left off:
generate_proposal_image(
caption="",
resume_from="output/my_diagram_run",
user_feedback="Add a decision diamond after step 2 with yes/no branches",
iterations=2
)Use user_feedback to steer the next generation. The pipeline critiques the existing image first, bakes the feedback into a revised description, then generates.

add_example
Add a reference image to the example library. The library starts empty; add examples over time to improve retrieval quality.
Parameter | Type | Description |
| string | Written description of what the image shows |
| string | Path to the image file |
| string | Caption associated with the image |
| string |
|
Returns the unique ID assigned to the new example.
Cold Start
The library starts empty (examples/metadata.json contains []). On an empty library, the pipeline proceeds zero-shot (a warning is logged). Use add_example to build up a reference library over time. Retrieval quality improves noticeably after ~5 examples per diagram type.
Design Aesthetic
Two brand profiles ship with the server, selected via the brand parameter.
mlst (default) — MLST purple
Token | Hex | Usage |
Brand purple |
| Primary boxes, borders, headers, flow arrows |
Muted purple |
| Secondary elements, highlights |
Pale purple |
| Interior fill of content boxes |
Blue |
| Data flows, supporting links |
Coral |
| Critical path, key decisions |
Amber |
| Alternate emphasis |
Green |
| Confirmation states, approved paths |
Off-white |
| Page background |
Light gray |
| Swimlanes, grouping zones |
Near-black |
| Body text |
default — government/defense
Token | Hex | Usage |
Navy blue |
| Primary boxes, header bars, key actors |
White |
| Text on dark backgrounds, box interiors |
Gray |
| Connectors, borders, annotations |
Light gray |
| Swimlane backgrounds, grouping zones |
Deep orange |
| Decisions, critical path, highlights |
Teal |
| Data flows, supporting systems, feedback paths |
Running Directly
# Start the MCP server (used by VS Code / Claude Code)
python -m paper_banana.server
# Or via the installed entry point
paper-bananaPipeline I/O

Conncurrent Optimization

Run state persistence

Available Tools
3 toolsadd_exampleB
Add a reference image to the example library.
Args: description: Written description of what the image shows. image_path: Absolute or relative path to the image file. caption: The caption associated with this image. image_type: Diagram type — 'process' or 'conops'. source_context: Optional full methodology text to enrich retrieval scoring.
Returns: The unique ID assigned to the new example.
Inputs: caption (required), image_path (required), image_type (required), description (required), +1 more. Returns: result
generate_proposal_imageA
Generate a proposal diagram image using the Paper Banana pipeline.
Provide either source_file (recommended) or source_context — not both.
To resume a previous run, set resume_from to the path of the run-state
directory (e.g. output_run/) created during the original run.
Args:
caption: The caption or communicative intent for the image (required).
source_file: Path to the proposal document (markdown or text). The Extractor
agent will read this file and pull the relevant section automatically.
Recommended over source_context for full documents.
section: Section hint for the Extractor — number, name, or both
(e.g. '1.1', 'Development Services', '1.1 Development Services').
Only used when source_file is provided.
source_context: Raw proposal section text. Use this only when passing a
pre-extracted section directly (not a full document).
image_type: Diagram type — 'process', 'conops', or 'auto' (auto-detected).
iterations: Number of Visualizer ↔ Critic refinement rounds (1-5). Default 3.
output_path: File path where the generated PNG will be saved. Default 'output.png'.
save_artifacts: If True, save per-iteration PNG and critique JSON to
{output_stem}_artifacts/ alongside the final image. Default True.
export_schema: If True (and save_artifacts is also True), extract a structured
diagram schema (elements, connectors, layout) from each iteration's
image and merge it into the critique JSON as 'diagram_schema'. Default True.
brand: Named brand profile to apply — 'mlst' (purple/blue) or
'default' (government/defense palette). Default 'mlst'.
resume_from: Path to a run-state directory ({output_stem}_run/) created by
a previous run. When set, the extractor/optimizer/classifier/
retriever/planner/stylist stages are skipped and the pipeline jumps
directly to the Visualizer ↔ Critic refinement loop using the saved
description, caption, and image type. Leave empty for a fresh run.
user_feedback: Free-text feedback about the previous run's output. Injected as a
prefix into the critic's system prompt so all refinement iterations
take the feedback into account. Only meaningful when resume_from is
also set (but can be used on fresh runs too).
aspect_ratio: Desired output aspect ratio — '16:9', '4:3', '1:1', or '3:4'.
Leave empty (default) to let the Planner recommend a ratio based on
the diagram content. When provided, this hard-overrides the Planner's
recommendation.
Returns: Absolute path to the saved PNG image.
Inputs: caption (required), brand, section, image_type, +9 more. Returns: result
get_versionA
Return the current installed version of Paper Banana, with an update notice if behind.
Returns: Version string, e.g. '0.1.0' or '0.1.0 (3 commit(s) behind origin/main — run git pull)'.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: generating images, managing examples, and checking version. No overlap or ambiguity.
All tool names follow a consistent verb_noun snake_case pattern (generate_proposal_image, add_example, get_version), making them predictable and easy to understand.
Three tools for a focused image generation pipeline is reasonable. It covers the core workflow and a supporting operation, though slightly minimal.
The set covers the main generate flow and example management, but lacks operations like listing or deleting examples, which limits full workflow coverage.
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
B2B, GovCon & LegalTech MCP server for live RFPs, contract parsing, compliance & proposal tools.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA dual-server MCP implementation with task-based AI processing using Google Gemini API, featuring tool integration, real-time monitoring dashboard, and extensible framework for custom AI workflows.-

mmc-mcpofficial
FlicenseNot gradedqualityFmaintenanceMCP server that lets AI agents execute structured business processes by exposing process steps as tools with a sequenced event bus to prevent skipping steps.1-- AlicenseBqualityDmaintenanceMCP server that enables LLMs to create and edit draw.io diagrams using high-level intent commands, with automatic layout and styling.47 npm4MIT
- AlicenseAqualityDmaintenanceMCP server for generating diagrams, charts, and visualizations using Gemini image generation on Vertex AI. Supports auto-detection of diagram types, multiple style modes, and iterative refinement.367 npm1MIT