Gemini MCP Server logo

Gemini MCP Server

Community
LKbaba

MCP server implementation for Google's Gemini API

PublisherLKbaba
RepositoryGemini-mcp
LanguageTypeScript
Forks
7
Stars
142
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Gemini MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    142 stars and 7 forks from the linked repository.

Gemini MCP Server

Give Claude Code the power of Gemini 3.1

An MCP server that connects Claude Code to Google's Gemini 3.1, unlocking capabilities that complement Claude's strengths.

Why Gemini + Claude?

Gemini's StrengthsUse Case
1M Token ContextAnalyze entire codebases in one shot
Google Search GroundingGet real-time documentation & latest info
Multimodal VisionUnderstand screenshots, diagrams, designs

Philosophy: Claude is the commander, Gemini is the specialist.

Quick Start

Add to your MCP config file:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Then restart Claude Code.

Authentication

Two authentication modes are supported. The server auto-detects which mode to use based on environment variables.

Option 1: AI Studio API Key (Simplest)

Best for personal development and quick trials.

  1. Visit Google AI Studio and create an API key
  2. Add to your MCP config:
json
{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@lkbaba/mcp-server-gemini"],
      "env": {
        "GEMINI_API_KEY": "your-api-key"
      }
    }
  }
}

Option 2: Vertex AI (Recommended for Production)

More secure, uses Google Cloud IAM authentication.

Prerequisites:

  1. A Google Cloud project with Vertex AI API enabled
  2. A service account with Vertex AI User role (create one here)

Setup (2 minutes):

  1. Create a service account in GCP Console → download JSON key file
  2. Open the JSON key file, copy all key-value pairs
  3. Paste them into the env section of your MCP config:
json
{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@lkbaba/mcp-server-gemini"],
      "env": {
        "type": "service_account",
        "project_id": "your-project-id",
        "private_key_id": "key-id-here",
        "private_key": "<REDACTED>\n",
        "client_email": "your-sa@your-project.iam.gserviceaccount.com",
        "client_id": "123456789",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
        "token_uri": "https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
        "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/your-sa%40your-project.iam.gserviceaccount.com",
        "universe_domain": "googleapis.com"
      }
    }
  }
}

The server auto-detects service account credentials from env vars — no GOOGLE_GENAI_USE_VERTEXAI or GOOGLE_CLOUD_PROJECT needed. Just paste and go.

Tip: On Windows, the server automatically fixes slash corruption (/ → \) in PEM private keys that some MCP clients introduce.

Advanced options: You can also use GOOGLE_GENAI_USE_VERTEXAI=true + GOOGLE_CREDENTIALS_JSON, GOOGLE_APPLICATION_CREDENTIALS (file path), or gcloud auth application-default login. See the environment variables reference below.

Paste JSON approach (Option 2 above — simplest for Vertex AI):

Just paste the service account JSON fields directly into env. No extra variables needed — the server auto-detects type: "service_account".

Explicit Vertex AI mode (advanced):

VariableRequiredDescription
GOOGLE_GENAI_USE_VERTEXAIYesSet to "true" to enable
GOOGLE_CLOUD_PROJECTYesGCP project ID
GOOGLE_CLOUD_LOCATIONNoRegion (default: global)
GOOGLE_CREDENTIALS_JSONNo*Entire service account JSON as a single string
GOOGLE_APPLICATION_CREDENTIALSNo*File path to service account JSON key

* At least one credential source is needed: GOOGLE_CREDENTIALS_JSON, GOOGLE_APPLICATION_CREDENTIALS, or gcloud ADC.

AI Studio mode:

VariableRequiredDescription
GEMINI_API_KEYYesAPI key from Google AI Studio

If both modes are configured, Vertex AI takes priority.

Migration Notice

v2.0.0 (2026-04): The protocol layer has been rewritten on top of the official @modelcontextprotocol/sdk. This fixes a JSON-RPC notifications/initialized spec violation inherited from the upstream fork, which caused strict MCP clients (recent Claude CLI, some VS Code extensions) to drop the connection with MCP error -32000: Connection closed or to silently omit the Gemini tools from the tool list. No user-facing API changes — upgrade is drop-in.

