Skip to content

MCP Server Setup

Dipkumar Patel edited this page Feb 5, 2026 · 2 revisions

MCP Server Setup

PaperBanana includes an MCP server that lets you generate diagrams directly from your IDE or AI coding assistant.

Available Tools

The MCP server exposes three tools:

Tool What it does
generate_diagram Generate a methodology diagram from text context + caption
generate_plot Generate a statistical plot from JSON data + intent description
evaluate_diagram Compare a generated diagram against a human reference (scored on 4 dimensions)

Prerequisites

You need a free Google Gemini API key from Google AI Studio.

You also need uv installed for the uvx command:

curl -LsSf https://astral.sh/uv/install.sh | sh

Claude Code

Quick setup (single command):

claude mcp add paperbanana -- uvx --from "paperbanana[mcp]" paperbanana-mcp

Then edit ~/.claude/claude_code_config.json to add your API key:

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

Manual setup:

Add the JSON above directly to ~/.claude/claude_code_config.json (global) or .claude/claude_code_config.json (project-level).

Cursor

Create .cursor/mcp.json in your project root:

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

VS Code (Copilot), Windsurf, and Other Clients

The config JSON is the same as above. The file location varies by client. Check your client's MCP documentation for where to place the configuration.

Claude Code Skills

The repo also ships with three Claude Code skills in .claude/skills/. These are slash commands available when you work inside the cloned repository:

Skill Usage
/generate-diagram /generate-diagram method.txt "Overview of our architecture"
/generate-plot /generate-plot results.csv "Bar chart comparing accuracy"
/evaluate-diagram /evaluate-diagram output.png reference.png

To get the skills:

git clone https://github.com/llmsresearch/paperbanana.git
cd paperbanana

Open Claude Code in that directory. The skills appear automatically. They call the MCP tools under the hood, with CLI fallback if the MCP server isn't configured.

Skills are project-scoped and only appear when Claude Code is running inside the PaperBanana repo directory.

After Setup

Once configured, describe what you want in natural language. Examples:

"Generate a methodology diagram for this text: Our framework uses a two-phase pipeline with five specialized agents. Phase 1 performs linear planning through Retriever, Planner, and Stylist agents. Phase 2 iteratively refines the output using Visualizer and Critic agents. Caption: Overview of the multi-agent framework."

"Create a bar chart from this data: models are GPT-4, Claude, Gemini with accuracy scores 0.92, 0.94, 0.91. Intent: Bar chart comparing model accuracy on benchmark."

The MCP tools handle everything. Output is a PNG saved to disk and returned to the conversation.

Troubleshooting

Server not starting: Verify uv is installed (uv --version). If using uvx, it downloads the package on first run, which takes a few seconds.

API key errors: Make sure GOOGLE_API_KEY is set in the env block of your MCP config.

Timeout errors: Diagram generation takes 30-90 seconds depending on iterations and API response times. Some MCP clients have default timeouts that may need adjustment.

Server not appearing in IDE: Restart your IDE after modifying MCP configuration. For Claude Code, run claude mcp list to verify the server is registered.

Clone this wiki locally