Gemini MCP Server

Gemini MCP Server

Integrates Google Gemini AI into Warp terminal workflows through three focused tools: single-turn chat for quick questions, multi-turn conversations with context preservation, and AI-powered code analysis with bug detection and optimization suggestions.

Category
访问服务器

README

<div align="center">

<!-- Premium Warp Terminal Hero Banner --> <a href="https://app.warp.dev/referral/4YXPLX" target="_blank" rel="noopener noreferrer"> <img src="./assets/warp-banner.png" alt="Gemini MCP Server for Warp Terminal" width="100%" style="max-width: 1000px; border-radius: 12px;" /> </a>

<br/><br/>

🤖 Gemini MCP Server

Customized for Warp Terminal

Model Context Protocol Server for Google Gemini API

Optimized for Modern Terminal Workflows

<br/>

<!-- Premium Download CTA --> <a href="https://app.warp.dev/referral/4YXPLX" target="_blank" rel="noopener noreferrer"> <img alt="Download Warp Terminal" src="https://img.shields.io/badge/%E2%9A%A1_Download_Warp_Terminal-00E5FF?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTMgMkg0QzIuOSAyIDIgMi45IDIgNFYyMEMyIDIxLjEgMi45IDIyIDQgMjJIMjBDMjEuMSAyMiAyMiAyMS4xIDIyIDIwVjExSDE1VjE4SDE4VjIwSDZWNEgxM1YyWiIgZmlsbD0id2hpdGUiLz48L3N2Zz4=&logoColor=white" height="36" /> </a>

<p style="margin-top: 10px; font-size: 14px; color: #888;"> <strong>Get Warp Terminal at:</strong> <a href="https://app.warp.dev/referral/4YXPLX" target="_blank" rel="noopener noreferrer" style="color: #00E5FF; text-decoration: none; font-weight: bold;">warp.dev</a> ✨ </p>

<br/>

License: MIT Node.js MCP Gemini

Seamlessly integrate Google Gemini AI into your Warp terminal workflow

FeaturesInstallationConfigurationUsageAPI ReferenceContributing

</div>


📋 Overview

Gemini MCP Server is a Model Context Protocol implementation that brings Google Gemini's powerful AI capabilities directly into your Warp terminal. Built with enterprise-grade standards, this server enables conversational AI, multi-turn dialogues, and intelligent code analysis through simple, well-defined tools.

Why Use This?

Zero Configuration - Works out of the box with Warp terminal
🔒 Secure by Default - API keys stored in environment variables
High Performance - Optimized for rapid response times
🎯 Purpose-Built Tools - Three focused tools for maximum utility
🌐 Open Source - MIT licensed, community-driven development


✨ Features

<table> <tr> <td width="33%">

💬 Single-Turn Chat

gemini_chat

Quick, stateless conversations with Gemini. Perfect for one-off questions, code generation, or content creation.

</td> <td width="33%">

🔄 Multi-Turn Conversations

gemini_chat_with_history

Maintain context across multiple exchanges. Build complex dialogues and iterative problem-solving sessions.

</td> <td width="33%">

🔍 Code Analysis

gemini_analyze_code

Deep code review, bug detection, optimization suggestions, and explanations. Supports multiple programming languages.

</td> </tr> </table>


🚀 Installation

Prerequisites

  • Node.js ≥ 18.0.0
  • npm ≥ 9.0.0
  • Warp Terminal (latest version)
  • Google Gemini API Key (Get one here)

Quick Start

# Clone or download the repository
git clone https://github.com/bobvasic/gemini-mcp-server.git
cd gemini-mcp-server

# Install dependencies
npm install

# Run automated setup (recommended)
./setup.sh YOUR_GEMINI_API_KEY

Manual Installation

# Install dependencies
npm install

# Make scripts executable
chmod +x index.js setup.sh

⚙️ Configuration

Method 1: Automated Setup (Recommended)

./setup.sh YOUR_GEMINI_API_KEY

This script automatically:

  • Creates Warp MCP configuration
  • Sets up your API key securely
  • Validates the installation

Method 2: Manual Configuration

Step 1: Get Your API Key

  1. Visit Google AI Studio
  2. Sign in with your Google account
  3. Generate a new API key
  4. Copy the key (keep it secure!)

Step 2: Configure Warp

Create or edit ~/.config/warp/mcp.json:

{
  "mcpServers": {
    "gemini": {
      "command": "node",
      "args": ["${HOME}/gemini-mcp-server/index.js"],
      "env": {
        "GEMINI_API_KEY": "your-actual-api-key-here"
      }
    }
  }
}

⚠️ Security Best Practice: Never commit your API key to version control. Use environment variables for production deployments.

Step 3: Restart Warp

Completely quit and restart Warp terminal for changes to take effect.


💡 Usage

Testing the Server

Verify your installation works:

export GEMINI_API_KEY="your-api-key"
cd gemini-mcp-server
npm start

You should see: Gemini MCP Server running on stdio

Tool Examples

1. Basic Conversation

{
  "tool": "gemini_chat",
  "arguments": {
    "message": "Explain the difference between async/await and Promises in JavaScript",
    "temperature": 0.7,
    "max_tokens": 2048
  }
}

Use Cases:

  • Quick questions and answers
  • Code generation
  • Content writing
  • Brainstorming ideas

2. Contextual Dialogue

