GemSuite MCP:用于模型上下文协议的最全面的Gemini API集成
用于与模型上下文协议(MCP)进行高级Gemini API交互的终极开源服务器,智能选择模型以实现最佳性能、最低代币成本和无缝集成。
   ](https://smithery.ai/server/@PV-Bhat/gemsuite-mcp) ](https://nodejs.org/)
适用于Claude和所有兼容MCP的主机的专业Gemini API集成,具有智能型号选择和高级文件处理功能
*从 双子座MCP 具有增强功能的项目*
🌟 什么是GemSuite MCP?
GemSuite(Model Context Protoco)MCP是用于MCP主机的Gemini API最终集成接口,可手动智能选择任务模型,提供最佳性能、最低代币成本和无缝集成。它使任何兼容MCP的主机(Claude、Cursor、Replit等)都能无缝利用Gemini的功能,重点是:
- 智能:根据任务和内容自动选择最佳Gemini模型
- 效率:优化不同工作负载的令牌使用和性能
- 简洁:为复杂的人工智能操作提供干净、一致的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密钥设置
- 从获取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 | 复杂推理与逐步分析 | 双子座闪电思维 | 数学、科学、编码问题、逻辑分析 |
gem_process | 快速高效的内容处理 | Gemini Flash Lite | 摘要、提取、大容量操作 |
gem_analyze | 具有自动模型选择功能的智能文件分析 | 自动选择 | 文档分析、代码审查、图像理解 |
稳健的错误处理
- 指数退避:API费率限制的优雅处理
- 全面错误检测:明确错误来源
- 可操作消息:用于故障排除的详细错误信息
- 恢复机制:主要方法失败时的智能回退
🖥️ 用法
在Claude或其他MCP兼容主机中
当将GemSuite MCP与Claude或其他MCP兼容主机一起使用时,这些工具将直接在助手的工具包中提供。只需根据您的需求调用相应的工具:
工具选择指南
gem_search:用于需要搜索集成的事实问题gem_reason:对于需要逐步推理的复杂问题gem_process:用于高效处理文本或文件(最具令牌效率)gem_analyze:用于自动模型选择文件的详细分析
📚 使用示例
Claude Desktop使用GemSuite Gemini搜索访问谷歌搜索
处理文件(令牌效率最高)
// 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模型,为每个任务智能地选择最佳模型:
双子座2.0闪光灯
- 1M令牌上下文窗口:处理大量内容
- 搜索集成:当前信息中的地面响应
- 多模式功能:处理文本、图像等
- 平衡的性能:质量和速度的完美结合
Gemini 2.0 Flash Lite
- 最具成本效益:尽量减少令牌使用
- 最快的响应时间:非常适合大批量操作
- 以文本为中心:针对文本处理进行了优化
- 效率最优:当不需要搜索和推理时
双子座2.0闪电思维
- 增强推理:逻辑分析和解决问题
- 逐步分析:显示推理过程
- 专业能力:擅长复杂的计算
- 最适合深度:当需要进行彻底分析时
🔄 工作流示例
文档分析工作流
// 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强大的推理能力无缝集成
- 光标IDE:利用Gemini的功能增强编码辅助
- 回复:直接在开发环境中生成和分析代码
- 其他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:内容总体分析
🔧 贡献
欢迎投稿!以下是如何开始:
- 分叉存储库
- 创建要素分支:
git checkout -b feature/my-new-feature - 进行更改
- 运行测试:
npm test - 提交您的更改:
git commit -m 'Add my new feature' - 推到您的分支:
git push origin feature/my-new-feature - 提交拉取请求
对于重大更改,请先打开一个问题来讨论您想要更改的内容。
📜 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
🙏 致谢
- Lorhlona/双子叶植物 -启发此增强版本的原始项目
- 模型上下文协议 -用于制定MCP标准
- 谷歌双子座 -对于为该服务器提供动力的强大AI模型
🔗 链接
______________________________________________________________________
Made with ❤️ by PV-Bhat


