MCP-Gemini-Server provides a robust interface to Google's Gemini AI models through a collection of specialized tools. Built with TypeScript and the Model Context Protocol SDK, it enables AI assistants to leverage Gemini's capabilities including content generation, chat functionality, function calling, and file/cache management. The server implements both streaming and non-streaming content generation, supports stateful chat sessions with function execution, and offers comprehensive file and cache operations for optimizing performance. This implementation stands out by providing fine-grained control over generation parameters, safety settings, and tool configurations while handling error cases gracefully. It's particularly valuable for developers building AI applications that need direct access to Gemini's advanced features through a standardized protocol.
No reviews yet. Be the first to review!
Sign in to join the conversation
Generates non-streaming text content from a prompt with optional URL context support. Required Params: prompt (string). Optional Params include modelName (string), generationConfig (object), and more.
Generates text content via streaming using Server-Sent Events (SSE) for real-time content delivery with URL context support. Required Params: prompt (string). Optional Params include modelName (string), generationConfig (object), and more.
Sends a prompt and function declarations to the model, returning either a text response or a requested function call object (as a JSON string). Required Params: prompt (string), functionDeclarations (array). Optional Params include modelName (string), generationConfig (object), and more.
Initiates a new stateful chat session and returns a unique sessionId. Optional Params include modelName (string), history (array), tools (array), and more.
Sends a message within an existing chat session. Required Params: sessionId (string), message (string). Optional Params include generationConfig (object), tools (array), and more.
Sends the result of a function execution back to a chat session. Required Params: sessionId (string), functionResponse (string). Optional Params include functionCall (object).
Routes a message to the most appropriate model from a provided list based on message content. Required Params include message (string), models (array). Optional Params include routingPrompt (string), defaultModel (string), and more.
Creates cached content for compatible models. Required Params: contents (array), model (string). Optional Params include displayName (string), systemInstruction (string or object), and more.
Lists existing cached content. Optional Params include pageSize (number), pageToken (string).
Retrieves metadata for specific cached content. Required Params: cacheName (string).
Updates metadata and contents for cached content. Required Params: cacheName (string), contents (array). Optional Params include displayName (string), systemInstruction (string or object), and more.
Deletes cached content. Required Params: cacheName (string).
Generates images from text prompts using available image generation models. Required Params: prompt (string). Optional Params include modelName (string), resolution (string), numberOfImages (number), and more.
Advanced URL analysis tool that fetches content from web pages and performs specialized analysis tasks. Required Params: urls (array), analysisType (string enum). Optional Params include query (string), extractionSchema (object), questions (array), and more.
Establishes a connection to an external MCP server and returns a connection ID. Required Params: serverId (string), connectionType (string enum), and at least one of sseUrl (string) or stdioCommand (string).
Lists available tools on a connected MCP server. Required Params: connectionId (string).
Calls a function on a connected MCP server. Required Params: connectionId (string), toolName (string), toolArgs (object). Optional Params: outputToFile (string).
Disconnects from an external MCP server. Required Params: connectionId (string).
Writes content directly to a file. Required Params: filePath (string), content (string). Optional Params: overwrite (boolean).