AG

angrysky56/gemini-mcp-client

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

22 stars 8 forks 质量 48 趋势 0

一个MCP(模型上下文协议)客户端,使用Google Gemini AI模型进行智能工具使用和对话处理。测试后,目前与Claude Desktop作为MCP服务器运行良好。

概览

致谢及起始于——medium.com/@fruitful2007/building-an-mcp-client-101-lets-build-one-for-a-gemini-chat-agent 一个(潜在,笑)强大的MCP(模型上下文协议)客户端,使用谷歌的Gemini AI模型进行智能工具使用和对话处理。- 目前测试过,作为MCP服务器与Claude Desktop良好配合。 - :支持多种 Gemini 模型(2.0 闪存、2.5 pro、1.5 pro 等)- 支持gemini-tool-agent、google-generativeai 或 google-genai 包 - :在对话中更换模型 - :存储和管理 MCP 服务器配置 - :AI 驱动的工具发现与执行 - :高效的并发操作 - :稳健的错误恢复和日志记录 - :现代 Python 实践,具备完整的类型安全 使用agents目录中的“adk web”,先把 agent.py 路径改成你自己的,方便简单地用Gemini MCP,等我有更好的设置。full_mcp_agent-README。

概述(AI 翻译)

致谢及起始于——medium.com/@fruitful2007/building-an-mcp-client-101-lets-build-one-for-a-gemini-chat-agent

pypi.org/project/gemini-tool-agent

一个(可能,笑)强大的MCP(模型上下文协议)客户端,利用谷歌的Gemini AI模型进行智能工具使用和对话处理。

  • 目前测试显示,Claude Desktop 作为 MCP 服务器运行良好。

基于未经测试的AI生成代码,非程序员使用风险自负。

特色

  • 多款双子座机型:支持多种双子座机型(2.0闪存、2.5 pro、1.5 pro等)
  • 灵活包支持:支持gemini-tool-agent、google-generativeai或google-genai包
  • 运行时模型切换:在对话中更换模型
  • 服务器配置管理:存储和管理MCP服务器配置
  • 智能工具使用:AI驱动的工具发现与执行
  • 异步/等待支持:高效的并发操作
  • 全面错误处理:稳健的错误恢复与日志记录
  • 类型提示:现代Python实践,实现完整的类型安全

使用代理目录中的“adk web”——修改代理。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Gemini Client

Credit to and started from- medium.com/@fruitful2007/building-an-mcp-client-101-lets-build-one-for-a-gemini-chat-agent

pypi.org/project/gemini-tool-agent

A (potentially, lol) powerful MCP (Model Context Protocol) client that uses Google’s Gemini AI models for intelligent tool usage and conversation handling.

  • Tested working nicely with Claude Desktop as an MCP Server currently.

Based on untested AI gen code by a non-coder use at own risk.

Features

  • Multiple Gemini Models: Support for various Gemini models (2.0-flash, 2.5-pro, 1.5-pro, etc.)
  • Flexible Package Support: Works with gemini-tool-agent, google-generativeai, or google-genai packages
  • Runtime Model Switching: Change models during conversation
  • Server Configuration Management: Store and manage MCP server configurations
  • Intelligent Tool Usage: AI-powered tool discovery and execution
  • Async/await Support: Efficient concurrent operations
  • Comprehensive Error Handling: Robust error recovery and logging
  • Type Hints: Modern Python practices with full type safety

Using “adk web” from agents directory- alter the agent.py paths to your own for simple Gemini mcp use for now until I get a better setup. full_mcp_agent-README.md

google agent framework report text

Installation

📋 Easy Installation Instructions Here’s the correct way to set it up with Claude- maybe, You may need to install this if not working properly:

  • cd /gemini-mcp-client && uv add google-generativeai

Doesn’t throw an error and works great for chat, not sure about Gemini MCP use. Just edit in your paths and use this config in Claude Desktop:

{
  "mcpServers": {
    "gemini-ai": {
      "command": "uv",
      "args": [
        "--directory",
        "/home/ty/Repositories/ai_workspace/gemini-mcp-client",
        "run",
        "python",
        "servers/gemini_mcp_server.py"
      ],
      "env": {
        "GEMINI_API_KEY": "your_gemini_api_key_here"
      }
    },
    "echo-server": {
      "command": "uv",
      "args": [
        "--directory",
        "/home/ty/Repositories/ai_workspace/gemini-mcp-client",
        "run",
        "python",
        "examples/echo_server.py"
      ]
    }
  }
}

Installation outside of Claude if someone wants to try it and maybe develop a Standalone UI for Gemini with MCP Tools!:

  • possibly hallucinatory

This project uses uv for dependency management. Make sure you have uv installed.

Setting up the environment

# Create and activate virtual environment
uv venv --python 3.12 --seed
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "gemini-ai": { "command": "uv", "args": [ "--directory", "/home/ty/Repositories/ai_workspace/gemini-mcp-client", "run", "python", "servers/gemini_mcp_server.py" ], "env": { "GEMINI_API_KEY": "your_gemini_api_key_here" } }, "echo-server": { "command": "uv", "args": [ "--directory", "/home/ty/Repositories/ai_workspace/gemini-mcp-client", "run", "python", "examples/echo_server.py" ] } } }