gemini-mcp — Claude Code MCP server: Gemini 3 in your agent
Wires Gemini 3 models into Claude: image and video generation, web search, code analysis and Python execution.
claude mcp add --env GEMINI_API_KEY=<GEMINI_API_KEY> --env GEMINI_OUTPUT_DIR=<GEMINI_OUTPUT_DIR> --transport stdio gemini-mcp -- npx -y @rlabs-inc/gemini-mcpWhat gemini-mcp does
The server hands your agent more than thirty Gemini tools. Image generation goes up to 4K across ten aspect ratios, and you can keep refining a picture turn by turn in one session. There is video through Veo, text-to-speech with 30 voices, YouTube analysis by URL with timestamp clipping, PDF and spreadsheet parsing with table extraction, grounded web search with source links, and JSON output validated against a schema. A separate gemini-run-code tool has Gemini write and run Python — numpy, pandas, matplotlib, scipy, scikit-learn and tensorflow are supported. Charts land in the output directory and come back as images.
Two tools are built for working alongside Claude. gemini-brainstorm takes your own take on a problem and runs several rounds of back-and-forth with Gemini, while gemini-analyze-code reviews code for quality, security, performance or bugs. Reasoning depth is set per call with thinkingLevel, from minimal to high. Token counting and cost estimates run before the API call, so you can see what a request costs first. Video generation is asynchronous — poll it with the check tool.
None of this starts without a GEMINI_API_KEY, which you get from Google AI Studio and pass at registration. Set GEMINI_OUTPUT_DIR too if you want generated images and videos somewhere predictable instead of the default folder. The package also installs globally and ships a gcli CLI, where the key is stored in its config.
What it helps with
- generate a 4K image without leaving the agent
- create a Veo video and poll until it is ready
- pull tables and text out of a PDF or spreadsheet
- ground an answer in fresh web results with citations
- get a second opinion on code security and bugs
Example prompts for the agent
- Generate a cyberpunk city at sunset, 16:9, 2K
- Analyze this file for vulnerabilities and suggest fixes
- Calculate the first 50 primes and plot them
How to install gemini-mcp
Platform CLI
claude mcp add --env GEMINI_API_KEY=<GEMINI_API_KEY> --env GEMINI_OUTPUT_DIR=<GEMINI_OUTPUT_DIR> --transport stdio gemini-mcp -- npx -y @rlabs-inc/gemini-mcpReplace <…> with your own values
Platform CLI
codex mcp add gemini-mcp --env GEMINI_API_KEY=<GEMINI_API_KEY> --env GEMINI_OUTPUT_DIR=<GEMINI_OUTPUT_DIR> -- npx -y @rlabs-inc/gemini-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"gemini-mcp": {
"command": "npx",
"args": [
"-y",
"@rlabs-inc/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>",
"GEMINI_OUTPUT_DIR": "<GEMINI_OUTPUT_DIR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"gemini-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@rlabs-inc/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>",
"GEMINI_OUTPUT_DIR": "<GEMINI_OUTPUT_DIR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e GEMINI_API_KEY=<GEMINI_API_KEY> -e GEMINI_OUTPUT_DIR=<GEMINI_OUTPUT_DIR> gemini-mcp npx -y @rlabs-inc/gemini-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about gemini-mcp
How do I install gemini-mcp in Claude Code?
Run claude mcp add gemini-mcp -e GEMINI_API_KEY=<GEMINI_API_KEY> -- npx -y @rlabs-inc/gemini-mcp. For a custom folder for generated images and videos, use `claude mcp add --env GEMINI_API_KEY=<GEMINI_API_KEY> --env GEMINI_OUTPUT_DIR=<GEMINI_OUTPUT_DIR> --transport stdio gemini-mcp -- npx -y @rlabs-inc/gemini-mcp`.
What does gemini-mcp do?
It exposes Gemini 3 tools to your agent: image generation and multi-turn editing, Veo video, text-to-speech, web search, document and YouTube analysis, Python execution and schema-validated JSON output.
What do I need before it works?
A GEMINI_API_KEY from Google AI Studio, passed when you register the server. Setting GEMINI_OUTPUT_DIR is worth doing if you generate images or videos.