Skip the install. Get this working in under 2 minutes.
Start a free trial on cloud.anythingmcp.com, add the Google Gemini API in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.
Summary
Let your AI use Google Gemini with your own API key: ask Gemini models questions, analyse images and PDFs from a link, count tokens, create embeddings, and generate or edit pictures with Nano Banana that appear right in the chat.
Try asking
Example prompts for Google Gemini API
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Google Gemini API, paste your credentials, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Gemini API + Gemini CLI
Let your AI use Google Gemini with your own API key: ask Gemini models questions, analyse images and PDFs from a link, count tokens, create embeddings, and generate or edit pictures with Nano Banana that appear right in the chat.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
GEMINI_API_KEY
Step 1 — Get credentials
- Open Google AI Studio at
https://aistudio.google.com/apikeyand sign in with your Google account. - Click Create API key, pick or create a Google Cloud project, and copy the key. It usually starts with
AIza. - Paste it into
GEMINI_API_KEYand install the connector. The key is sent only to Google. - To generate images, or for higher limits, enable billing for the key's project in AI Studio (Get API key, then Set up billing). Image models have no free tier.
- Run
gemini_list_modelsto see which models your key can use. It costs nothing.
Billing: the Gemini API runs on your own key. Every call except the model list, the Files API and token counting is billed to the key's project or counts against its free tier. On the free tier, text and embedding models are free within per-minute and per-day limits, and Google may use free-tier prompts to improve its products. The AI uses cheap, fast defaults (gemini-3.1-flash-lite for text, gemini-embedding-001 for embeddings) unless you ask for a stronger model, and gemini_count_tokens estimates a long prompt for free before you send it.
Pictures cost money: gemini_generate_image and gemini_edit_image create or change pictures with Nano Banana and show them right in the chat. The default image model costs about $0.034 per picture, the most capable one about $0.13, so the AI confirms with you before every picture. Pictures over 4 MB are not returned: ask for a smaller size.
Files by link: gemini_analyze_file_url answers questions about an image, PDF, text or CSV file or a short video given by a public HTTPS link of up to 15 MB. Gemini fetches the link itself, so it must open without a login. The Files API tools list and read the project's stored files, which expire after 48 hours. gemini_delete_file is switched off at install.
Common errors: 400 with an invalid key: the key is wrong or was deleted, so create a new one in AI Studio. 403: the key is restricted to other APIs (in the Google Cloud console under Credentials, API restrictions, allow the Generative Language API), the API is off in its project, or a file link is not public. 404: the model code does not exist, so check gemini_list_models. 429: a free-tier or paid-tier limit was reached, or an image model was called without billing; wait, or enable billing. A 400 saying the free tier is not available means it is not offered in your region: enable billing. A request blocked by Google's safety filters comes back as an error and is not retried.
The connector does not upload files, stream audio or video (Live API), generate speech or video (Veo), or handle context caching, batch jobs, tuned models or file search stores.
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Gemini
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart
gemini. - Run
/mcpinside Gemini CLI (orgemini mcp listin your shell):anythingmcpshould show as connected. - Start prompting: Gemini CLI can now call the
Gemini APItools.
Available tools
| Tool | What it does |
|---|---|
gemini_list_models | List the Gemini models this API key can use, with their input and output token limits, whether they think, and the methods they support… |
gemini_get_model | Read one Gemini model: display name, description, version, input and output token limits, default temperature, top-p and top-k, whether it… |
gemini_generate_text | Ask a Gemini model one question and get its text answer (generateContent) |
gemini_generate_content | Full generateContent call for conversations and mixed input. contents is the list of turns: [{"role": "user", "parts": [{"text": "..."}]}… |
gemini_analyze_file_url | Ask a Gemini model about a file on the web: an image, a PDF, a text or CSV file or a short video, given by its public HTTPS link (up to 15… |
gemini_count_tokens | Count how many input tokens a text is for a Gemini model, to estimate cost or check it fits the context window before a long call |
gemini_embed_text | Turn one text into an embedding vector (embedContent) for semantic search, clustering or similarity |
gemini_batch_embed_texts | Embed up to 20 texts in one call (batchEmbedContents); the vectors come back in the order given |
gemini_generate_image | Create a picture from a text description with a Gemini image model (Nano Banana) and return it as an image the user can see |
gemini_edit_image | Change an existing picture with a Gemini image model: describe the edit ("replace the sky with a sunset", "remove the person on the left"… |
gemini_list_files | List the files stored in the project's Gemini Files API (uploaded for prompts, or generated), newest first, with name, display name, MIME… |
gemini_get_file | Read one file of the Gemini Files API: display name, MIME type, size, state (PROCESSING, ACTIVE or FAILED), uri to use in… |
gemini_delete_file | Delete a file from the Gemini Files API before it expires |
Example prompts
- "Read the supplier price list PDF at the link I paste below and list every product with its price."
- "Ask Gemini to rewrite this product description in a shorter, friendlier tone for our online shop."
- "How many tokens is this proposal for Gemini, and what would summarising it cost on the default model?"
- "Create a product photo of our blue ceramic mug on a wooden table with Nano Banana, but tell me the cost and wait for my OK first."
FAQ
Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.
Next steps
Was this guide helpful?