Skip to content
Back to search

mcp-server-gemini

MCP server implementation for Google's Gemini API

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/aliargun--mcp-server-gemini/badge.svg)](/listings/aliargun--mcp-server-gemini)

HTML

<a href="/listings/aliargun--mcp-server-gemini"><img src="/api/listings/aliargun--mcp-server-gemini/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. **Get Gemini API Key** - Visit [Google AI Studio](https://makersuite.google.com/app/apikey) - Create a new API key - **IMPORTANT**: Keep your API key secure and never commit it to version control

2. **Configure Your MCP Client**

<details> <summary><b>Claude Desktop</b></summary>

Config location: - Mac: `~/Library/Application Support/Claude/claude_desktop_config.json` - Windows: `%APPDATA%\Claude\claude_desktop_config.json` - Linux: `~/.config/Claude/claude_desktop_config.json`

   {
     "mcpServers": {
       "gemini": {
         "type": "stdio",
         "command": "npx",
         "args": ["-y", "github:aliargun/mcp-server-gemini"],
         "env": {
           "GEMINI_API_KEY": "your_api_key_here"
         }
       }
     }
   }

</details>

<details> <summary><b>Cursor</b></summary>

Add to Cursor's MCP settings:

   {
     "gemini": {
       "type": "stdio",
       "command": "npx",
       "args": ["-y", "github:aliargun/mcp-server-gemini"],
       "env": {
         "GEMINI_API_KEY": "your_api_key_here"
       }
     }
   }

</details>

<details> <summary><b>Windsurf</b></summary>

Configure in Windsurf's MCP settings following their documentation. </details>

<details> <summary><b>Other MCP Clients</b></summary>

Use the standard MCP stdio configuration:

   {
     "type": "stdio",
     "command": "npx",
     "args": ["-y", "github:aliargun/mcp-server-gemini"],
     "env": {
       "GEMINI_API_KEY": "your_api_key_here"
     }
   }

</details>

