Skip to main content

Um servidor MCP que gera imagens usando a Google Gemini API.

Project description

MCP Nano Banana

PyPI Version

This project is an MCP (Model Context Protocol) server that generates images using the Google Gemini API.

Description

This server implements the Model Context Protocol to expose a single tool, generate_image, to a compatible AI model. The tool accepts a text prompt, uses the Google Gemini API to generate an image, saves the image to the public/ directory for auditing, and returns the raw image data as a base64-encoded string.

To use the server with Claude Desktop or other applications

You need a Google Gemini API key and ImgBB API key to use this server.

Access https://api.imgbb.com/ to generate a IMGBB API Key. This is used to store and host the image online.

{
  "mcpServers": {
    "mcp-nano-banana": {
        "command": "uvx",
        "args": [
            "mcp-nano-banana"
        ],
        "env": {
            "GEMINI_API_KEY": "YOUR_API_KEY_HERE",
            "IMGBB_API_KEY": "YOUR_API_KEY_HERE"
        }
    }
  }
}

Dev Setup

1. Dependencies

This project uses Python and its dependencies are defined in pyproject.toml. You can install them using pip:

pip install .
# Or
uv sync

This will install mcp, google-generativeai, and other required packages.

2. API Key

You need a Google Gemini API key and ImgBB API key to use this server.

Access https://api.imgbb.com/ to generate a IMGBB API Key. This is used to store and host the image online.

  1. Create a file named .env in the root of the project.
  2. Add your API key to the .env file in the following format:
    GEMINI_API_KEY="YOUR_API_KEY_HERE"
    IMGBB_API_KEY="YOUR_API_KEY_HERE"

Running the Server

This server is designed to be run as a subprocess by an MCP client or using the mcp command-line tool. The server listens for requests on stdio.

uvx --from git+https://github.com/GuilhermeAumo/mcp-nano-banana mcp-nano-banana

Publishing new pipy version

To publish a new version of this package to PyPI:

  1. Update the version
    Edit the version field in pyproject.toml to the new version number.

  2. Build the package
    Run:

    uv build
    

    This will create .tar.gz and .whl files in the dist/ directory.

  3. Upload to PyPI

    uv publish
    
  4. Tag the release (optional but recommended)
    Commit the changes to github first, then:

    git tag v<new-version>
    git push --tags
    

Note:

  • You need a PyPI account and must be listed as a maintainer of the project.

For more details, see the Python Packaging User Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_nano_banana-0.2.2.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_nano_banana-0.2.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_nano_banana-0.2.2.tar.gz.

File metadata

  • Download URL: mcp_nano_banana-0.2.2.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_nano_banana-0.2.2.tar.gz
Algorithm Hash digest
SHA256 0620b46806b464c53520d9866b59eab2f031209de0292d2c7b9813988a42183f
MD5 52ca991e340bd2d7bdfaf50aa443455f
BLAKE2b-256 90579ca4e92b25b89757193bb47251fae1024fd1a67236670ac3da0b22e9ce29

See more details on using hashes here.

File details

Details for the file mcp_nano_banana-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_nano_banana-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.04","id":"plucky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mcp_nano_banana-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8419161be2bfbfd81dde3cac4e70288c404f9331dcfaeb856ac5f1fefbff1bcc
MD5 8b7321c38d7300cfd6de2f1e26f6f6a9
BLAKE2b-256 6b9702f8634ddc45052a000d8a1e8a92c08ddd96531d646de706d9f3acc47cc5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page