MewCP Google Gemini MCP Server

Hosted, Stateless & Multitenant Gemini MCP server enables AI assistants to access multimodal AI capabilities, content generation, and reasoning workflows through Google Gemini.

Documentation

Access Google's most capable AI models through a single MCP tool.

A Model Context Protocol (MCP) server that exposes Google Gemini's API for generating text using state-of-the-art large language models.


Overview

The Gemini MCP Server provides direct access to Google's Gemini LLMs:

  • Generate high-quality text responses from natural language prompts
  • Choose between fast and capable Gemini model variants
  • Integrate Gemini's reasoning into any MCP-compatible AI workflow

Perfect for:

  • AI agents that need to delegate subtasks to a powerful LLM
  • Generating summaries, translations, code, or creative content
  • Augmenting workflows with Gemini's reasoning and language capabilities

Tools

gemini_ai_generate_text — Generate text using Gemini LLM

Sends a prompt to Google Gemini and returns the generated text response.

Inputs:

  • query (string, required) — Natural language prompt to send to Gemini
  • model (string, optional) — Gemini model to use: gemini-2.5-flash (default) or gemini-2.5-pro

Output:

{
  "prompt": "Summarize the history of the internet",
  "response": "The internet began as ARPANET in the late 1960s..."
}

Usage Example:

POST /mcp/gemini/gemini_ai_generate_text

{
  "query": "Summarize the history of the internet",
  "model": "gemini-2.5-flash"
}

API Parameters Reference

Available Models

ModelDescription
gemini-2.5-flashFast and efficient — best for most tasks (default)
gemini-2.5-proMore capable — best for complex reasoning and analysis

Authentication Setup

All tools authenticate via a Gemini API key stored in MewCP credentials. Here's the full setup:

Step 1: Get Your Gemini API Key

  1. Go to Google AI Studio API Keys
  2. Sign in with your Google account
  3. Click Create API Key
  4. Select or create a Google Cloud project to associate with the key
  5. Copy the generated key — store it securely, you will only see it once

Refer to the Gemini API Key documentation for details.

Step 2: Add the Key to MewCP

  1. Go to your MewCP dashboard → Credentials
  2. Click Add Credential and select Gemini
  3. Paste your Gemini API key in the API Key field
  4. Save — note the credential ID assigned to it

Step 3: Authenticate Your Requests

Include both headers in every request to the MewCP gateway:

Authorization: Bearer <YOUR_MEWCP_API_KEY>
X-Mewcp-Credential-Id: <YOUR_CREDENTIAL_ID>

The gateway resolves the stored Gemini API key from the credential ID and injects it into the server transparently — your Gemini key never travels in the request body.


Troubleshooting

Missing or Invalid API Key
  • Cause: MewCP authentication headers are missing or the credential is invalid
  • Solution:
    1. Verify both headers are present in your request:
      Authorization: Bearer <YOUR_MEWCP_API_KEY>
      X-Mewcp-Credential-Id: <YOUR_CREDENTIAL_ID>
      
    2. Check your MewCP API key is valid in your MewCP account
    3. Confirm the credential ID corresponds to a saved Gemini credential
Insufficient Credits
  • Cause: API calls have exceeded your request limits
  • Solution:
    1. Check usage limits in your MewCP dashboard
    2. Upgrade to a paid plan or add credits for higher limits
    3. Contact support for credit adjustments
Credential Not Connected
  • Cause: No Gemini API key linked to your account
  • Solution:
    1. Go to Credentials in your MewCP dashboard
    2. Add your Google Gemini API key
    3. Retry the request with the correct X-Mewcp-Credential-Id header
Malformed Request Payload
  • Cause: JSON payload is invalid or missing required fields
  • Solution:
    1. Validate JSON syntax before sending
    2. Ensure the query parameter is included and non-empty
    3. Check the model value matches one of the supported model names
Server Not Found
  • Cause: Incorrect server name in the API endpoint
  • Solution:
    1. Verify endpoint format: /mcp/{server-name}/{tool-name}
    2. Use correct server name from documentation
    3. Check available servers in your MewCP account
Gemini API Error
  • Cause: Upstream Google Gemini API returned an error
  • Solution:
    1. Check Google Cloud status at Google Status
    2. Verify your API key has access to the Gemini API and the selected model
    3. Review the error message returned in the response for specific details

Resources