Gemini MCP Server

v1.0.0APIsstable

This project provides a dedicated MCP (Model Context Protocol) server that wraps the @google/genai SDK. It exposes Google's Gemini model capabilities as standard MCP tools, allowing other LLMs (like Cline) or MCP-compatible systems to leverage Gemini

aiclaudegeminigemini-apimcp
Share:
35
Stars
0
Downloads
0
Weekly
0/5

What is Gemini MCP Server?

Gemini MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this project provides a dedicated mcp (model context protocol) server that wraps the @google/genai sdk. it exposes google's gemini model capabilities as standard mcp tools, allowing other llms (like c...

This project provides a dedicated MCP (Model Context Protocol) server that wraps the @google/genai SDK. It exposes Google's Gemini model capabilities as standard MCP tools, allowing other LLMs (like Cline) or MCP-compatible systems to leverage Gemini

This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • This project provides a dedicated MCP (Model Context Protoco

Use Cases

Access Google Gemini models
Integrate with LLM-compatible systems
Leverage advanced AI capabilities
bsmi021

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedJan 25, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-gemini-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Gemini MCP Server

MCP Gemini Server wraps Google's Gemini models (including gemini-1.5-pro, gemini-1.5-flash, and gemini-2.5-pro) as standard MCP tools, letting any MCP-compatible AI client — such as Claude or Cline — delegate tasks to Gemini as a backend workhorse. It supports text generation, streaming, stateful multi-turn chat, function calling, URL-based image and YouTube video analysis, response caching, image generation via Imagen 3.1, and the ability to connect to and call other MCP servers. This is ideal when you want one AI to orchestrate another, or when you need Gemini's specific capabilities (like long-context video analysis) from within an MCP workflow.

Prerequisites

  • Node.js 18 or later
  • A Google AI Studio API key (https://aistudio.google.com/app/apikey) — Vertex AI credentials are not supported
  • The mcp-gemini-server repository cloned locally (no npm package; must build from source)
  • A secure connection token you generate yourself (32+ random characters)
  • An MCP-compatible client such as Claude Desktop or Cline
1

Clone the repository and install dependencies

Clone the project from GitHub and install all Node.js dependencies.

git clone https://github.com/bsmi021/mcp-gemini-server.git
cd mcp-gemini-server
npm install
2

Build the project

Compile the TypeScript source to JavaScript. The compiled entry point will be at dist/server.js.

npm run build
3

Generate a secure connection token

Create a strong random token to authenticate communication between your MCP client and the server. Save this token — you will use it in both the server env config and must keep it consistent.

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
4

Configure your MCP client

Add the server to your MCP client's configuration file. Replace the path, API key, and connection token with your actual values. The server requires GOOGLE_GEMINI_API_KEY, MCP_SERVER_HOST, MCP_SERVER_PORT, and MCP_CONNECTION_TOKEN.

{
  "mcpServers": {
    "gemini-server": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-gemini-server/dist/server.js"],
      "env": {
        "GOOGLE_GEMINI_API_KEY": "YOUR_GOOGLE_AI_STUDIO_KEY",
        "MCP_SERVER_HOST": "localhost",
        "MCP_SERVER_PORT": "8080",
        "MCP_CONNECTION_TOKEN": "YOUR_GENERATED_CONNECTION_TOKEN",
        "GOOGLE_GEMINI_MODEL": "gemini-1.5-flash"
      }
    }
  }
}
5

Restart your MCP client

Restart Claude Desktop or Cline to load the new configuration. Gemini tools will now appear as available MCP tools in your AI assistant.

Gemini MCP Server Examples

Client configuration (Claude Desktop / Cline)

Full MCP client config block for mcp-gemini-server. All five env vars shown are required for the server to operate correctly.

{
  "mcpServers": {
    "gemini-server": {
      "command": "node",
      "args": ["/Users/you/mcp-gemini-server/dist/server.js"],
      "env": {
        "GOOGLE_GEMINI_API_KEY": "AIza...",
        "MCP_SERVER_HOST": "localhost",
        "MCP_SERVER_PORT": "8080",
        "MCP_CONNECTION_TOKEN": "a1b2c3d4e5f6...",
        "GOOGLE_GEMINI_MODEL": "gemini-1.5-flash"
      }
    }
  }
}

Prompts to try

Example prompts to use with Claude or Cline once the Gemini MCP server is connected.

- "Use Gemini to summarize this YouTube video: https://www.youtube.com/watch?v=<id>"
- "Ask Gemini to analyze the image at this URL and describe what it shows: https://example.com/image.png"
- "Start a multi-turn chat session with Gemini and ask it to explain quantum entanglement step by step."
- "Use Gemini to generate an image of a futuristic cityscape at sunset."

Troubleshooting Gemini MCP Server

Server starts but Gemini API calls fail with authentication errors

Verify GOOGLE_GEMINI_API_KEY is set to a valid Google AI Studio key (not a Vertex AI credential). The Caching API and all features require a Google AI Studio key specifically. Regenerate your key at https://aistudio.google.com/app/apikey if needed.

MCP client shows 'server closed during initialize'

Ensure the absolute path in the args array points to `dist/server.js` and that you have run `npm run build` first. Also confirm that MCP_SERVER_HOST, MCP_SERVER_PORT, and MCP_CONNECTION_TOKEN are all set in the env block — these are required fields.

File upload or local image analysis fails

This server intentionally does not support direct file uploads or base64 image data. Host your files on a public URL (e.g., GitHub raw URLs, Imgur, or any public cloud storage) and pass the URL instead.

Frequently Asked Questions about Gemini MCP Server

What is Gemini MCP Server?

Gemini MCP Server is a Model Context Protocol (MCP) server that this project provides a dedicated mcp (model context protocol) server that wraps the @google/genai sdk. it exposes google's gemini model capabilities as standard mcp tools, allowing other llms (like cline) or mcp-compatible systems to leverage gemini It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Gemini MCP Server?

Follow the installation instructions on the Gemini MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Gemini MCP Server?

Gemini MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Gemini MCP Server free to use?

Yes, Gemini MCP Server is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-gemini-server": { "command": "npx", "args": ["-y", "mcp-gemini-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Gemini MCP Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides