关于 GemSuite MCP: The Most Comprehensive Gemini API Integration for Model Context Protocol
GemSuite MCP 是一个开源 MCP 服务,让 Claude、Cursor 等 MCP 客户端通过统一接口调用 Gemini API。它会根据任务类型和内容自动选择 Gemini 模型,并支持多种文件格式的处理。
主要功能
- 01四个专用工具:搜索、推理、处理与分析
- 02根据任务和内容自动选择模型
- 03支持通过 file_path 处理多种文件
- 04支持批量文件处理
- 05指数退避的速率限制处理
- 06可通过 model_id 手动指定模型
适用场景
- 01对大型文档进行摘要或信息提取
- 02借助 Google 搜索获取带依据的回答
- 03对图片或代码文件进行分析与审查
MCP 相关
该项目是一个 MCP 服务,向 MCP 客户端暴露 gem_search、gem_reason、gem_process 和 gem_analyze 四个工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
GemSuite MCP:最全面的 Model Context Protocol Gemini API 集成
面向 Model Context Protocol(MCP)的先进 Gemini API 交互开源服务,以智能方式选择模型,实现最佳性能、最低令牌成本和无缝集成。
🌟 什么是 GemSuite MCP?
GemSuite(Model Context Protoco)MCP 是面向 MCP 宿主的终极 Gemini API 集成接口,可根据当前任务智能选择模型,提供最佳性能、最低令牌成本和无缝集成。它使任何兼容 MCP 的宿主(Claude、Cursor、Replit 等)都能无缝利用 Gemini 的能力,重点包括:
- 智能:根据任务和内容自动选择最佳 Gemini 模型
- 高效:针对不同工作负载优化令牌用量和性能
- 简单:为复杂 AI 操作提供清晰、一致的 API
- 多功能:高级文件处理;支持多种文件类型、操作和用例
无论你是要分析文档、解决复杂问题、处理大型文本文件,还是搜索信息,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 密钥设置
- 从 Google AI Studio 获取 Gemini API 密钥
- 将其设置为环境变量:
或在项目根目录创建export GEMINI_API_KEY=your_api_key_here.env文件:GEMINI_API_KEY=your_api_key_here
💎 主要功能
统一文件处理
- 无缝文件处理:所有工具都支持通过
file_path参数输入文件 - 自动格式检测:根据相应的 MIME 类型正确处理各种文件类型
- 多模态支持:处理图像、文档、代码文件等
- 批量处理:支持在单次操作中处理多个文件
智能模型选择
|
GemSuite MCP 会根据以下因素自动选择最合适的 Gemini 模型:
这项智能功能可确保最佳性能,同时最大限度地减少令牌用量。 |
|
专用工具
| 工具 | 用途 | 模型 | 使用场景 |
|---|---|---|---|
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:用于详细分析文件,并自动选择模型
📚 使用示例
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:对内容进行一般性分析
🔧 参与贡献
欢迎贡献!以下是入门步骤:
- Fork 此仓库
- 创建功能分支:
git checkout -b feature/my-new-feature - 进行修改
- 运行测试:
npm test - 提交修改:
git commit -m 'Add my new feature' - 推送到你的分支:
git push origin feature/my-new-feature - 提交拉取请求
对于重大变更,请先创建 issue,讨论你希望进行的修改。
📜 许可证
本项目采用 MIT 许可证授权,详情请参阅 LICENSE 文件。
🙏 致谢
- Lorhlona/geminiserchMCP - 启发了这个增强版本的原始项目
- Model Context Protocol - 致谢其制定 MCP 标准
- Google Gemini - 为此服务提供强大的 AI 模型
🔗 链接
由 PV-Bhat 倾心打造 ❤️
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。