Gemini工具箱
适用于MCP主机的终极Gemini API接口,能够智能选择适合当前任务的模型——提供最佳性能、最低令牌成本和无缝集成。
服务介绍
GemSuite MCP:最全面的 Gemini API 集成,适用于模型上下文协议
用于高级 Gemini API 与模型上下文协议 (MCP) 交互的终极开源服务器,智能选择模型以实现最佳性能、最小化令牌成本和无缝集成。
专业的 Gemini API 集成,适用于 Claude 和所有 MCP 兼容主机,具有智能模型选择和高级文件处理功能
从 geminiserchMCP 项目演变而来,具备增强功能
🌟 GemSuite MCP 是什么?
GemSuite(模型上下文协议)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模型:
- 任务类型:搜索、推理、处理或分析
- 内容类型:文本、代码、图像或文档
- 复杂性:简单查询与复杂推理
- 用户偏好:可选的手动覆盖
这种智能化确保了最佳性能同时最小化令牌使用。
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兼容主机上
当使用GemSuite MCP与Claude或其他MCP兼容主机时,这些工具将直接出现在助手的工具包中。只需根据需要调用适当的工具即可:
工具选择指南
gem_search: 用于需要搜索整合的事实性问题gem_reason: 用于需要逐步推理的复杂问题gem_process: 用于文本或文件的高效处理(最节省 token)gem_analyze: 用于文件的详细分析,并自动选择模型
📚 使用示例
Claude 桌面版使用 GemSuite Gemini 搜索访问 Google 搜索
处理文件(最节省 token)
// 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
- 1M token 上下文窗口:处理大量内容
- 搜索整合:基于当前信息生成响应
- 多模态能力:处理文本、图像等
- 平衡性能:质量和速度的良好结合
Gemini 2.0 Flash-Lite
- 最具成本效益:最小化 token 使用
- 最快的响应时间:适用于高容量操作
- 专注于文本:优化文本处理
- 最优效率:当不需要搜索和推理时
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 桌面版:无缝集成 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 - 提交一个拉取请求
对于重大更改,请先打开一个问题来讨论你想要进行的变更。
📜 许可证
本项目根据 MIT 许可证授权 - 查看 LICENSE 文件获取详情。
🙏 致谢
- Lorhlona/geminiserchMCP - 激发此增强版本灵感的原始项目
- Model Context Protocol - 开发 MCP 标准
- Google Gemini - 为支持此服务器的强大 AI 模型