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 Geminimodel(string, optional) — Gemini model to use:gemini-2.5-flash(default) orgemini-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
| Model | Description |
|---|---|
gemini-2.5-flash | Fast and efficient — best for most tasks (default) |
gemini-2.5-pro | More 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
- Go to Google AI Studio API Keys
- Sign in with your Google account
- Click Create API Key
- Select or create a Google Cloud project to associate with the key
- 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
- Go to your MewCP dashboard → Credentials
- Click Add Credential and select Gemini
- Paste your Gemini API key in the API Key field
- 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:
- Verify both headers are present in your request:
Authorization: Bearer <YOUR_MEWCP_API_KEY> X-Mewcp-Credential-Id: <YOUR_CREDENTIAL_ID> - Check your MewCP API key is valid in your MewCP account
- Confirm the credential ID corresponds to a saved Gemini credential
- Verify both headers are present in your request:
Insufficient Credits
- Cause: API calls have exceeded your request limits
- Solution:
- Check usage limits in your MewCP dashboard
- Upgrade to a paid plan or add credits for higher limits
- Contact support for credit adjustments
Credential Not Connected
- Cause: No Gemini API key linked to your account
- Solution:
- Go to Credentials in your MewCP dashboard
- Add your Google Gemini API key
- Retry the request with the correct
X-Mewcp-Credential-Idheader
Malformed Request Payload
- Cause: JSON payload is invalid or missing required fields
- Solution:
- Validate JSON syntax before sending
- Ensure the
queryparameter is included and non-empty - Check the
modelvalue matches one of the supported model names
Server Not Found
- Cause: Incorrect server name in the API endpoint
- Solution:
- Verify endpoint format:
/mcp/{server-name}/{tool-name} - Use correct server name from documentation
- Check available servers in your MewCP account
- Verify endpoint format:
Gemini API Error
- Cause: Upstream Google Gemini API returned an error
- Solution:
- Check Google Cloud status at Google Status
- Verify your API key has access to the Gemini API and the selected model
- Review the error message returned in the response for specific details
Resources
- Google AI Studio — Manage API keys and test Gemini models
- Gemini API Documentation — Official API reference
- Gemini Models Overview — Available models and capabilities
- FastMCP Docs — FastMCP specification
- fastmcp-credentials package — FastMCP Credentials specification