Gemini MCP Server

Gemini MCP Server

A Model Context Protocol server that gives Claude access to Google's Gemini 2.5 Pro for extended thinking, code analysis, and problem-solving with a massive context window.

Category
访问服务器

README

Gemini MCP Server

The ultimate development partner for Claude - a Model Context Protocol server that gives Claude access to Google's Gemini 2.5 Pro for extended thinking, code analysis, and problem-solving.

Why This Server?

Claude is brilliant, but sometimes you need:

  • A second opinion on complex architectural decisions - augment Claude's extended thinking with Gemini's perspective
  • Massive context window (1M tokens) - Gemini 2.5 Pro can analyze entire codebases, read hundreds of files at once, and provide comprehensive insights
  • Deep code analysis across massive codebases that exceed Claude's context limits
  • Expert debugging for tricky issues with full system context
  • Professional code reviews with actionable feedback across entire repositories
  • A senior developer partner to validate and extend ideas

This server makes Gemini your development sidekick, handling what Claude can't or extending what Claude starts.

Quickstart (5 minutes)

1. Get a Gemini API Key

Visit Google AI Studio and generate an API key. For best results with Gemini 2.5 Pro, use a paid API key as the free tier has limited access to the latest models.

2. Install via Claude Desktop Config

Add to your claude_desktop_config.json:

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

{
  "mcpServers": {
    "gemini": {
      "command": "/absolute/path/to/gemini-mcp-server/run_gemini.sh",
      "env": {
        "GEMINI_API_KEY": "your-gemini-api-key-here"
      }
    }
  }
}

Windows users: Use run_gemini.bat instead of run_gemini.sh

3. Restart Claude Desktop

4. Connect to Claude Code

To use the server in Claude Code, run:

claude mcp add-from-claude-desktop -s user

5. Start Using It!

Just ask Claude naturally:

  • "Use gemini to think deeper about this architecture design"
  • "Get gemini to review this code for security issues"
  • "Get gemini to debug why this test is failing"
  • "Use gemini to analyze these files to understand the data flow"

Available Tools