3. **Restart Your MCP Client**

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 197 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Gemini MCP Server
  2. [![smithery badge](https://smithery.ai/badge/mcp-server-gemini)](https://smithery.ai/server/mcp-server-gemini)
  3. [![npm version](https://img.shields.io/npm/v/mcp-server-gemini)](https://www.npmjs.com/package/mcp-server-gemini)
  4. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  5. [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue)](https://www.typescriptlang.org/)
  6. [![MCP Version](https://img.shields.io/badge/MCP-2024--11--05-green)](https://modelcontextprotocol.io/)
  7. A powerful MCP (Model Context Protocol) server that brings Google's latest Gemini AI models to your favorite development environment. Access Gemini 2.5's thinking capabilities, vision analysis, embeddings, and more through a seamless integration.
  8. 🚀 **Works with**: Claude Desktop, Cursor, Windsurf, and any MCP-compatible client
  9. 🎯 **Why use this**: Get Gemini's cutting-edge AI features directly in your IDE with full parameter control
  10. 📚 **Self-documenting**: Built-in help system means you never need to leave your editor
  11. ## Features
  12. - **6 Powerful Tools**: Text generation, image analysis, token counting, model listing, embeddings, and self-documenting help
  13. - **Latest Gemini Models**: Support for Gemini 2.5 series with thinking capabilities
  14. - **Advanced Features**: JSON mode, Google Search grounding, system instructions, conversation memory
  15. - **Full MCP Protocol**: Standard stdio communication for seamless integration with any MCP client
  16. - **Self-Documenting**: Built-in help system - no external docs needed
  17. - **TypeScript & ESM**: Modern, type-safe implementation
  18. ### Supported Models
  19. | Model | Context | Features | Best For |
  20. |-------|---------|----------|----------|
  21. | gemini-2.5-pro | 2M tokens | Thinking, JSON, Grounding | Complex reasoning |
  22. | gemini-2.5-flash ⭐ | 1M tokens | Thinking, JSON, Grounding | General use |
  23. | gemini-2.5-flash-lite | 1M tokens | Thinking, JSON | Fast responses |
  24. | gemini-2.0-flash | 1M tokens | JSON, Grounding | Standard tasks |
  25. | gemini-1.5-pro | 2M tokens | JSON | Legacy support |
  26. ## Quick Start
  27. 1. **Get Gemini API Key**
  28. - Visit [Google AI Studio](https://makersuite.google.com/app/apikey)
  29. - Create a new API key
  30. - **IMPORTANT**: Keep your API key secure and never commit it to version control
  31. 2. **Configure Your MCP Client**
  32. <details>
  33. <summary><b>Claude Desktop</b></summary>
  34. Config location:
  35. - Mac: `~/Library/Application Support/Claude/claude_desktop_config.json`
  36. - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
  37. - Linux: `~/.config/Claude/claude_desktop_config.json`
  38. ```json
  39. {
  40. "mcpServers": {
  41. "gemini": {
  42. "type": "stdio",
  43. "command": "npx",
  44. "args": ["-y", "github:aliargun/mcp-server-gemini"],
  45. "env": {
  46. "GEMINI_API_KEY": "your_api_key_here"
  47. }
  48. }
  49. }
  50. }
  51. ```
  52. </details>
  53. <details>
  54. <summary><b>Cursor</b></summary>
  55. Add to Cursor's MCP settings:
  56. ```json
  57. {
  58. "gemini": {
  59. "type": "stdio",
  60. "command": "npx",
  61. "args": ["-y", "github:aliargun/mcp-server-gemini"],
  62. "env": {
  63. "GEMINI_API_KEY": "your_api_key_here"
  64. }
  65. }
  66. }
  67. ```
  68. </details>
  69. <details>
  70. <summary><b>Windsurf</b></summary>
  71. Configure in Windsurf's MCP settings following their documentation.
  72. </details>
  73. <details>
  74. <summary><b>Other MCP Clients</b></summary>
  75. Use the standard MCP stdio configuration:
  76. ```json
  77. {
  78. "type": "stdio",
  79. "command": "npx",
  80. "args": ["-y", "github:aliargun/mcp-server-gemini"],
  81. "env": {
  82. "GEMINI_API_KEY": "your_api_key_here"
  83. }
  84. }
  85. ```
  86. </details>
  87. 3. **Restart Your MCP Client**
  88. ## How to Use
  89. Once configured, you can use natural language in your MCP client to access Gemini's capabilities:
  90. ### Basic Commands
  91. ```
  92. "Use Gemini to explain quantum computing"
  93. "Analyze this image with Gemini"
  94. "List all Gemini models"
  95. "Get help on using Gemini"
  96. ```
  97. ### Advanced Examples
  98. ```
  99. "Use Gemini 2.5 Pro with temperature 0.3 to review this code"
  100. "Use Gemini in JSON mode to extract key points with schema {title, summary, tags}"
  101. "Use Gemini with grounding to research the latest in quantum computing"
  102. ```
  103. 📖 **[See the complete Usage Guide](USAGE_GUIDE.md)** for detailed examples and advanced features.
  104. ## Why Gemini MCP Server?
  105. - **Access Latest Models**: Use Gemini 2.5 with thinking capabilities - Google's most advanced models
  106. - **Full Feature Set**: All Gemini API features including JSON mode, grounding, and system instructions
  107. - **Easy Setup**: One-line npx installation, no complex configuration needed
  108. - **Production Ready**: Comprehensive error handling, TypeScript types, and extensive documentation
  109. - **Active Development**: Regular updates with new Gemini features as they're released
  110. ## Documentation
  111. - **[Usage Guide](USAGE_GUIDE.md)** - Complete guide on using all tools and features
  112. - **[Parameters Reference](PARAMETERS_REFERENCE.md)** - Detailed documentation of all parameters
  113. - **[Quick Reference](QUICK_REFERENCE.md)** - Quick commands cheat sheet
  114. - **[Enhanced Features](ENHANCED_FEATURES.md)** - Detailed list of v4.0.0 capabilities
  115. - [Claude Desktop Setup Guide](docs/claude-desktop-setup.md) - Detailed setup instructions
  116. - [Examples and Usage](docs/examples.md) - Usage examples and advanced configuration
  117. - [Implementation Notes](docs/implementation-notes.md) - Technical implementation details
  118. - [Development Guide](docs/development-guide.md) - Guide for developers
  119. - [Troubleshooting Guide](docs/troubleshooting.md) - Common issues and solutions
  120. ## Local Development
  121. ```bash
  122. # Clone repository
  123. git clone https://github.com/aliargun/mcp-server-gemini.git
  124. cd mcp-server-gemini
  125. # Install dependencies
  126. npm install
  127. # Set up environment variables
  128. cp .env.example .env
  129. # Edit .env and add your GEMINI_API_KEY
  130. # Start development server
  131. npm run dev
  132. ```
  133. ## Contributing
  134. Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md).
  135. ## Common Issues
  136. 1. **Connection Issues**
  137. - Ensure your MCP client is properly restarted
  138. - Check the client's logs (e.g., `~/Library/Logs/Claude/mcp-server-gemini.log` for Claude Desktop on Mac)
  139. - Verify internet connection
  140. - See [Troubleshooting Guide](docs/troubleshooting.md)
  141. 2. **API Key Problems**
  142. - Verify API key is correct
  143. - Check API key has proper permissions
  144. - Ensure the key is set in the environment variable
  145. - See [Setup Guide](docs/claude-desktop-setup.md)
  146. ## Security
  147. - API keys are handled via environment variables only
  148. - Never commit API keys to version control
  149. - The `.claude/` directory is excluded from git
  150. - No sensitive data is logged or stored
  151. - Regular security updates
  152. - If your API key is exposed, regenerate it immediately in Google Cloud Console
  153. ## License
  154. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.