v1.3.0+:

  • The default model is now gemini-3.1-pro-preview
  • Old model names are automatically mapped (no config changes needed)
  • See CHANGELOG.md for details

Tools (5)

Research & Search

ToolDescription
gemini_searchWeb search with Google Search grounding. Get real-time info, latest docs, current events.

Analysis (1M Token Context)

ToolDescription
gemini_analyze_codebaseAnalyze entire projects with 1M token context. Supports directory path, file paths, or direct content.
gemini_analyze_contentAnalyze code, documents, or data. Supports file path or direct content input.

Multimodal

ToolDescription
gemini_multimodal_queryAnalyze images with natural language. Understand designs, diagrams, screenshots.

Creative

ToolDescription
gemini_brainstormGenerate creative ideas with project context. Supports reading README, PRD files.

Model Selection (v1.3.0)

All tools now support an optional model parameter:

ModelSpeedBest For
gemini-3.1-pro-previewStandardComplex analysis, deep reasoning, agentic workflows (default)
gemini-3-flash-previewFastSimple tasks, quick responses, search queries

Note: gemini-3-pro-preview is deprecated (retired 2026-03-09) and will be automatically mapped to gemini-3.1-pro-preview.

Example: Use the new default model

json
{
  "name": "gemini_analyze_content",
  "arguments": {
    "filePath": "./src/index.ts",
    "task": "review",
    "model": "gemini-3.1-pro-preview"
  }
}

Usage Examples

Analyze a Large Codebase

"Use Gemini to analyze the ./src directory for architectural patterns and potential issues"

Search for Latest Documentation

"Search for the latest Next.js 15 App Router documentation"

Analyze an Image

"Analyze this architecture diagram and explain the data flow" (attach image)

Brainstorm with Context

"Brainstorm feature ideas based on this project's README.md"

Proxy Configuration

Add proxy environment variable to your config:

json
{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@lkbaba/mcp-server-gemini"],
      "env": {
        "GEMINI_API_KEY": "your_api_key_here",
        "HTTPS_PROXY": "http://127.0.0.1:7897"
      }
    }
  }
}

Local Development

bash
git clone https://github.com/LKbaba/Gemini-mcp.git
cd Gemini-mcp
npm install
npm run build
export GEMINI_API_KEY="your_api_key_here"
npm start

Project Structure

src/
├── config/
│   ├── models.ts           # Model configurations
│   └── constants.ts        # Global constants
├── tools/
│   ├── definitions.ts      # MCP tool definitions
│   ├── multimodal-query.ts # Multimodal queries
│   ├── analyze-content.ts  # Content analysis
│   ├── analyze-codebase.ts # Codebase analysis
│   ├── brainstorm.ts       # Brainstorming
│   └── search.ts           # Web search
├── utils/
│   ├── gemini-factory.ts   # Dual-mode auth factory (API Key + Vertex AI)
│   ├── gemini-client.ts    # Gemini API client
│   ├── file-reader.ts      # File system access
│   ├── security.ts         # Path validation
│   ├── validators.ts       # Parameter validation
│   └── error-handler.ts    # Error handling
├── types.ts                # Type definitions
└── server.ts               # Main server

Credits

Based on aliargun/mcp-server-gemini

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "lkbaba-gemini-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "github:LKbaba/Gemini-mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "<GEMINI_API_KEY>"
      }
    }
  }
}

Use Gemini MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Gemini MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Gemini MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Gemini MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "lkbaba-gemini-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-gemini"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Gemini MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Gemini MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Gemini MCP Server to help me with this task?
Gemini MCP Server
Sure. I read it.
Here is what I found using Gemini MCP Server.

Frequently asked questions

What is the Gemini MCP Server MCP server used for?

Gemini MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Gemini MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Gemini MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Gemini MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Gemini MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Gemini MCP Server MCP to TypingMind?

Gemini MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Gemini MCP Server MCP provide in TypingMind?

Gemini MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Gemini MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Gemini MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