Gemini MCP Tool
An MCP server that lets the agent call Gemini through its CLI to analyze large files and whole codebases
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Runs an external CLI as a subprocess and sends file contents to a Google service
- Can execute code in Gemini's sandbox on request
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/gemini-mcp-toolDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Run in a terminal
claude mcp add --transport stdio gemini-cli -- npx -y gemini-mcp-toolOr add to the file .mcp.json, in the project
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
The button opens the agent and offers to add the server. If nothing happens, copy the config below.
Add to the file ~/.cursor/mcp.json, for all projects
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key. For a single project, put the same block into .cursor/mcp.json.
The button opens the agent and offers to add the server. If nothing happens, copy the config below.
Run in a terminal
code --add-mcp '{"name":"gemini-cli","type":"stdio","command":"npx","args":["-y","gemini-mcp-tool"]}'Or add to the file .vscode/mcp.json, in the project
{
"servers": {
"gemini-cli": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the servers key.
Run in a terminal
codex mcp add gemini-cli -- npx -y gemini-mcp-toolOr add to the file ~/.codex/config.toml, for all projects
[mcp_servers.gemini-cli]
command = "npx"
args = ["-y", "gemini-mcp-tool"]If the file already exists, append the block to the end.
Add to the file ~/.gemini/settings.json, for all projects
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
Add to the file ~/.config/devin/mcp_config.json, for all projects
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key. Legacy Cascade keeps the MCP config in ~/.codeium/windsurf/mcp_config.json.
Formerly Windsurf.
Add to the file cline_mcp_settings.json, for all projects
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key. Open the settings file in Cline: MCP Servers tab, Configure MCP Servers.
Add to the file .roo/mcp.json, in the project
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
A fork of Roo Code, same .roo folders.
Add to the file opencode.json, in the project
{
"mcp": {
"gemini-cli": {
"type": "local",
"command": [
"npx",
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcp key.
Add to the file ~/.config/zed/settings.json, for all projects
{
"context_servers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the context_servers key.
Add to the file .codeassistant/mcp.json, in the project
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": [
"-y",
"gemini-mcp-tool"
]
}
}
}If the file already exists, add the server inside the mcpServers key.
Make sure a Gemini CLI or Antigravity CLI is installed and configured, then connect the server with claude mcp add gemini-cli -- npx -y gemini-mcp-tool. After that ask it to analyze files via the @ syntax.
Other ways from the author
claude mcp add gemini-cli -- npx -y gemini-mcp-toolConnects the server to Claude Code. A Gemini CLI or Antigravity CLI must be installed first.
This is third-party code. Review the repository files before installing.
What it does
The server links a coding agent to the Gemini command line and lets it hand Gemini heavy tasks, using its large context window. Through the @ syntax a request can include files and directories for Gemini to analyze and return an explanation or summary, sparing the main agent's context. It offers a tool for asking Gemini questions, a joint brainstorm mode and a sandbox for running code safely. After Google retired free access to the Gemini CLI, the server defaults to its successor, the Antigravity CLI, while paid and enterprise tiers switch the old backend back on via an environment variable. Authentication happens in the external CLI; the server itself stores no keys.
Who it is for. For developers who work in a coding agent and want to offload analysis of large files and repositories to Gemini.
Good fit when
- You need to analyze a large file or a whole repository that does not fit the main agent's context
- You want a second opinion from Gemini right inside your coding agent
- You need to run code or a script safely in Gemini's sandbox
Not a fit when
- You do not have a Gemini CLI or Antigravity CLI installed and configured
- The task is small and fits the main agent's context without calling out
Example request
Ask gemini to analyze @src and explain how the main data flow is organizedLimitations
It needs Node.js 16 or newer and an installed Gemini CLI or Antigravity CLI, with sign-in done in the CLI itself. Google retired free access to the Gemini CLI, so the Antigravity CLI is used by default, and its backend is marked experimental with limits on models and sandbox. Google's Gemini and Antigravity services are unavailable from Russia without a VPN. This is an unofficial third-party tool and is not affiliated with Google.
How to disable. Remove the gemini-cli entry from your MCP client config. In Claude Code use claude mcp remove gemini-cli.
MCP
- Transport
- stdio
- Authentication
- not required
| Environment variables | |
|---|---|
| GEMINI_MCP_BACKEND | Backend choice: gemini or agy. Unset uses the date-aware default, which is agy from 2026-06-18. |
| AGY_CLI_PATH | Full path to the agy binary if it is not on the server's PATH. |
Security check
- Runs an external CLI as a subprocess and sends file contents to a Google service
- Can execute code in Gemini's sandbox on request
README in short
The README describes an MCP server that links an AI assistant to the Gemini command line to use its large context window for analyzing big files and codebases. Files and directories are included in a request via the @ syntax, and there are tools for questions, brainstorming and a sandbox for safe code execution. It also covers the move from the retired free Gemini CLI to the Antigravity CLI and the environment variables that control backend choice, binary path and timeout. Installation is a single npx command or an entry added to the MCP client config. The tool is unofficial and not affiliated with Google, under the MIT license.
FAQ
Do I need a separate key in the server config?
No, the server stores no keys. Authentication and access are set up in the Gemini CLI or Antigravity CLI itself, where you sign in once.
What about the free Gemini CLI?
Google retired its free access, so the server defaults to the Antigravity CLI. Paid and enterprise tiers can switch the old backend back on with an environment variable.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything