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 .

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:

    python -m build
    

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

  3. Upload to PyPI
    Make sure you have twine installed:

    pip install twine
    

    Then upload:

    twine upload dist/*
    
  4. Tag the release (optional but recommended)

    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 test uploads, use TestPyPI and replace the upload command with:
    twine upload --repository testpypi dist/*
    

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.1.2.tar.gz (4.9 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.1.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_nano_banana-0.1.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for mcp_nano_banana-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b78222239223a778d28f27a10b5225b0d0b63eedf1cfca68ddb603dab62a4203
MD5 07ca2d1a2abd53215bec3237ae9ca35c
BLAKE2b-256 07d491268ef1920768067f6d7fc610dcb6c9ae6c9cbba3f5d0fa6e2e93e1f445

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_nano_banana-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f45d483e1c2be03f62d88fbf7f95095630b626aad3e91e279628a0005a29d3f
MD5 8d9b9e3456b5c3d28ccfd3b316c2d46d
BLAKE2b-256 84f3331775506e55fa53e81e53e5c47514c9f5fde9763e3b1e293310a40c3455

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