home / mcp / nanobanana mcp server
Provides an MCP bridge to OpenRouter, enabling chat, image/text inputs, and model listing via MCP clients.
Configuration
View docs{
"mcpServers": {
"caoshuo594-nano_banana": {
"command": "uvx",
"args": [
"nano-banana-mcp@git+https://github.com/caoshuo594/nano_banana.git"
],
"env": {
"OPENROUTER_API_KEY": "YOUR_API_KEY_PLACEHOLDER"
}
}
}
}NanoBanana MCP Server exposes the OpenRouter API through the MCP (Model Context Protocol) interface, allowing clients like Claude Code CLI and Claude Desktop to send requests, generate prompts, and receive image and text outputs via MCP tools.
You connect your MCP client to the NanoBanana MCP Server using one of the available configurations. The server supports chat completion and model listing, and it can handle both text and image inputs through the OpenRouter backend. Once connected, you can ask for image generation tasks, have conversations with a model through Chat Completion, or list available models to tailor your prompts.
Prerequisites you need before installing: Python and pip, and a runtime tool to launch the MCP server (either uvx for quick startup or a direct Python execution path for development). You will also create an API key for OpenRouter and place it in your client configuration.
# Install uv for quick MCP server startup (recommended)
pip install uv
# Optional: clone path if you prefer developing locally (not required for theuvx flow)
# git clone https://github.com/caoshuo594/nano_banana.git
# cd nano_banana
# If you want to use the rapid uvx-based run (from a Git URL), you can configure it like this in your MCP client:To run via uvx (recommended) without cloning, ensure uv is installed and configure your MCP client to point to the Git-based MCP entry as shown in the configuration example.
The MCP server can be reached in two straightforward ways. Choose the stdio configuration for local execution, or use the git-backed setup to run directly from a remote repository.
{
"mcpServers": {
"nano-banana": {
"command": "uvx",
"args": ["nano-banana-mcp@git+https://github.com/caoshuo594/nano_banana.git"],
"env": {
"OPENROUTER_API_KEY": "sk-or-v1-your-actual-key-here"
}
}
}
}Alternatively, if you clone the repository locally and run it from source, configure your client like this.
{
"mcpServers": {
"nano-banana": {
"command": "python",
"args": ["-m", "mcp_server"],
"cwd": "/path/to/nano_banana",
"env": {
"OPENROUTER_API_KEY": "sk-or-v1-your-actual-key-here"
}
}
}
}You must obtain an OpenRouter API key and place it in your MCP client environment. The required steps are: create an API key on the OpenRouter API Keys page and copy the key in the form sk-or-v1-... then paste it into the env section of your MCP client configuration as OPENROUTER_API_KEY.
API URL to connect is https://openrouter.ai/api/v1 and the default model is google/gemini-3-pro-image-preview. After updating keys or defaults, restart your MCP client to apply changes.
For testing during development, you can run the MCP Inspector with a local Python entry point to validate the server behavior.
npx @modelcontextprotocol/inspector python mcp_server.pyIf you encounter connection issues, ensure Python is in your PATH, verify the mcp_server.py path, check client logs, and try running the server directly with python mcp_server.py to surface errors.
The server supports chat completion, image and text input, and model listing. It is designed to work with Claude Code CLI and Claude Desktop through MCP. Ensure you replace placeholder API keys with actual values and restart clients after configuration changes.
Send a chat-based completion request to the OpenRouter API, with messages, model, and optional parameters to generate responses.
Query the OpenRouter API to list all available models.