A powerful Model Context Protocol (MCP) server that provides comprehensive access to Google's Gemini 2.5 Pro Preview AI capabilities, including text generation, image analysis, code generation, chat conversations, and more. Powered by the most advanced Gemini 2.5 Pro model with thinking capabilities and 1M token context window (2M coming soon).
- Full MCP protocol support with stdio transport for Claude Desktop
- WebSocket support for custom integrations
- Real-time response streaming
- Secure API key handling
- TypeScript implementation with ES modules
- generate_text - Generate text with customizable temperature and token limits
- analyze_image - Analyze images and answer questions about them
- extract_text_from_image - Extract text (OCR) from images
- compare_images - Compare multiple images and describe differences/similarities
- generate_code - Generate code in specific programming languages with framework support
- explain_code - Analyze and explain code with detailed breakdowns
- refactor_code - Suggest improvements and refactor code based on goals
- convert_code - Convert code between programming languages
- chat - Have conversations with context memory and session management
- clear_chat_history - Clear conversation history for a session
- summarize_conversation - Get a summary of the conversation
- translate_text - Translate text between languages
- summarize_text - Create summaries in various styles (brief, detailed, bullet-points, executive)
- rewrite_text - Rewrite text in different styles or for different audiences
- generate_structured_data - Generate structured data (JSON, YAML, CSV, XML, TOML)
- check_content_safety - Analyze content for safety issues across multiple categories
- moderate_text - Filter and clean inappropriate content with different moderation levels
-
Clone the repository
git clone https://github.com/ivangrynenko/mcp-server-gemini.git cd mcp-server-gemini
-
Install dependencies
npm install
-
Build the project
npm run build
-
Get Gemini API Key
- Visit Google AI Studio
- Create a new API key
-
Configure Claude Desktop
- Locate your config file:
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json
- Add Gemini configuration:
{ "mcpServers": { "gemini": { "command": "node", "args": ["/path/to/mcp-server-gemini/dist/stdio.js"], "env": { "GEMINI_API_KEY": "your_api_key_here" } } } }
- Locate your config file:
-
Restart Claude Desktop
Once configured, you can use these tools in Claude Desktop:
Use the generate_text tool to write a creative story about space exploration
Use the analyze_image tool to describe what's in /path/to/image.jpg
Use the generate_code tool to create a Python REST API with FastAPI
Use the chat tool with sessionId "project-discussion" to start a conversation about machine learning
Use the translate_text tool to translate "Hello, world!" to Spanish
- Claude Desktop Setup Guide - Detailed setup instructions
- Examples and Usage - Usage examples and advanced configuration
- Implementation Notes - Technical implementation details
- Development Guide - Guide for developers
- Troubleshooting Guide - Common issues and solutions
# Clone repository
git clone https://github.com/aliargun/mcp-server-gemini.git
cd mcp-server-gemini
# Install dependencies
npm install
# Start development server
npm run dev
Contributions are welcome! Please see our Contributing Guide.
-
Connection Issues
- Check if port 3005 is available
- Verify internet connection
- See Troubleshooting Guide
-
API Key Problems
- Verify API key is correct
- Check permissions
- See Setup Guide
- API keys are handled via environment variables only
- No sensitive data is logged or stored
- Regular security updates
MIT