# Gemini CLI MCP server

> Lets developers query, edit, and automate codebases from the terminal using Gemini models and MCP tools.

- Repository: https://github.com/google-gemini/gemini-cli
- Page: https://hostedmcp.org/servers/google-gemini/gemini-cli
- Transport: —
- Stars: 108809
- License: Apache-2.0

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GEMINI_API_KEY` | no | no |  |
| `GOOGLE_API_KEY` | no | no |  |
| `GOOGLE_CLOUD_PROJECT` | no | no |  |
| `GOOGLE_GENAI_USE_VERTEXAI` | no | no |  |

## FAQ

### How do I install Gemini CLI?

You can install it globally with npm using npm install -g @google/gemini-cli, or run it instantly with npx @google/gemini-cli. Homebrew, MacPorts, and Anaconda installs are also supported.

### What authentication options does Gemini CLI support?

It supports Google sign-in via OAuth, a Gemini API key, and Vertex AI. The README describes each of these three options with example environment variables.

### Can I use Gemini CLI non-interactively in scripts?

Yes, use the -p flag for a simple text response, or add --output-format json or stream-json for structured or streaming output. This makes it usable in automated workflows.

### How do I connect MCP servers to Gemini CLI?

Configure MCP servers in ~/.gemini/settings.json to extend Gemini CLI with custom tools. You can then reference them with @ mentions like @github or @slack.

### Who is Gemini CLI intended for?

It is maintained for enterprise Gemini Code Assist workflows on Google Cloud, including Standard/Enterprise licenses and Code Assist for GitHub. Free individual and Google AI Pro/Ultra access moved to Antigravity CLI.
