MCP Gemini Server logo

MCP Gemini Server

by MCP-Mirror

This project provides a dedicated MCP (Model Context Protocol) server that wraps the `@google/genai` SDK. It exposes Google's Gemini model capabilities as standard MCP tools, allowing other LLMs or MCP-compatible systems to leverage Gemini's features.

View on GitHub

Last updated: N/A

What is MCP Gemini Server?

The MCP Gemini Server is a dedicated server that wraps the @google/genai SDK, exposing Google's Gemini model capabilities as standard MCP tools. It simplifies integration with Gemini models by providing a consistent, tool-based interface managed via the MCP standard.

How to use MCP Gemini Server?

To use the server, you need to install it either via Smithery or manually. Manual installation involves cloning the project, installing dependencies, building the project, configuring your MCP client with the server details (including your Google AI Studio API key), and restarting your MCP client. The server is then accessed through MCP tool calls from the client.

Key features of MCP Gemini Server

  • Core Generation (standard and streaming)

  • Function Calling

  • Stateful Chat Management

  • File Handling (Google AI Studio Key Required)

  • Caching (Google AI Studio Key Required)

Use cases of MCP Gemini Server

  • Integrating Gemini models into existing LLM workflows.

  • Leveraging Gemini's capabilities as a backend workhorse for other LLMs.

  • Building conversational applications with stateful chat support.

  • Enabling function calling within LLM interactions.

  • Optimizing prompts with caching mechanisms.

FAQ from MCP Gemini Server

What is the Model Context Protocol (MCP)?

MCP is a standard that allows different LLMs and systems to interact with each other through a consistent, tool-based interface.

What are the prerequisites for using this server?

You need Node.js (v18 or later) and an API Key from Google AI Studio.

Is Vertex AI supported?

No, the server currently only supports Google AI Studio API keys. File Handling and Caching APIs are also only compatible with Google AI Studio API keys.

How do I configure the server?

The server is configured using environment variables, specifically GOOGLE_GEMINI_API_KEY (required) and GOOGLE_GEMINI_MODEL (optional).

What do I do if I encounter an error?

Check the message and details fields of the returned McpError for specific clues when troubleshooting. Common error scenarios include invalid API keys, invalid parameters, safety blocks, and rate limits.

MCP Gemini Server - MCP Server | MCP Directory