mcp-gemini-server
by bsmi021·★ 35·Score 41
A TypeScript MCP server wrapping Google Gemini API, offering tools for text generation, multimedia analysis, and function calling.
Overview
This MCP server provides a comprehensive interface to Google's Gemini models through the Model Context Protocol. It wraps the @google/genai SDK to expose Gemini capabilities as standard MCP tools, enabling other LLMs or MCP-compatible systems to leverage Gemini as a backend. The server supports multiple Gemini models including gemini-1.5-pro-latest, gemini-1.5-flash, and gemini-2.5-pro. It offers features like core text generation, function calling, stateful chat management, URL-based multimedia analysis, caching, and image generation. While it doesn't support direct file uploads, it excels at analyzing publicly accessible URLs including images and YouTube videos.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this server when you need to integrate Google's Gemini models into an MCP-compatible system, especially for multimedia analysis from URLs and image generation capabilities.
When NOT to choose this
Don't choose this if you need direct file upload support or want to use Vertex AI credentials instead of Google AI Studio API keys.
Tools this server exposes
12 tools extracted from the READMEgemini_generateContentGenerates non-streaming text content from a prompt with optional URL context support.
gemini_generateContentStreamGenerates streaming text content from a prompt with optional URL context support.
gemini_functionCallEnables Gemini models to request the execution of client-defined functions.
gemini_startChatStarts a new chat session with Gemini for stateful conversations.
gemini_sendMessageSends a message in an ongoing chat session with Gemini.
gemini_generateImageGenerates images from text prompts using Gemini 2.0 Flash Experimental.
gemini_url_analysisSpecialized tool for advanced URL content analysis with multiple analysis types.
mcpConnectToServerEstablishes a connection to an external MCP server.
mcpListServerToolsLists available tools on a connected MCP server.
mcpCallServerToolCalls a function on a connected MCP server, with an option for file output.
mcpDisconnectFromServerDisconnects from an external MCP server.
writeToFileWrites content directly to files within allowed directories.
Comparable tools
Installation
Installation & Setup
- **Clone/Place Project:** Ensure the
mcp-gemini-serverproject directory is accessible. - **Install Dependencies:**
``bash npm install ``
- **Build Project:**
``bash npm run build ``
- **Generate Connection Token:** Create a secure token using Node.js crypto:
``bash node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" ``
- **Configure MCP Client:** Add to your settings file:
``json { "mcpServers": { "gemini-server": { "command": "node", "args": ["/path/to/mcp-gemini-server/dist/server.js"], "env": { "GOOGLE_GEMINI_API_KEY": "YOUR_API_KEY", "MCP_SERVER_HOST": "localhost", "MCP_SERVER_PORT": "8080", "MCP_CONNECTION_TOKEN": "YOUR_GENERATED_CONNECTION_TOKEN", "GOOGLE_GEMINI_MODEL": "gemini-1.5-flash" } } } } ``
FAQ
- Does this server support direct file uploads?
- No, this MCP Gemini Server does not support direct file uploads. It focuses on URL-based multimedia analysis for images and videos. Local files must be hosted publicly to be analyzed.
- Can I use this with Vertex AI credentials?
- No, this server only supports Google AI Studio API keys. The Caching API is not compatible with Vertex AI credentials and is not currently supported.
Compare mcp-gemini-server with
Last updated · Auto-generated from public README + GitHub signals.