Gemini AI
Summary
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.
Available Actions(19)
gemini_generateContent
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).
gemini_generateContentStream
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).
gemini_functionCall
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).
gemini_startChat
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).
gemini_sendMessage
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).
gemini_sendFunctionResult
Sends the result of a function execution back to a chat session. Required Params: sessionId (string), functionResponse (string). Optional Params: functionCall (object).
gemini_routeMessage
Routes a message to the most appropriate model from a provided list based on message content. Returns both the model's response and which model was selected. Required Params: message (string), models (array). Optional Params: routingPrompt (string), defaultModel (string), generationConfig (object), safetySettings (array), systemInstruction (string or object).
gemini_createCache
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).
gemini_listCaches
Lists existing cached content. Required Params: None. Optional Params: pageSize (number), pageToken (string).
gemini_getCache
Retrieves metadata for specific cached content. Required Params: cacheName (string).
gemini_updateCache
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).
gemini_deleteCache
Deletes cached content. Required Params: cacheName (string).
gemini_generateImage
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).
gemini_url_analysis
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).
mcpConnectToServer
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).
mcpListServerTools
Lists available tools on a connected MCP server. Required Params: connectionId (string).
mcpCallServerTool
Calls a function on a connected MCP server. Required Params: connectionId (string), toolName (string), toolArgs (object). Optional Params: outputToFile (string).
mcpDisconnectFromServer
Disconnects from an external MCP server. Required Params: connectionId (string).
writeToFile
Writes content directly to a file. Required Params: filePath (string), content (string). Optional Params: overwrite (boolean).
Community Reviews
No reviews yet. Be the first to review!
Sign in to join the conversation