Skip to main content
Glama
rlaksana

mcp-cli-gemini

by rlaksana
README.md
# MCP CLI Gemini

MCP server that wraps Gemini CLI for use with other AI tools via the Model Context Protocol.

## Features

Single unified **gemini** tool that supports:
- One-shot queries to Gemini CLI
- Interactive mode session commands
- Extension management

## Prerequisites

- [Gemini CLI](https://github.com/google/generative-ai-js/tree/main/packages/gemini-cli) installed and configured
- Node.js 18+

## Installation

```bash
npm install
npm run build
```

## Usage

### Add to Claude Desktop

Edit your Claude Desktop config file:

**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`

Add the server:

```json
{
  "mcpServers": {
    "gemini-cli": {
      "command": "node",
      "args": ["D:\\WORKSPACE\\tools-node\\mcp-cli-gemini\\dist\\index.js"]
    }
  }
}
```

### Add to Other MCP Clients

Use stdio transport with:

```bash
node dist/index.js
```

## Available Tools

### gemini

Unified tool for all Gemini CLI operations.

**Parameters:**
- `query` (required): Query to send to Gemini CLI
- `model` (optional): Model to use (e.g., "gemini-pro", "gemini-1.5-flash")
- `sandbox` (optional): Run in sandbox mode for code execution
- `yolo` (optional): Auto-approve all actions
- `interactive` (optional): Run in interactive mode (returns command for manual execution)
- `extensions` (optional): Extension command: "list" or "info:extensionName"

**Examples:**

Basic query:
```json
{
  "query": "Explain how async/await works in JavaScript",
  "model": "gemini-1.5-flash"
}
```

Interactive mode:
```json
{
  "query": "Let's discuss design patterns",
  "interactive": true
}
```

List extensions:
```json
{
  "query": "",
  "extensions": "list"
}
```

Get extension info:
```json
{
  "query": "",
  "extensions": "info:extension-name"
}
```

## Development

```bash
# Install dependencies
npm install

# Run in development mode
npm run dev

# Build
npm run build

# Watch mode
npm run watch

# Lint
npm run lint

# Lint and fix
npm run lint:fix
```

## License

MIT

TDQS

A3.6/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no risk of confusing it with another. The tool's purpose is clearly stated, so an agent can unambiguously select it.

Naming Consistency5/5

The single tool name 'gemini' is simple, matches the server name, and follows a consistent pattern. With only one name, there are no inconsistencies to penalize.

Tool Count2/5

Exposing only one tool is too few for the apparent scope, as it tries to cover queries, interactive mode, and extension management all in one. This forces the agent to rely on a single catch-all, which is impractical and not a well-structured tool set.

Completeness2/5

The single tool is a thin wrapper around the entire CLI, providing no first-class operations for distinct tasks. Agents must manually construct CLI commands, which is error-prone and represents a shallow API surface compared to a more complete, structured set.

Maintenance

ActivityInactive
ResponsivenessNo issues