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.
暂无评论. 成为第一个评论的人!
登录以参与讨论
Generates non-streaming text content from a prompt with optional URL context support. Required Params: prompt (string). Optional Params include modelName (string), generationConfig (object), safetySettings (array), systemInstruction (string or object), cachedContentName (string), urlContext (object), and 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 include modelName (string), generationConfig (object), safetySettings (array), systemInstruction (string or object), cachedContentName (string), urlContext (object), and 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 include modelName (string), generationConfig (object), safetySettings (array), and toolConfig (object).
Initiates a new stateful chat session and returns a unique sessionId. Optional Params include modelName (string), history (array), tools (array), generationConfig (object), safetySettings (array), systemInstruction (string or object), and cachedContentName (string).
Sends a message within an existing chat session. Required Params: sessionId (string), message (string). Optional Params include generationConfig (object), safetySettings (array), tools (array), toolConfig (object), and 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 include routingPrompt (string), defaultModel (string), generationConfig (object), safetySettings (array), and systemInstruction (string or object).
Creates cached content for compatible models. Required Params: contents (array), model (string). Optional Params include displayName (string), systemInstruction (string or object), ttl (string), tools (array), and toolConfig (object).
Lists existing cached content. 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 include displayName (string), systemInstruction (string or object), ttl (string), tools (array), and 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 include modelName (string), resolution (string), numberOfImages (number), safetySettings (array), negativePrompt (string), stylePreset (string), seed (number), and 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 include query (string), extractionSchema (object), questions (array), compareBy (array), outputFormat (string), includeMetadata (boolean), fetchOptions (object), and modelName (string).
Establishes a connection to an external MCP server and returns a connection ID. Required Params: serverId (string), connectionType (string), sseUrl (string), stdioCommand (string), stdioArgs (array), stdioEnv (object).
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 include 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).