# Gemini Mcp

> MCP server that exposes Google Gemini as tools for Claude Code

- **Type:** MCP server
- **Install:** `agentstack add mcp-pavelguzenfeld-gemini-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [PavelGuzenfeld](https://agentstack.voostack.com/s/pavelguzenfeld)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.2
- **License:** MIT
- **Upstream author:** [PavelGuzenfeld](https://github.com/PavelGuzenfeld)
- **Source:** https://github.com/PavelGuzenfeld/gemini-mcp

## Install

```sh
agentstack add mcp-pavelguzenfeld-gemini-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# gemini-mcp

[](https://www.npmjs.com/package/claude-gemini-mcp)
[](https://registry.modelcontextprotocol.io)
[](https://nodejs.org)
[](LICENSE)

Lightweight [MCP](https://modelcontextprotocol.io) server that exposes Google Gemini as tools for Claude Code (or any MCP client).

Use Gemini for second opinions, large-context analysis, code review, or anything where a different model perspective helps.

## Tools

| Tool | Description |
|------|-------------|
| `gemini_ask` | Ask Gemini a question or give it a task |
| `gemini_analyze` | Send code/text for analysis with a specific instruction |
| `gemini_chat` | Multi-turn conversation with full history |
| `gemini_models` | List available Gemini models |

## Quick Start

### 1. Get an API key

Go to [Google AI Studio](https://aistudio.google.com/apikey) and create a free API key.

### 2. Install

**Option A — Clone (recommended for Claude Code)**

```bash
git clone https://github.com/PavelGuzenfeld/gemini-mcp.git ~/.claude/mcp-servers/gemini
cd ~/.claude/mcp-servers/gemini
npm install
```

**Option B — npx (no install)**

```bash
npx claude-gemini-mcp
```

### 3. Register with Claude Code

Add to `~/.claude/settings.json`:

```json
{
  "mcpServers": {
    "gemini": {
      "command": "node",
      "args": ["/home/you/.claude/mcp-servers/gemini/index.js"],
      "env": {
        "GEMINI_API_KEY": "your-key-here"
      }
    }
  }
}
```

Or with npx:

```json
{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "claude-gemini-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-key-here"
      }
    }
  }
}
```

## Usage Examples

### Ask a question
```
> Use gemini_ask to explain the difference between std::expected and std::optional

Gemini says: std::optional represents a value that may or may not be present...
std::expected additionally carries an error value when the expected value is absent...
```

### Analyze code
```
> Use gemini_analyze to review this function for performance issues:
  instruction: "Find performance bottlenecks"
  content: 

Gemini says: Line 12 allocates inside the loop — move the vector outside...
```

### Multi-turn conversation
```
> Use gemini_chat with messages:
  [{"role": "user", "content": "Design a REST API for a task manager"},
   {"role": "model", "content": "Here's a RESTful design..."},
   {"role": "user", "content": "Now add authentication"}]

Gemini says: Building on the previous design, add JWT-based auth...
```

### Override model per call
```
> Use gemini_ask with model: "gemini-2.5-flash" to quickly summarize this error log
```

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `GEMINI_API_KEY` | *(required)* | Google AI Studio API key |
| `GEMINI_MODEL` | `gemini-2.5-pro` | Default model for all tools |

## Models

| Model | Best for |
|-------|----------|
| `gemini-2.5-pro` | Best quality, large context (1M tokens) |
| `gemini-2.5-flash` | Fast, good for most tasks |
| `gemini-2.0-flash` | Fastest, simple tasks |

Every tool accepts an optional `model` parameter to override the default per-call.

## Features

- Retry with exponential backoff on rate limits (429) and server errors (5xx)
- Graceful error reporting back to the MCP client (no crashes)
- Per-call model override
- Zero configuration beyond the API key

## Troubleshooting

| Problem | Solution |
|---------|----------|
| `GEMINI_API_KEY is not set` | Add the key to your `env` block in `settings.json` |
| `429 Too Many Requests` | Built-in retry handles this — wait a few seconds |
| `Model not found` | Run `gemini_models` to list valid model names |
| Tools not appearing in Claude Code | Check `~/.claude/settings.json` syntax, restart Claude Code |
| `ECONNREFUSED` | Check network/firewall — the server calls `generativelanguage.googleapis.com` |

## Development

```bash
git clone https://github.com/PavelGuzenfeld/gemini-mcp.git
cd gemini-mcp
npm install
npm test          # Run smoke tests
node index.js     # Start the MCP server locally
```

## License

[MIT](LICENSE)

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [PavelGuzenfeld](https://github.com/PavelGuzenfeld)
- **Source:** [PavelGuzenfeld/gemini-mcp](https://github.com/PavelGuzenfeld/gemini-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.2 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.2** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-pavelguzenfeld-gemini-mcp
- Seller: https://agentstack.voostack.com/s/pavelguzenfeld
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
