Skip to content

MCP Server Setup

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

MCP Server Setup

PaperBanana includes an MCP (Model Context Protocol) server that lets you generate diagrams directly from your IDE.

Supported Clients

Any MCP-compatible client works, including:

  • Cursor
  • VS Code (with Copilot MCP support)
  • Claude Desktop
  • Any client implementing the MCP specification

Configuration

Cursor

Add to your .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "paperbanana": {
      "command": "python",
      "args": ["-m", "mcp_server"],
      "cwd": "/path/to/paperbanana",
      "env": {
        "GOOGLE_API_KEY": "your-key-here"
      }
    }
  }
}

VS Code

Add to your MCP configuration:

{
  "mcpServers": {
    "paperbanana": {
      "command": "python",
      "args": ["-m", "mcp_server"],
      "cwd": "/path/to/paperbanana",
      "env": {
        "GOOGLE_API_KEY": "your-key-here"
      }
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "paperbanana": {
      "command": "python",
      "args": ["-m", "mcp_server"],
      "cwd": "/path/to/paperbanana",
      "env": {
        "GOOGLE_API_KEY": "your-key-here"
      }
    }
  }
}

Available Tools

Once connected, the MCP server exposes:

generate_diagram - Generate a methodology diagram from text.

Parameters:

  • source_context (string, required): The methodology section text
  • caption (string, required): Figure caption or communicative intent
  • iterations (integer, optional): Number of refinement rounds (default: 3)

generate_plot - Generate a statistical plot from data.

Parameters:

  • data (string, required): CSV or JSON data
  • intent (string, required): Description of the desired plot

evaluate - Evaluate a generated diagram against a reference.

Parameters:

  • generated_path (string, required): Path to generated image
  • reference_path (string, required): Path to reference image
  • context (string, required): Source methodology text
  • caption (string, required): Figure caption

Troubleshooting

Server not starting: Verify the cwd path points to your PaperBanana installation directory and that pip install -e ".[google]" completed successfully.

API key errors: Ensure GOOGLE_API_KEY is set either in the MCP config env block or in the .env file in the project root.

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.

Clone this wiki locally