
choplin/mcp-gemini-cli 是从 https://github.com/choplin/mcp-gemini-cli. 导入的 MCP 服务器候选。
概览
choplin/mcp-gemini-cli 是从 https://github.com/choplin/mcp-gemini-cli. 导入的 MCP 服务器候选。
概述(AI 翻译)
一个简单的 MCP 服务器封装器,用于 Google Gemini CLI,使 AI 助手能够通过模型上下文协议使用 Gemini 的功能。
它的作用
该服务器展示了三个与 Gemini CLI 交互的工具:
googleSearch:请求双子座用你的查询进行谷歌搜索chat:直接向双子座发送提示,进行一般对话analyzeFile:利用 Gemini 的多模态功能分析文件(图片、PDF、文本)
先修条件
- Gemini CLI安装并配置(可选,带 --allow-npx 标志)
🚀 克劳德代码快速入门
1.添加MCP服务器
或者用下面安装选项部分的设置配置你的MCP客户端。
2.试试看吧
示例提示:
- Search:“使用 Google 搜索最新的 TypeScript 5.0 功能”
- Chat:“请让Gemini解释JavaScript中异步/等待和promise的区别”
- 文件分析:“让Gemini分析/path/to/screenshot.png的图像”
🔧 安装选项
使用 npx 带 --allow-npx 标志
地方发展
-
克隆与安装:
-
添加到Claude桌面配置:
🛠️ 可用工具
1.谷歌搜索
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Gemini CLI
A simple MCP server wrapper for Google’s Gemini CLI that enables AI assistants to use Gemini’s capabilities through the Model Context Protocol.
What it does
This server exposes three tools that interact with Gemini CLI:
googleSearch: Asks Gemini to perform a Google search using your querychat: Sends prompts directly to Gemini for general conversationsanalyzeFile: Analyzes files (images, PDFs, text) using Gemini’s multimodal capabilities
Prerequisites
- Gemini CLI installed and configured (optional with --allow-npx flag)
🚀 Quick Start with Claude Code
1. Add the MCP server
claude mcp add -s project gemini-cli -- npx mcp-gemini-cli --allow-npx
Or configure your MCP client with the settings shown in the Installation Options section below.
2. Try it out
Example prompts:
- Search: “Search for the latest TypeScript 5.0 features using Google”
- Chat: “Ask Gemini to explain the difference between async/await and promises in JavaScript”
- File Analysis: “Ask Gemini to analyze the image at /path/to/screenshot.png”
🔧 Installation Options
Using npx with --allow-npx flag
{
"mcpServers": {
"mcp-gemini-cli": {
"command": "npx",
"args": ["mcp-gemini-cli", "--allow-npx"]
}
}
}
Local Development
- Clone and install:
git clone https://github.com/choplin/mcp-gemini-cli
cd mcp-gemini-cli
bun install
- Add to Claude Desktop config:
{
"mcpServers": {
"mcp-gemini-cli": {
"command": "bun",
"args": ["run", "/path/to/mcp-gemini-cli/index.ts"]
}
}
}
🛠️ Available Tools
1. googleSearch
Performs a Google search using Gemini CLI.
Parameters:
query(required): The search querylimit(optional): Maximum number of resultssandbox(optional): Run in sandbox modeyolo(optional): Skip confirmationsmodel(optional): Gemini model to use (default: “gemini-2.5-pro”)
2. chat
Have a conversation with Gemini.
Parameters:
prompt(required): The conversation promptsandbox(optional): Run in sandbox modeyolo(optional): Skip confirmationsmodel(optional): Gemini model to use (default: “gemini-2.5-pro”)
3. analyzeFile
Analyze files using Gemini’s multimodal capabilities.
Supported file types:
- Images: PNG, JPG, JPEG, GIF, WEBP, SVG, BMP
- Text: TXT, MD, TEXT
- Documents: PDF
Parameters:
filePath(required): The absolute path to the file to analyzeprompt(optional): Additional instructions for analyzing the filesandbox(optional): Run in sandbox modeyolo(optional): Skip confirmationsmodel(optional): Gemini model to use (default: “gemini-2.5-pro”)
💡 Example Prompts
Try these prompts to see mcp-gemini-cli in action:
- Search: “Search for the latest TypeScript 5.0 features using Google”
安装
npx mcp-gemini-cli --allow-npx配置
{
"mcpServers": {
"mcp-gemini-cli": {
"command": "npx",
"args": ["mcp-gemini-cli", "--allow-npx"]
}
}
}