Gemini MCP Server
Provides tools for interacting with Google's Gemini API, enabling chat, multimodal analysis, deep research, file management, and various generation tasks.
Allows analysis of public YouTube videos by URL, extracting content for processing via Gemini's multimodal capabilities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini MCP Server analyze this YouTube video: https://youtube.com/watch?v=dQw4w9WgXcQ"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gemini MCP Server
A Model Context Protocol (MCP) server providing 23 tools for Google's Gemini API -- chat, multimodal analysis, deep research, file management, YouTube analysis, and more.
Built with @google/genai SDK (v1.0.0+).
Features
Chat with Gemini models (single-turn, multi-turn, with tool modes)
Analyze images, audio, video, PDFs, YouTube videos, and URLs
Files API with auto-switching: inline for small files (<20MB), upload for large (up to 2GB)
Deep research agent with background polling and push notifications (Termux)
Structured JSON output, embeddings, code execution, translation, summarization
Google Search grounding and URL context
Thinking mode enabled by default (budget: 65535 tokens)
High media resolution by default
Related MCP server: Gemini Chat MCP
Prerequisites
Node.js 18+
Quick Install
git clone https://github.com/salviz/gemini-mcp-server.git
cd gemini-mcp-server
npm installRegister with Claude Code
CLI:
claude mcp add gemini -- node /path/to/gemini-mcp-server/index.jsOr add to your MCP config (~/.claude/claude_desktop_config.json or .mcp.json):
{
"mcpServers": {
"gemini": {
"type": "stdio",
"command": "node",
"args": ["/path/to/gemini-mcp-server/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}Environment Variables
Variable | Required | Description |
| Yes | Your Google Gemini API key |
Tools (23)
Chat & Generation (6)
Tool | Description |
| Send a prompt with optional search grounding and URL context |
| Multi-turn conversation with message history |
| Chat with mode switching: |
| Search-grounded generation with source citations |
| Generate JSON output matching a provided schema |
| Analyze one or more URLs using Gemini's URL context tool |
Multimodal Analysis (6)
Tool | Description |
| Analyze an image file with Gemini Vision (JPG, PNG, GIF, WebP, BMP, SVG) |
| Transcribe, summarize, or describe audio (MP3, WAV, OGG, FLAC, AAC, M4A, Opus) |
| Analyze a video file; auto-uploads large files via Files API (MP4, AVI, MOV, MKV, WebM) |
| Analyze a PDF document (up to 2GB via Files API) |
| Analyze a public YouTube video by URL (no download needed) |
| Analyze content from an HTTP/HTTPS URL or GCS URI ( |
Deep Research (2)
Tool | Description |
| Start a deep research task; sends push notification on completion |
| Check status of a running deep research task by interaction ID |
Files API (3)
Tool | Description |
| Upload a file to Gemini (up to 2GB, retained 48 hours) |
| List all uploaded files with metadata |
| Delete an uploaded file by name |
Utilities (6)
Tool | Description |
| List available Gemini models with capabilities and token limits |
| Count tokens in text using a model's tokenizer |
| Generate text embeddings (default: |
| Execute Python code via Gemini's built-in sandbox |
| Summarize text with configurable style (brief, detailed, bullet-points) |
| Translate text to any language with optional model override |
Model Selection
Default model: gemini-3.1-pro-preview. Every tool accepts an optional model parameter.
Model | Best For |
| Default. Best quality for most tasks |
| Faster responses, lower cost |
| Text embeddings (used by |
| Deep research agent (used internally) |
Files API & Large File Handling
The server automatically handles file size:
<= 20MB: Sent inline as base64 (fast, no upload step)
> 20MB up to 2GB: Uploaded via Gemini Files API, then referenced by URI
YouTube URLs: Passed directly via
fileData.fileUri(no download)HTTP/HTTPS URLs: Passed via
createPartFromUri(up to 100MB)GCS URIs (
gs://): Passed viafileData.fileUri
Uploaded files are retained for 48 hours. Use gemini_list_files and gemini_delete_file to manage them.
Deep Research
The gemini_deep_research tool uses Gemini's Interactions API with the deep-research-pro-preview-12-2025 agent:
Starts research in background mode
Polls for 50 seconds in case it finishes quickly
If still running, starts background polling (every 30s, up to 30 minutes)
Sends a push notification via
termux-notificationwhen completeSaves full results to
~/.cache/deep_research_*.txt
Use gemini_check_research to manually poll at any time.
Project Structure
gemini-mcp-server/
index.js # Server entry point
tools/
shared.js # Shared config, AI client, extractText helper
chat.js # 17 tools: chat, analysis, research, files, YouTube
utility.js # 6 tools: models, tokens, embed, code, summarize, translate
package.jsonSecurity
API key from environment only -- never hardcoded in source
File paths validated -- absolute paths required, existence checked before reading
Stdio transport -- no network server exposed
No data logged or stored -- prompts and responses are not persisted
Dependencies
Package | Version | Purpose |
| ^1.0.0 | MCP server framework |
| ^1.0.0 | Google Gemini AI SDK |
| ^3.24.0 | Input schema validation |
License
MIT
Available Tools
23 toolsgemini_analyze_audioC
Analyze an audio file with Gemini (transcribe, summarize, describe)
Inputs: audioPath (required), model, prompt.
gemini_analyze_imageB
Analyze an image file with Gemini Vision
Inputs: imagePath (required), model, prompt.
gemini_analyze_pdfA
Analyze a PDF document with Gemini (summarize, extract, answer questions)
Inputs: pdfPath (required), model, prompt.
gemini_analyze_urlC
Analyze a file from a public URL (HTTP/HTTPS) or Google Cloud Storage URI (gs://). Supports images, audio, video, PDFs, and documents up to 100MB.
Inputs: url (required), mimeType (required), model, prompt.
gemini_analyze_videoB
Analyze a video file with Gemini (describe, summarize, extract info)
Inputs: videoPath (required), model, prompt.
gemini_analyze_youtubeA
Analyze a public YouTube video with Gemini (summarize, transcribe, answer questions). Supports up to 10 videos with Gemini 2.5+ models.
Inputs: url (required), model, prompt.
gemini_chatB
Send a prompt to Gemini and get a text response. Optionally enable search grounding or URL context.
Inputs: prompt (required), model, temperature, enableSearch, +3 more.
gemini_chat_multiB
Multi-turn conversation with Gemini using message history
Inputs: messages (required), model, systemInstruction.
gemini_chat_with_toolsA
Flexible Gemini chat with mode switching: "search" (Google Search + URL context), "code" (code execution), or "all" (everything)
Inputs: prompt (required), mode, model, systemInstruction.
gemini_check_researchA
Check or wait for deep research results. Use wait=true to block until completion (ideal for background execution — the tool returns when research finishes, triggering a task notification in your AI client).
Inputs: interactionId (required), wait, timeoutMinutes.
gemini_code_executeB
Generate and execute code using Gemini's built-in code execution capability
Inputs: prompt (required), model.
gemini_count_tokensB
Count the number of tokens in the provided text using a Gemini model
Inputs: text (required), model.
gemini_deep_researchA
Start a deep research task using Gemini Deep Research. Returns an interaction ID. Then call gemini_check_research with wait=true in the background to get notified when complete.
Inputs: query (required).
gemini_delete_fileB
Delete a file from the Gemini Files API
Inputs: fileName (required).
gemini_embedB
Generate text embeddings using a Gemini embedding model
Inputs: text (required), model.
gemini_list_filesB
List files uploaded to the Gemini Files API
Inputs: pageSize.
gemini_list_modelsB
List available Gemini models with their capabilities and token limits
Inputs: no named parameters.
gemini_search_groundedB
Send a prompt to Gemini with Google Search grounding and URL context for up-to-date information
Inputs: prompt (required), model, enableUrlContext.
gemini_structured_outputB
Get structured JSON output from Gemini using a provided JSON schema
Inputs: prompt (required), jsonSchema (required), model.
gemini_summarizeA
Summarize long text using Gemini with configurable summary style
Inputs: text (required), model, style.
gemini_translateC
Translate text to a target language using Gemini
Inputs: text (required), targetLanguage (required), model, sourceLanguage.
gemini_upload_fileA
Upload a file to Gemini Files API for use with analysis tools. Files are retained for 48 hours. Max 2GB per file, 20GB total.
Inputs: filePath (required), mimeType, displayName.
gemini_url_contextC
Analyze one or more URLs using Gemini URL context tool. Gemini fetches and reads the URLs directly.
Inputs: prompt (required), urls, model.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes, but there is some overlap among chat variants (e.g., gemini_chat, gemini_chat_multi, gemini_chat_with_tools) and analysis tools (e.g., analyze_pdf vs. summarize). Descriptions help, but an agent might occasionally select the wrong tool.
All tools follow the consistent pattern 'gemini_verb_noun' (e.g., gemini_analyze_audio, gemini_list_files). The naming is uniform and predictable, making it easy for an agent to infer tool purposes.
23 tools cover a broad range of capabilities. While the count is slightly high, each tool serves a distinct function within the Gemini ecosystem. A few similarities exist, but overall the scope is justified.
The tool set covers all major Gemini features: multimodal analysis, chat variants, file management, embeddings, code execution, search, structured output, and more. There are no obvious gaps for typical use cases.
Related MCP Connectors
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
34 tools: LLM chat, summaries, translation, embeddings, speech, images. 25 free calls.
23 live research tools, from web search to SEC filings. Each call bills the scraper it runs.
Web scraping, Google SERP, Markdown and ChatGPT/Gemini answers as typed tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Google's Gemini AI models including file uploads, conversation management, and batch API processing for large-scale tasks at reduced costs. Supports multiple Gemini models with advanced features like embeddings generation and automated workflow processing.2197 npm1MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables chatting with Google Gemini AI models and custom Gems, supporting text and image generation with automatic cookie synchronization via Chrome extension.3-
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with 28 developer tools across file, git, code analysis, HTTP, and system domains, enabling tasks like file editing, repository management, code analysis, and shell command execution.13 npm2MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to query Google AI (Gemini models) via Vertex AI or Google AI Studio with automatic tool selection, multi-turn reasoning, and multimodal input support.10310 npmApache 2.0