mcpField
G
GemSuite MCP: The Most Comprehensive Gemini API Integration for Model Context Protocol

GemSuite MCP: The Most Comprehensive Gemini API Integration for Model Context Protocol

本地服务
github.com/PV-BhatAI 与智能体3284 周前更新

关于 GemSuite MCP: The Most Comprehensive Gemini API Integration for Model Context Protocol

GemSuite MCP 是一个开源 MCP 服务,让 Claude、Cursor 等 MCP 客户端通过统一接口调用 Gemini API。它会根据任务类型和内容自动选择 Gemini 模型,并支持多种文件格式的处理。

主要功能

  1. 01四个专用工具:搜索、推理、处理与分析
  2. 02根据任务和内容自动选择模型
  3. 03支持通过 file_path 处理多种文件
  4. 04支持批量文件处理
  5. 05指数退避的速率限制处理
  6. 06可通过 model_id 手动指定模型

适用场景

  1. 01对大型文档进行摘要或信息提取
  2. 02借助 Google 搜索获取带依据的回答
  3. 03对图片或代码文件进行分析与审查

MCP 相关

该项目是一个 MCP 服务,向 MCP 客户端暴露 gem_search、gem_reason、gem_process 和 gem_analyze 四个工具。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"gemsuite": {
"command": "npx",
"args": [
"-y",
"@smithery/cli"
]
}
}
}
启动命令npx -y @smithery/cli

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npm@smithery/cli

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

GemSuite MCP:最全面的 Model Context Protocol Gemini API 集成

面向 Model Context Protocol(MCP)的先进 Gemini API 交互开源服务,以智能方式选择模型,实现最佳性能、最低令牌成本和无缝集成。
README 配图

GemSuite MCP 徽标

许可证:MIT TypeScript MCP smithery 徽章 Node.js

README 配图

为 Claude 和所有兼容 MCP 的宿主提供专业的 Gemini API 集成,支持智能模型选择和高级文件处理

在 geminiserchMCP 项目基础上发展而来,功能更加强大

安装 • 功能 • 用法 • 示例 • 模型 • 贡献

🌟 什么是 GemSuite MCP?

GemSuite(Model Context Protoco)MCP 是面向 MCP 宿主的终极 Gemini API 集成接口,可根据当前任务智能选择模型,提供最佳性能、最低令牌成本和无缝集成。它使任何兼容 MCP 的宿主(Claude、Cursor、Replit 等)都能无缝利用 Gemini 的能力,重点包括:

  1. 智能:根据任务和内容自动选择最佳 Gemini 模型
  2. 高效:针对不同工作负载优化令牌用量和性能
  3. 简单:为复杂 AI 操作提供清晰、一致的 API
  4. 多功能:高级文件处理;支持多种文件类型、操作和用例

无论你是要分析文档、解决复杂问题、处理大型文本文件,还是搜索信息,GemSuite MCP 都能提供适合任务的工具和模型。

为什么选择 GemSuite MCP?

与功能有限的其他 Gemini MCP 服务不同,GemSuite MCP 提供:

✅ 智能模型选择:根据任务自动选择最佳 Gemini 模型 ✅ 统一文件处理:无缝处理各种文件类型,并自动检测格式 ✅ 全面的工具套件:四种专用工具,涵盖搜索、推理、处理和分析 ✅ 可用于生产环境:已在 Smithery.ai、MCP.so 和 Glama.io 上部署并验证

🚀 安装

选项 1:Smithery.ai(推荐)
# Install directly via Smithery CLI
npx -y @smithery/cli@latest install @PV-Bhat/gemsuite-mcp --client claude
选项 2:手动安装
# Clone the repository
git clone https://github.com/PV-Bhat/gemsuite-mcp.git
cd gemsuite-mcp

# Install dependencies
npm install

# Set your Gemini API key
echo "GEMINI_API_KEY=your_api_key_here" > .env

# Build the project
npm run build

# Start the server
npm start

