mcp-gemini
MCP server from dakrin/mcp-gemini-server
claude mcp add --transport stdio dakrin-mcp-gemini-server node path/to/server.js \ --env LOG_LEVEL="info" \ --env GEMINI_API_KEY="Gemini 2.5 Pro API key" \ --env GOOGLE_SEARCH_API_KEY="Google Custom Search API key (optional for grounding)"
How to use
This MCP server implements the Gemini MCP Server, enabling Claude Desktop to interact with Google Gemini 2.5 Pro Experimental through the MCP protocol. It exposes a set of tools that can be invoked via MCP requests, including content generation with Gemini and retrieving model information. The server securely manages API keys through environment variables and can optionally integrate Google Search grounding to improve results.
Available tools include:
- generateWithGemini: Generate content using Google Gemini 2.5 Pro Experimental. You provide a prompt and optional parameters such as temperature, maxTokens, safeMode, and useSearch to influence generation and grounding behavior. Use this to produce iterative content, summaries, or creative text based on Gemini's capabilities.
- getModelInfo: Retrieve information about the Gemini model currently in use, including model version, capabilities, and any pertinent metadata.
To use these tools, send MCP requests to the server with the appropriate tool name and parameters. Ensure your Gemini API key is supplied via environment variables when starting the server, and verify any optional grounding features (like Google Search) are configured if you plan to use them.
How to install
Prerequisites:
- Node.js (v14+ or as required by the project) and npm/yarn installed
- Git (optional, for cloning the repository)
- An active Gemini 2.5 Pro API key
Installation steps:
-
Clone the repository
git clone https://github.com/your-org/dakrin-mcp-gemini-server.git cd dakrin-mcp-gemini-server -
Install dependencies
npm install # or yarn install -
Configure environment variables Create a .env file or export variables in your environment:
export GEMINI_API_KEY=your_gemini_api_key export GOOGLE_SEARCH_API_KEY=your_google_search_api_key (optional) export LOG_LEVEL=infoAlternatively, set these in a .env file and load with a dotenv-compatible setup as per project configuration.
-
Run the server
node path/to/server.js # or use a process manager like pm2 or docker as appropriate -
(Optional) Run via npx if the package is published
npx dakrin-mcp-gemini-server
Additional notes
Notes and tips:
- Ensure GEMINI_API_KEY is kept secret; it should never be logged or exposed in responses.
- The GOOGLE_SEARCH_API_KEY is optional and only required if you enable grounding via via the useSearch flag in generateWithGemini.
- If you encounter connection issues, verify network access to Gemini services and validate that the API key is active.
- The server supports full MCP protocol, including token usage reporting and secure handling of keys.
- If you update environment variables, restart the server to apply changes.
- For debugging, set LOG_LEVEL to debug to receive verbose logs.
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.