-
Notifications
You must be signed in to change notification settings - Fork 295
MCP Server Setup
PaperBanana includes an MCP (Model Context Protocol) server that lets you generate diagrams directly from your IDE.
Any MCP-compatible client works, including:
- Cursor
- VS Code (with Copilot MCP support)
- Claude Desktop
- Any client implementing the MCP specification
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"
}
}
}
}Add to your MCP configuration:
{
"mcpServers": {
"paperbanana": {
"command": "python",
"args": ["-m", "mcp_server"],
"cwd": "/path/to/paperbanana",
"env": {
"GOOGLE_API_KEY": "your-key-here"
}
}
}
}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"
}
}
}
}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
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.