Back to Home
zhongweili icon

nanobanana-mcp-server

Verified Safe

by zhongweili

Overview

AI-powered image generation and editing using Google Gemini models (Flash and Pro) with intelligent model selection via Model Context Protocol.

Installation

Run Command
uvx nanobanana-mcp-server@latest

Environment Variables

  • GEMINI_API_KEY
  • GOOGLE_API_KEY
  • NANOBANANA_MODEL
  • IMAGE_OUTPUT_DIR
  • LOG_LEVEL
  • LOG_FORMAT
  • FASTMCP_TRANSPORT
  • FASTMCP_HOST
  • FASTMCP_PORT
  • FASTMCP_MASK_ERRORS

Security Notes

The server utilizes environment variables for API keys (`GEMINI_API_KEY` or `GOOGLE_API_KEY`), avoiding hardcoded secrets. It defaults to `stdio` transport, limiting network exposure; when HTTP transport is configured, `FASTMCP_HOST` defaults to `127.0.0.1`. Input validation (`core/validation.py`) is implemented for prompts, image counts, MIME types, base64 data, and file paths, including basic path traversal protection (`".." in path or path.startswith("/")`) for the `upload_file` tool. The `ruff.toml` explicitly enables security linting (`"S"` for flake8-bandit). `subprocess.run` is used in scripts but mostly without `shell=True` and for trusted `uv`/`twine` commands. Logging uses `stderr` for MCP STDIO compatibility, preventing log injection into RPC messages. Error details can be masked in production (`mask_error_details`).

Similar Servers

Stats

Interest Score43
Security Score9
Cost ClassHigh
Avg Tokens100000
Stars21
Forks9
Last Update2025-11-22

Tags

AI image generationGeminiMCP serverPythonMulti-model selection