gemini
A Model Context Protocol (MCP) server that enables Claude Desktop to interact with Google's Gemini AI - featuring 7 tools with Smart Tool Intelligence that learns from your usage patterns
claude mcp add --transport stdio garblesnarff-gemini-mcp-server node /path/to/gemini-mcp-server/gemini-server.js \ --env OUTPUT_DIR="/path/to/your/output/directory" \ --env GEMINI_API_KEY="your_api_key_here"
How to use
Gemini MCP Server is the first MCP server to include Smart Tool Intelligence, providing seven AI-powered tools that can generate images, edit images, chat with context-aware responses, transcribe audio, execute Python code in a sandbox, analyze videos, and analyze images. The server automatically learns from successful interactions, detects contexts like coding or debugging, enhances prompts, and stores preferences to improve performance over time. To begin, configure your Gemini API key and run the server. Once running, you can invoke the available tools via defined endpoints or integrate with Claude Desktop using the provided configuration example. Each tool is designed to be used with a simple parameter object (for example, generate_image with a prompt and optional context) and will return structured results such as text and media data.
Key capabilities include:
- Image Generation: Create images from textual prompts using Gemini 2.0 Flash.
- Image Editing: Change an existing image based on natural language instructions.
- Chat: Engage in context-aware conversations that adapt to your preferences.
- Audio Transcription: Convert audio files to text with optional verbatim mode.
- Code Execution: Run Python code in a secure sandbox and receive results.
- Video Analysis: Produce summaries, transcripts, and insights from video files.
- Image Analysis: Extract objects, text, and descriptive details from images.
The Smart Tool Intelligence system enhances prompts, detects context (e.g., consciousness research, coding, debugging), learns from successful interactions, and stores preferences for future sessions. To leverage these capabilities, supply the appropriate parameters per tool (e.g., prompt/context for generate_image, file_path for transcribe-audio) and optionally configure context hints to guide the AI enhancements.
How to install
Prerequisites:
- Node.js (LTS) and npm installed on your system
- Git to clone the repository
Install steps:
- Clone the repository git clone https://github.com/Garblesnarff/gemini-mcp-server.git
- Navigate to the project folder cd gemini-mcp-server
- Install dependencies npm install
- Create and configure environment variables
- Copy the example env file if provided, or create a new .env file
- Set GEMINI_API_KEY to your Gemini API key from Google AI Studio
- Optionally set OUTPUT_DIR to the directory where outputs will be saved
- Start the server npm start
Development / debugging:
- Run in dev mode with verbose logs (as per package.json scripts): npm run dev
- Ensure your environment variables are loaded in your runtime environment (e.g., using a .env loader or your system environment).
Testing:
- Verify tool endpoints by calling the CLI or your integration layer with test payloads for each tool (generate_image, gemini-edit-image, gemini-chat, gemini-transcribe-audio, gemini-code-execute, gemini-analyze-video, gemini-analyze-image).
Additional notes
Tips and common considerations:
- Always provide GEMINI_API_KEY in the environment configuration. The server relies on this key to access Gemini services.
- If you use OUTPUT_DIR, ensure the path exists and is writable by the running process.
- For Claude Desktop integration, use the example config structure shown in the README, replacing /path/to/gemini-mcp-server/gemini-server.js with the actual path to your server file.
- When enabling verbose or debug logging, be mindful of sensitive data in prompts and responses.
- The Smart Tool Intelligence system stores preferences at ./data/tool-preferences.json and automatically migrates from external storage if configured.
- If you add or customize tools, ensure the parameter names align with the documented tool interfaces (e.g., prompt, context, file_path, etc.).
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.