🔑 API 密钥设置

  1. 从 Google AI Studio 获取 Gemini API 密钥
  2. 将其设置为环境变量:
    export GEMINI_API_KEY=your_api_key_here
    
    或在项目根目录创建 .env 文件:
    GEMINI_API_KEY=your_api_key_here
    

💎 主要功能

统一文件处理
  • 无缝文件处理:所有工具都支持通过 file_path 参数输入文件
  • 自动格式检测:根据相应的 MIME 类型正确处理各种文件类型
  • 多模态支持:处理图像、文档、代码文件等
  • 批量处理:支持在单次操作中处理多个文件
智能模型选择

GemSuite MCP 会根据以下因素自动选择最合适的 Gemini 模型:

  • 任务类型:搜索、推理、处理或分析
  • 内容类型:文本、代码、图像或文档
  • 复杂度:简单查询与复杂推理
  • 用户偏好:可选的手动覆盖设置

这项智能功能可确保最佳性能,同时最大限度地减少令牌用量。

graph TD
    A[Task Request] --> B{Task Type}
    B -->|Search| C[Gemini Flash]
    B -->|Reasoning| D[Gemini Flash Thinking]
    B -->|Processing| E[Gemini Flash-Lite]
    B -->|Analysis| F{File Type}
    F -->|Image| G[Gemini Flash]
    F -->|Code| H[Gemini Flash Thinking]
    F -->|Text| I[Gemini Flash-Lite]
    C & D & E & G & H & I --> J[Execute Request]
专用工具
工具用途模型使用场景
gem_search集成搜索的信息检索Gemini Flash事实性问题、最新信息、有依据的回答
gem_reason通过逐步分析进行复杂推理Gemini Flash Thinking数学、科学、编码问题、逻辑分析
gem_process快速、高效地处理内容Gemini Flash-Lite摘要、提取、大批量操作
gem_analyze通过自动选择模型进行智能文件分析自动选择文档分析、代码审查、图像理解
稳健的错误处理
  • 指数退避:妥善处理 API 速率限制
  • 全面的错误检测:清晰识别错误来源
  • 可操作的消息:提供详细错误信息以便排查问题
  • 恢复机制:主要方法失败时智能启用备用方案

🖥️ 使用方法

在 Claude 或其他兼容 MCP 的宿主中

在 Claude 或其他兼容 MCP 的宿主中使用 GemSuite MCP 时,这些工具会直接显示在助手的工具集中。只需根据需求调用相应的工具:

工具选择指南
  • gem_search:用于需要集成搜索的事实性问题
  • gem_reason:用于需要逐步推理的复杂问题
  • gem_process:用于高效处理文本或文件(令牌效率最高)
  • gem_analyze:用于详细分析文件,并自动选择模型

📚 使用示例

image

Claude Desktop 使用 GemSuite Gemini Search 访问 Google 搜索
处理文件(令牌效率最高)
// Summarize a large document
const response = await gem_process({
  file_path: "/path/to/your/large_document.pdf",
  operation: "summarize"
});

// Extract specific information
const response = await gem_process({
  file_path: "/path/to/your/report.docx",
  operation: "extract",
  content: "Extract all financial data and metrics from this document."
});
分析文件
// Analyze an image
const response = await gem_analyze({
  file_path: "/path/to/your/image.jpg",
  instruction: "Describe what you see in this image in detail."
});

// Analyze code
const response = await gem_analyze({
  file_path: "/path/to/your/code.py",
  instruction: "Identify potential bugs and suggest optimizations."
});
复杂推理
// Solve a complex problem with step-by-step reasoning
const response = await gem_reason({
  problem: "Analyze this code and suggest improvements:",
  file_path: "/path/to/your/code.js",
  show_steps: true
});

// Mathematical problem solving
const response = await gem_reason({
  problem: "Solve this differential equation: dy/dx = 2xy with y(0) = 1",
  show_steps: true
});
使用文件进行搜索
// Answer questions about a document with search integration
const response = await gem_search({
  query: "What companies are mentioned in this document?",
  file_path: "/path/to/your/document.pdf"
});

