Google Gemini MCP server for AI agents

Live

API KEY

MULTIMODAL AI

AI

Google Gemini gives your agent the Gemini API: generate text and multimodal responses, create images and short videos, embed content, count tokens, and run batch jobs, context caches, and Deep Research interactions.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Google Gemini
agent · Acme Q3
Run
Did last night's embeddings batch finish?
S
gemini_get_batch
99ms
LLM ops agent
Yes. The batch succeeded with all 12,000 requests complete, and the results are ready to read.
Sources: 1 batch job
gemini
1 batch
18:29
Message Claude...

Tools your LLM ops agent reaches for on Google Gemini, scoped per user.

CALL ANY TOOL
26 tools for multimodal AI in Google Gemini: generate content, images, and video, create embeddings, count tokens, run and cancel batch jobs, manage context caches and files, and run interactions such as Deep Research.
gemini_batch_embed_contents
Batch embed contents
Create embeddings for several texts in one synchronous call, one vector per text. Returns embeddings, an array of {values} in the same order as the input texts. Use for up to about 100 short texts. Use gemini_embed_content for one input, and gemini_create_embeddings_batch for large asynchronous jobs at lower cost.
Parameters
Name
Type
Required
Description
model
string
Required
Model id without the models/ prefix, for example gemini-embedding-001. Use an embedding model.
texts
array
Required
Texts to embed, one embedding each. Example: ["What is AI?", "How do magnets work?"].
output_dimensionality
integer
Optional
Truncate the embedding to this many dimensions, for example 768, 1536 or 3072. Leave empty for the model's full size.
task_type
string
Optional
What the embedding is for, which tunes it: RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION_ANSWERING, FACT_VERIFICATION or CODE_RETRIEVAL_QUERY. Honoured by gemini-embedding-001; for text with gemini-embedding-2 Google recommends a task prefix in the text instead. One of: `RETRIEVAL_QUERY`, `RETRIEVAL_DOCUMENT`, `SEMANTIC_SIMILARITY`, `CLASSIFICATION`, `CLUSTERING`, `QUESTION_ANSWERING`, `FACT_VERIFICATION`, `CODE_RETRIEVAL_QUERY`.
gemini_cancel_batch
Batch cancel
gemini_cancel_interaction
Cancel interaction
gemini_count_tokens
Count tokens
gemini_create_batch
Batch create
gemini_create_cached_content
Create cached content
gemini_create_embeddings_batch
Batch create embeddings
gemini_create_interaction
Create interaction
gemini_delete_batch
Batch delete
gemini_delete_cached_content
Delete cached content
gemini_delete_file
Delete file
gemini_delete_interaction
Delete interaction
gemini_embed_content
Embed content
gemini_generate_content
Generate content
gemini_generate_image
Generate image
gemini_generate_video
Generate video
gemini_get_batch
Batch get
gemini_get_cached_content
Get cached content
gemini_get_file
Get file
gemini_get_interaction
Get interaction
gemini_get_model
Get model
gemini_list_batches
List batches
gemini_list_cached_contents
List cached contents
gemini_list_files
List files
gemini_list_models
List models
gemini_update_cached_content
Update cached content
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Google Gemini tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["gemini"], toolNames: [
    "gemini_count_tokens",
    "gemini_generate_content",
    "gemini_embed_content"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Count the tokens in this prompt, then summarize the attached report" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["gemini"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Count the tokens in this prompt, then summarize the attached report" }],
  tools,
});

// Execute the tool call with the user's vaulted Google Gemini API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["gemini"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Count the tokens in this prompt, then summarize the attached report" }],
  tools,
});

// Tool call runs with the user's vaulted Google Gemini API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["gemini"] }, pageSize: 100,
});

const agent = new Agent({
  name: "llm_ops_agent",
  model: "gemini-2.5-pro",
  instruction: "Google Gemini tools scoped to this user",
  tools,
});

await agent.run("Count the tokens in this prompt, then summarize the attached report");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Google Gemini tool. Click to copy, paste into your agent, done.
Generate
Copy the prompt
Copied
Summarize this uploaded PDF in 5 bullet points.
Copy the prompt
Copied
Generate a product image of a blue backpack on a mountain trail.
Copy the prompt
Copied
Generate a short video of a paper plane flying over a city.
Embeddings and tokens
Copy the prompt
Copied
Embed these 50 FAQ answers for our search index.
Copy the prompt
Copied
Count the tokens in this prompt before I send it.
Copy the prompt
Copied
List the Gemini models my API key can use.
Batches and caches
Copy the prompt
Copied
Create a batch job for these 1,000 classification prompts.
Copy the prompt
Copied
Cache this 300-page manual so later questions reuse it.
Copy the prompt
Copied
Run a Deep Research interaction on the EV charging market.
SEE HOW AUTH WORKS
Each user connects their own Google Gemini API key once, and Scalekit sends it with every call. Keys stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Google Gemini
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Google Gemini
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Google Gemini
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Google Gemini
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other AI and media connectors.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Support and Ops Teams
Meeting prep
Pulls agenda, participant context, and open action items before every meeting.
Test other agents
See the same per-user auth pattern across other AI and media connectors.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
OPS
Meeting prep agent
Assemble the agenda, HubSpot attendee history, and open action items from Gmail before every meeting on the calendar.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Google Gemini API key looks fine in a demo. In production every generation request looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Google Gemini today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Google Gemini as the user or through a shared API key?
As the user. Each user connects their own Google Gemini API key once, and Scalekit sends it with every call. Audit logs attribute every generation and batch to that user, not a shared service account.
Where is the Google Gemini API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate it, the user reconnects with a new API key. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Google Gemini?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example content generation and token counting without gemini_delete_file, gemini_delete_cached_content, or gemini_delete_batch. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Google Gemini access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
How long do uploaded files last?
Files in the Gemini Files API are kept for 48 hours. gemini_list_files and gemini_get_file show what is stored for the API key's project, and gemini_delete_file removes a file before it expires.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""gemini"": {
""url"": ""https://mcp.scalekit.com/gemini"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.gemini]
url = ""https://mcp.scalekit.com/gemini""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""gemini"": {
""url"": ""https://mcp.scalekit.com/gemini"",
""type"": ""http""
}
}
}