Get the FREE Ultimate OpenClaw Setup Guide →

GeminiMcpServer

Generate image via Google Gemini API for LM Studio.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio bowwowxx-geminimcpserver npm run start

How to use

GeminiMcpServer is an MCP server that bridges LM Studio (and other MCP-compatible clients) with Google Gemini API for image generation and multimodal tasks. It exposes MCP-compatible endpoints so clients can request image generation and other multimodal operations, with the actual computation performed via Google's Gemini API in the cloud while local tooling can be used for orchestration. The server supports optional multimodal input (text and image) and can leverage Gemini 2 for image generation on demand. To use it, start the server and connect an MCP client (like LM Studio) to the GeminiMcpServer instance; clients can issue requests such as generateImage with prompts and output formats, and the server will route those requests to Gemini.

How to install

Prerequisites:

  • Node.js v20 or newer
  • Git
  • Access to Google Gemini API (API key)

Installation steps:

  1. Clone the repository git clone git@github.com:bowwowxx/GeminiMcpServer.git
  2. Navigate into the project cd GeminiMcpServer
  3. Install dependencies npm install
  4. Create Google API key
    • Go to Google AI Studio (or Makersuite API key page) and generate a new API key
  5. Configure environment variables
    • Create a .env file in the project root and add: GEMINI_API_KEY="your_api_key_here"
  6. Start the server
    • Use the npm script defined in package.json (see below) or the command: npm start

Additional notes

Notes and tips:

  • Ensure GEMINI_API_KEY is set in the environment (via .env or your shell) before starting the server.
  • The MCP client (e.g., LM Studio) should be configured to connect to the GeminiMcpServer as shown in the LM Studio settings example.
  • If you need to test the Gemini 2 image generation endpoint locally, you can run test scripts like npx tsx testapi.js (if available) to exercise the MCP endpoints.
  • Be aware of network latency when using cloud-based Gemini API; configure timeouts in your MCP client if needed.
  • You can adapt the npm start script in package.json if you rename or relocate the server entry point.

Related MCP Servers

Sponsor this space

Reach thousands of developers