// Factual questions with search
const response = await gem_search({
  query: "What are the latest developments in quantum computing?",
  enable_thinking: true
});

🧠 模型特性

GemSuite MCP 使用三种主要的 Gemini 模型,并会针对每项任务智能选择最佳模型:

Gemini 2.0 Flash
  • 100 万令牌上下文窗口:处理大量内容
  • 搜索集成:基于最新信息生成回答
  • 多模态能力:处理文本、图像等内容
  • 均衡性能:兼顾质量与速度
Gemini 2.0 Flash-Lite
  • 成本效益最高:最大限度地减少令牌用量
  • 响应速度最快:适合大批量操作
  • 专注文本:针对文本处理进行了优化
  • 效率最佳:无需搜索和推理时的理想选择
Gemini 2.0 Flash Thinking
  • 增强推理能力:进行逻辑分析和问题求解
  • 逐步分析:展示推理过程
  • 专用能力:擅长复杂计算
  • 适合深入分析:需要全面分析时的最佳选择

🔄 工作流示例

文档分析工作流
// 1. Get a high-level summary (most efficient)
const summary = await gem_process({
  file_path: "/path/to/large_document.pdf",
  operation: "summarize"
});

// 2. Extract specific information
const keyPoints = await gem_process({
  file_path: "/path/to/large_document.pdf",
  operation: "extract",
  content: "Extract the key findings and recommendations"
});

// 3. Answer specific questions with search integration
const answers = await gem_search({
  query: "Based on this document, what are the implications for market growth?",
  file_path: "/path/to/large_document.pdf"
});

// 4. Claude synthesizes the processed information
// This approach is dramatically more token-efficient than having
// Claude process the entire document directly
代码审查工作流
// 1. Get code overview
const overview = await gem_analyze({
  file_path: "/path/to/code.js",
  instruction: "Provide an overview of this code's structure and purpose"
});

// 2. Identify potential issues
const issues = await gem_reason({
  problem: "Analyze this code for bugs, security vulnerabilities, and performance issues",
  file_path: "/path/to/code.js",
  show_steps: true
});

// 3. Generate improvements
const improvements = await gem_reason({
  problem: "Suggest specific improvements to make this code more efficient and maintainable",
  file_path: "/path/to/code.js",
  show_steps: true
});

// 4. Claude provides a comprehensive code review synthesis

🧩 与其他 MCP 宿主集成

GemSuite MCP 可与任何兼容 MCP 的宿主配合使用:

  • Claude Desktop:无缝集成 Claude 强大的推理能力
  • Cursor IDE:借助 Gemini 的能力增强编码辅助
  • Replit:直接在开发环境中生成和分析代码
  • 其他 MCP 宿主:兼容任何实现 MCP 标准的平台

🛠️ 高级配置

自定义模型选择

你可以通过指定 model_id 参数来覆盖自动模型选择:

// Force the use of Gemini Flash Thinking for a processing task
const response = await gem_process({
  file_path: "/path/to/document.pdf",
  operation: "analyze",
  model_id: "models/gemini-2.0-flash-thinking"
});
gem_process 的可用操作
  • summarize:生成简洁的摘要
  • extract:提取特定信息
  • restructure:将内容重新组织为更实用的格式
  • simplify:让复杂内容更易于理解
  • expand:补充内容细节或背景信息
  • critique:提供批判性分析
  • feedback:提供建设性反馈
  • analyze:对内容进行一般性分析

🔧 参与贡献

欢迎贡献!以下是入门步骤:

  1. Fork 此仓库
  2. 创建功能分支:git checkout -b feature/my-new-feature
  3. 进行修改
  4. 运行测试:npm test
  5. 提交修改:git commit -m 'Add my new feature'
  6. 推送到你的分支:git push origin feature/my-new-feature
  7. 提交拉取请求

对于重大变更,请先创建 issue,讨论你希望进行的修改。

📜 许可证

本项目采用 MIT 许可证授权,详情请参阅 LICENSE 文件。

🙏 致谢

🔗 链接


由 PV-Bhat 倾心打造 ❤️

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。