Gemini MCP Server
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
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
Maintainer
Works with
Installation
Manual Installation
npx mcp-gemini-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 installBuild the project
Compile the TypeScript source to JavaScript. The compiled entry point will be at dist/server.js.
npm run buildGenerate 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'))"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"
}
}
}
}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.
Gemini MCP Server Alternatives — Similar APIs Servers
Looking for alternatives to Gemini MCP Server? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
★ 43.4k🦍 The API and AI Gateway
API Mega List
★ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHub—period. 💪
Fetch
★ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
★ 2.1kSelf-Hosted API Management for Builders
Korean Law
★ 1.8k국가법령정보MCP v4.0 | 법제처 41개 API → 17개 MCP 도구. 법령·판례·조례 검색 + LLM 환각 방지 인용검증 + 조문 영향 그래프(impact_map) + 시점 비교 자동 diff(time_travel) + 시민 5단계 실행 가이드(action_plan) | 41 Korean legal APIs → 17 MCP tools
RuleGo
★ 1.5k⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
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.
Set Up Gemini MCP Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.