MCP Catalogs
首页

mcp-gemini-server

by bsmi021·35·综合分 41

TypeScript 构建的 MCP 服务器,封装 Google Gemini API,提供文本生成、多媒体分析和函数调用工具。

ai-llmdeveloper-toolsmedia
15
Forks
1
活跃 Issue
12 个月前
最近提交
2 天前
收录于

概述

这个 MCP 服务器通过模型上下文协议 (MCP) 提供对 Google Gemini 模型的全面接口。它封装 @google/genai SDK,将 Gemini 功能作为标准 MCP 工具暴露,使其他 LLM 或兼容系统可以利用 Gemini 作为后端。服务器支持多种 Gemini 模型,包括 gemini-1.5-pro-latest、gemini-1.5-flash 和 gemini-2.5-pro。它提供核心文本生成、函数调用、有状态聊天管理、基于 URL 的多媒体分析、缓存和图像生成等功能。虽然不支持直接文件上传,但它擅长分析公开可访问的 URL,包括图片和 YouTube 视频。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:分析 YouTube 教育视频内容并生成摘要
:使用系统指令和缓存上下文生成文本内容
:通过 URL 处理进行网页内容分析
:此服务器是否支持直接文件上传?
:我可以使用 Vertex AI 凭据吗?

什么时候选它

当您需要将 Google 的 Gemini 模型集成到 MCP 兼容系统中,特别是用于基于 URL 的多媒体分析和图像生成功能时,选择此服务器。

什么时候不要选它

如果您需要直接文件上传支持或想使用 Vertex AI 凭据而不是 Google AI Studio API 密钥,请不要选择此服务器。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • gemini_generateContent

    Generates non-streaming text content from a prompt with optional URL context support.

  • gemini_generateContentStream

    Generates streaming text content from a prompt with optional URL context support.

  • gemini_functionCall

    Enables Gemini models to request the execution of client-defined functions.

  • gemini_startChat

    Starts a new chat session with Gemini for stateful conversations.

  • gemini_sendMessage

    Sends a message in an ongoing chat session with Gemini.

  • gemini_generateImage

    Generates images from text prompts using Gemini 2.0 Flash Experimental.

  • gemini_url_analysis

    Specialized tool for advanced URL content analysis with multiple analysis types.

  • mcpConnectToServer

    Establishes a connection to an external MCP server.

  • mcpListServerTools

    Lists available tools on a connected MCP server.

  • mcpCallServerTool

    Calls a function on a connected MCP server, with an option for file output.

  • mcpDisconnectFromServer

    Disconnects from an external MCP server.

  • writeToFile

    Writes content directly to files within allowed directories.

可对比工具

mcp-openai-serveranthropic-claude-mcp-servergemini-api-cli

安装

安装与设置

  1. **克隆/放置项目:** 确保 mcp-gemini-server 项目目录在系统上可访问。
  2. **安装依赖:**

``bash npm install ``

  1. **构建项目:**

``bash npm run build ``

  1. **生成连接令牌:** 使用 Node.js crypto 创建安全令牌:

``bash node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" ``

  1. **配置 MCP 客户端:** 添加到您的设置文件:

``json { "mcpServers": { "gemini-server": { "command": "node", "args": ["/path/to/mcp-gemini-server/dist/server.js"], "env": { "GOOGLE_GEMINI_API_KEY": "YOUR_API_KEY", "MCP_SERVER_HOST": "localhost", "MCP_SERVER_PORT": "8080", "MCP_CONNECTION_TOKEN": "YOUR_GENERATED_CONNECTION_TOKEN", "GOOGLE_GEMINI_MODEL": "gemini-1.5-flash" } } } } ``

FAQ

此服务器是否支持直接文件上传?
不支持,此 MCP Gemini 服务器不支持直接文件上传。它专注于基于 URL 的多媒体分析,用于图片和视频。本地文件必须公开托管才能进行分析。
我可以使用 Vertex AI 凭据吗?
不可以,此服务器仅支持 Google AI Studio API 密钥。缓存 API 与 Vertex AI 凭据不兼容,目前不支持。

mcp-gemini-server 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。