paper-banana
An MCP server for generating process diagrams and CONOPS visuals for government and defense proposals using a multiagent AI pipeline with Gemini models.
README
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)

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.sh
The install script will:
- Install
uvif needed - Prompt for your
GOOGLE_API_KEY - Detect 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-banana
Manual — 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-banana
After 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 |
|---|---|---|---|
caption |
string | required | Communicative intent for the diagram |
source_context |
string | "" |
Raw proposal text to diagram |
source_file |
string | "" |
Path to a document file; section specifies which section to extract |
section |
string | "" |
Section heading to extract from source_file |
image_type |
string | "auto" |
"process", "conops", or "auto" (classifier decides) |
iterations |
integer | 3 |
Max visualizer/critic refinement cycles (1–5) |
output_path |
string | "output.png" |
Where to save the generated PNG |
save_artifacts |
boolean | true |
Save per-iteration PNGs + critique JSON to {stem}_artifacts/ |
export_schema |
boolean | true |
Append structured diagram YAML/JSON to critique file |
brand |
string | "mlst" |
Visual identity profile: "mlst" (purple/blue) or "default" (navy/gov) |
aspect_ratio |
string | "" |
Pin output dimensions: "16:9", "4:3", "1:1", "3:4", or "" (Planner decides) |
resume_from |
string | "" |
Path to a {stem}_run/ directory from a prior run to resume from |
user_feedback |
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 |
|---|---|---|
description |
string | Written description of what the image shows |
image_path |
string | Path to the image file |
caption |
string | Caption associated with the image |
image_type |
string | "process" or "conops" |
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 | #73628A |
Primary boxes, borders, headers, flow arrows |
| Muted purple | #9C8DAF |
Secondary elements, highlights |
| Pale purple | #EAE8EE |
Interior fill of content boxes |
| Blue | #3FA7D6 |
Data flows, supporting links |
| Coral | #FE5F55 |
Critical path, key decisions |
| Amber | #FAC05E |
Alternate emphasis |
| Green | #59CD90 |
Confirmation states, approved paths |
| Off-white | #FAFAFA |
Page background |
| Light gray | #EDEDED |
Swimlanes, grouping zones |
| Near-black | #313131 |
Body text |
default — government/defense
| Token | Hex | Usage |
|---|---|---|
| Navy blue | #1B3A6B |
Primary boxes, header bars, key actors |
| White | #FFFFFF |
Text on dark backgrounds, box interiors |
| Gray | #6B7280 |
Connectors, borders, annotations |
| Light gray | #F3F4F6 |
Swimlane backgrounds, grouping zones |
| Deep orange | #C2410C |
Decisions, critical path, highlights |
| Teal | #0D9488 |
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-banana
Pipeline I/O

Conncurrent Optimization

Run state persistence

推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。