{
  "tool": "gemini_chat_with_history",
  "arguments": {
    "messages": [
      {
        "role": "user",
        "parts": [{"text": "What is dependency injection?"}]
      },
      {
        "role": "model",
        "parts": [{"text": "Dependency injection is a design pattern..."}]
      },
      {
        "role": "user",
        "parts": [{"text": "Show me an example in TypeScript"}]
      }
    ],
    "temperature": 0.8
  }
}

Use Cases:

  • Technical tutorials
  • Iterative problem-solving
  • Learning sessions
  • Complex debugging

3. Code Analysis

{
  "tool": "gemini_analyze_code",
  "arguments": {
    "code": "function processUser(data) {\n  return data.name.toUpperCase();\n}",
    "language": "javascript",
    "analysis_type": "bugs"
  }
}

Analysis Types:

  • bugs - Find errors and potential issues
  • optimize - Performance and best practices
  • explain - Detailed code explanation
  • review - Comprehensive assessment

📚 API Reference

Tool: gemini_chat

Description: Single-turn conversation with Gemini

Parameters:

Parameter Type Required Default Description
message string Yes - Your prompt or question
temperature number No 1.0 Creativity (0.0-2.0)
max_tokens number No 8192 Maximum response length

Example Response:

{
  "content": [
    {
      "type": "text",
      "text": "Here's a detailed explanation..."
    }
  ]
}

Tool: gemini_chat_with_history

Description: Multi-turn conversation with context preservation

Parameters:

Parameter Type Required Default Description
messages array Yes - Conversation history
temperature number No 1.0 Creativity (0.0-2.0)

Message Format:

{
  role: "user" | "model",
  parts: [{ text: string }]
}

Tool: gemini_analyze_code

Description: AI-powered code analysis and review

Parameters:

Parameter Type Required Default Description
code string Yes - Code to analyze
language string No - Programming language
analysis_type enum No review bugs, optimize, explain, review

Supported Languages: JavaScript, TypeScript, Python, Go, Rust, Java, C++, Ruby, PHP, Swift, Kotlin, and more


🔧 Advanced Configuration

Environment Variables

# Required
export GEMINI_API_KEY="your-api-key"

# Optional (for custom deployments)
export MCP_SERVER_PORT="3000"  # If running as HTTP server
export LOG_LEVEL="info"         # debug, info, warn, error

Model Selection

To use different Gemini models, edit index.js:

const model = genAI.getGenerativeModel({ 
  model: "gemini-2.5-pro",  // or "gemini-2.0-flash-exp"
  generationConfig: {
    temperature: 1.0,
    maxOutputTokens: 8192,
  },
});

Available Models:

  • gemini-2.0-flash-exp - Fast, efficient (default)
  • gemini-2.5-pro - Most capable (when available)
  • gemini-pro - Balanced performance

🐛 Troubleshooting

Common Issues

<details> <summary><b>Error: "GEMINI_API_KEY environment variable is required"</b></summary>

Solution:

export GEMINI_API_KEY="your-key"
# Or add to ~/.bashrc or ~/.zshrc for persistence
echo 'export GEMINI_API_KEY="your-key"' >> ~/.bashrc

</details>

<details> <summary><b>Warp doesn't recognize the MCP server</b></summary>

Checklist:

  1. Verify ~/.config/warp/mcp.json exists and is valid JSON
  2. Ensure paths in config use absolute paths or ${HOME}
  3. Completely quit and restart Warp (not just close window)
  4. Check Warp logs: Settings → Advanced → View Logs </details>

<details> <summary><b>API calls fail with 403 or 401 errors</b></summary>

Possible causes:

  • Invalid API key
  • API key not activated
  • Billing not enabled on Google Cloud
  • Rate limits exceeded

Solution: Verify your API key at Google AI Studio </details>

<details> <summary><b>Server starts but responses are empty</b></summary>

Debug steps:

export GEMINI_API_KEY="your-key"
node index.js 2>&1 | tee debug.log
# Then check debug.log for errors

</details>


🔒 Security

Best Practices

  1. Never commit API keys - Use environment variables
  2. Rotate keys regularly - Generate new keys every 90 days
  3. Use key restrictions - Limit keys to specific APIs in Google Cloud Console
  4. Monitor usage - Check Google Cloud Console for unexpected activity
  5. Audit logs - Review MCP server logs periodically

Reporting Security Issues

Please report security vulnerabilities to info@cyberlinksec.com. Do not create public issues for security concerns.

See SECURITY.md for our full security policy.


🤝 Contributing

We welcome contributions! Here's how you can help:

Development Setup

# Clone the repo
git clone https://github.com/bobvasic/gemini-mcp-server.git
cd gemini-mcp-server

# Install dependencies
npm install

# Run in development mode
export GEMINI_API_KEY="your-key"
npm start

Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Follow existing code style
  • Add tests for new features
  • Update documentation
  • Ensure no hardcoded credentials
  • Use meaningful commit messages

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License - Copyright (c) 2025 Gemini MCP Server Contributors

🙏 Acknowledgments


📊 Stats & Metrics

  • Response Time: < 2s average
  • Uptime: 99.9% (dependent on Google API)
  • Models Supported: 3+ Gemini variants
  • Languages: JavaScript/TypeScript
  • MCP Version: 1.0.4

🗺️ Roadmap

  • [ ] Add streaming response support
  • [ ] Implement token usage tracking
  • [ ] Add conversation history persistence
  • [ ] Support for image inputs
  • [ ] Multi-language documentation
  • [ ] Docker container support
  • [ ] Health check endpoints
  • [ ] Prometheus metrics export

<div align="center">

Built with ❤️ for the developer community

If this project helped you, please ⭐ star the repository!

DocumentationIssuesDiscussions

</div>

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选