Quick Tool Selection Guide:

  • Need deeper thinking?think_deeper (extends Claude's analysis, finds edge cases)
  • Code needs review?review_code (bugs, security, performance issues)
  • Something's broken?debug_issue (root cause analysis, error tracing)
  • Want to understand code?analyze (architecture, patterns, dependencies)
  • General questions?chat (explanations, comparisons, advice)
  • Check models?list_models (see available Gemini models)
  • Server info?get_version (version and configuration details)

Tools Overview:

  1. think_deeper - Extended reasoning and problem-solving
  2. review_code - Professional code review with severity levels
  3. debug_issue - Root cause analysis and debugging
  4. analyze - General-purpose file and code analysis
  5. chat - General development conversations
  6. list_models - List available Gemini models
  7. get_version - Get server version and configuration

1. think_deeper - Extended Reasoning Partner

Get a second opinion to augment Claude's own extended thinking

Example Prompts:

Basic Usage:

"Use gemini to think deeper about my authentication design"
"Use gemini to extend my analysis of this distributed system architecture"

Collaborative Workflow:

"Design an authentication system for our SaaS platform. Then use gemini to review your design for security vulnerabilities. After getting gemini's feedback, incorporate the suggestions and show me the final improved design."

"Create an event-driven architecture for our order processing system. Use gemini to think deeper about event ordering and failure scenarios. Then integrate gemini's insights and present the enhanced architecture."

Key Features:

  • Provides a second opinion on Claude's analysis
  • Challenges assumptions and identifies edge cases Claude might miss
  • Offers alternative perspectives and approaches
  • Validates architectural decisions and design patterns
  • Can reference specific files for context: "Use gemini to think deeper about my API design with reference to api/routes.py"

Triggers: think deeper, ultrathink, extend my analysis, validate my approach

2. review_code - Professional Code Review

Comprehensive code analysis with prioritized feedback

Example Prompts:

Basic Usage:

"Use gemini to review auth.py for issues"
"Use gemini to do a security review of auth/ focusing on authentication"

Collaborative Workflow:

"Refactor the authentication module to use dependency injection. Then use gemini to review your refactoring for any security vulnerabilities. Based on gemini's feedback, make any necessary adjustments and show me the final secure implementation."

"Optimize the slow database queries in user_service.py. Get gemini to review your optimizations for potential regressions or edge cases. Incorporate gemini's suggestions and present the final optimized queries."

Key Features:

  • Issues prioritized by severity (🔴 CRITICAL → 🟢 LOW)
  • Supports specialized reviews: security, performance, quick
  • Can enforce coding standards: "Use gemini to review src/ against PEP8 standards"
  • Filters by severity: "Get gemini to review auth/ - only report critical vulnerabilities"

Triggers: review code, check for issues, find bugs, security check

3. debug_issue - Expert Debugging Assistant

Root cause analysis for complex problems

Example Prompts:

Basic Usage:

"Use gemini to debug this TypeError: 'NoneType' object has no attribute 'split'"
"Get gemini to debug why my API returns 500 errors with the full stack trace: [paste traceback]"

Collaborative Workflow:

"I'm getting 'ConnectionPool limit exceeded' errors under load. Debug the issue and use gemini to analyze it deeper with context from db/pool.py. Based on gemini's root cause analysis, implement a fix and get gemini to validate the solution will scale."

"Debug why tests fail randomly on CI. Once you identify potential causes, share with gemini along with test logs and CI configuration. Apply gemini's debugging strategy, then use gemini to suggest preventive measures."

Key Features:

  • Accepts error context, stack traces, and logs
  • Can reference relevant files for investigation
  • Supports runtime info and previous attempts
  • Provides root cause analysis and solutions

Triggers: debug, error, failing, root cause, trace, not working

4. analyze - Smart File Analysis

General-purpose code understanding and exploration

Example Prompts:

Basic Usage:

"Use gemini to analyze main.py to understand how it works"
"Get gemini to do an architecture analysis of the src/ directory"

Collaborative Workflow:

"Analyze our project structure in src/ and identify architectural improvements. Share your analysis with gemini for a deeper review of design patterns and anti-patterns. Based on both analyses, create a refactoring roadmap."

"Perform a security analysis of our authentication system. Use gemini to analyze auth/, middleware/, and api/ for vulnerabilities. Combine your findings with gemini's to create a comprehensive security report."

Key Features:

  • Analyzes single files or entire directories
  • Supports specialized analysis types: architecture, performance, security, quality
  • Uses file paths (not content) for clean terminal output
  • Can identify patterns, anti-patterns, and refactoring opportunities

Triggers: analyze, examine, look at, understand, inspect

5. chat - General Development Chat

For everything else - explanations, comparisons, brainstorming

Example Prompts:

Basic Usage:

"Use gemini to explain how async/await works in Python"
"Get gemini to compare Redis vs Memcached for session storage"

Collaborative Workflow:

"Research the best message queue for our use case (high throughput, exactly-once delivery). Use gemini to compare RabbitMQ, Kafka, and AWS SQS. Based on gemini's analysis and your research, recommend the best option with implementation plan."

"Design a caching strategy for our API. Get gemini's input on Redis vs Memcached vs in-memory caching. Combine both perspectives to create a comprehensive caching implementation guide."

Key Features:

  • General development questions and explanations
  • Technology comparisons and best practices
  • Architecture and design discussions
  • Can reference files for context: "Use gemini to explain this algorithm with context from algorithm.py"

Triggers: ask, explain, compare, suggest, what about

6. list_models - See Available Gemini Models

"Use gemini to list available models"
"Get gemini to show me what models I can use"

7. get_version - Server Information

"Use gemini for its version"
"Get gemini to show server configuration"

Collaborative Workflows

Design → Review → Implement

"Design a real-time collaborative editor. Use gemini to think deeper about edge cases and scalability. Implement an improved version incorporating gemini's suggestions."

Code → Review → Fix

"Implement JWT authentication. Get gemini to do a security review. Fix any issues gemini identifies and show me the secure implementation."

Debug → Analyze → Solution

"Debug why our API crashes under load. Use gemini to analyze deeper with context from api/handlers/. Implement a fix based on gemini's root cause analysis."

Pro Tips

Natural Language Triggers

The server recognizes natural phrases. Just talk normally:

  • ❌ "Use the think_deeper tool with current_analysis parameter..."
  • ✅ "Use gemini to think deeper about this approach"

Automatic Tool Selection

Claude will automatically pick the right tool based on your request:

  • "review" → review_code
  • "debug" → debug_issue
  • "analyze" → analyze
  • "think deeper" → think_deeper

Clean Terminal Output

All file operations use paths, not content, so your terminal stays readable even with large files.

Context Awareness

Tools can reference files for additional context:

"Use gemini to debug this error with context from app.py and config.py"
"Get gemini to think deeper about my design, reference the current architecture.md"

Installation

  1. Clone the repository:

    git clone https://github.com/BeehiveInnovations/gemini-mcp-server.git
    cd gemini-mcp-server
    
  2. Create virtual environment:

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Set your Gemini API key:

    export GEMINI_API_KEY="your-api-key-here"
    

Contributing

We welcome contributions! The modular architecture makes it easy to add new tools:

  1. Create a new tool in tools/
  2. Inherit from BaseTool
  3. Implement required methods
  4. Add to TOOLS in server.py

See existing tools for examples.

License

MIT License - see LICENSE file for details.

Acknowledgments

Built with MCP by Anthropic and powered by Google's Gemini API.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选