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: modelName (string), generationConfig (object), safetySettings (array), systemInstruction (string or object), cachedContentName (string), urlContext (object), modelPreferences (object).
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: modelName (string), generationConfig (object), safetySettings (array), systemInstruction (string or object), cachedContentName (string), urlContext (object), modelPreferences (object).
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: modelName (string), generationConfig (object), safetySettings (array), toolConfig (object).
Initiates a new stateful chat session and returns a unique sessionId. Optional Params: modelName (string), history (array), tools (array), generationConfig (object), safetySettings (array), systemInstruction (string or object), cachedContentName (string).
Sends a message within an existing chat session. Required Params: sessionId (string), message (string). Optional Params: generationConfig (object), safetySettings (array), tools (array), toolConfig (object), cachedContentName (string).
Sends the result of a function execution back to a chat session. Required Params: sessionId (string), functionResponse (string). Optional Params: functionCall (object).
Routes a message to the most appropriate model from a provided list based on message content. Required Params: message (string), models (array). Optional Params: routingPrompt (string), defaultModel (string), generationConfig (object), safetySettings (array), systemInstruction (string or object).
Creates cached content for compatible models. Required Params: contents (array), model (string). Optional Params: displayName (string), systemInstruction (string or object), ttl (string), tools (array), toolConfig (object).
Lists existing cached content. Required Params: None. Optional Params: 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: displayName (string), systemInstruction (string or object), ttl (string), tools (array), toolConfig (object).
Deletes cached content. Required Params: cacheName (string).
Generates images from text prompts using available image generation models. Required Params: prompt (string). Optional Params: modelName (string), resolution (string), numberOfImages (number), safetySettings (array), negativePrompt (string), stylePreset (string), seed (number), styleStrength (number).
Advanced URL analysis tool that fetches content from web pages and performs specialized analysis tasks. Required Params: urls (array), analysisType (string). Optional Params: query (string), extractionSchema (object), questions (array), compareBy (array), outputFormat (string), includeMetadata (boolean), fetchOptions (object), modelName (string).
Establishes a connection to an external MCP server and returns a connection ID. Required Params: serverId (string), connectionType (string), sseUrl (string, optional), stdioCommand (string, optional), stdioArgs (array of strings, optional), stdioEnv (object, optional).
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, default: false).