Gemini

io.github.PavelGuzenfeld由 GitHub 帳號 PavelGuzenfeld 發布v0.1.2更新於 Oct 24, 2026

MCP server that exposes Google Gemini as tools for Claude Code

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,將 Google Gemini 模型包裝成工具,讓助理可以提問、分析程式碼並進行多輪對話。

可以做什麼
  • 向 Gemini 提問或交付一項任務
  • 依指定指令把程式碼或文字交給 Gemini 分析
  • 進行保留完整歷史紀錄的多輪對話
  • 列出可用的 Gemini 模型,並針對單次呼叫覆寫模型
適用情境
適合需要另一個模型提供第二意見、對程式碼或長文本做大上下文分析、從不同角度進行程式碼審查,或在不離開助理的情況下快速摘要日誌的情境。
執行需求
以本機 Node.js 程序執行,可透過複製儲存庫或 npx 安裝。需要 Google AI Studio 的 API 金鑰,透過 GEMINI_API_KEY 環境變數提供;選用的 GEMINI_MODEL 變數可設定預設模型。需要能連線至 Google 的生成式語言 API。
安裝前請注意
API 金鑰以明文寫在用戶端設定檔中,請妥善保管該檔案。送給工具的問題、程式碼與文字會以第三方資料形式傳送至 Google 的 Gemini API。使用情形可能受 Google 的配額與計費條款限制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Gemini,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

gemini-mcp

[npm] [MCP Registry] [Node.js] [License: MIT]

Lightweight MCP server that exposes Google Gemini as tools for Claude Code (or any MCP client).

Use Gemini for second opinions, large-context analysis, code review, or anything where a different model perspective helps.

Tools

ToolDescription
gemini_askAsk Gemini a question or give it a task
gemini_analyzeSend code/text for analysis with a specific instruction
gemini_chatMulti-turn conversation with full history
gemini_modelsList available Gemini models

Quick Start

1. Get an API key

Go to Google AI Studio and create a free API key.

2. Install

Option A — Clone (recommended for Claude Code)

bash
git clone https://github.com/PavelGuzenfeld/gemini-mcp.git ~/.claude/mcp-servers/geminicd ~/.claude/mcp-servers/gemininpm install

Option B — npx (no install)

bash
npx claude-gemini-mcp

3. Register with Claude Code

Add to ~/.claude/settings.json:

json
{  "mcpServers": {    "gemini": {      "command": "node",      "args": ["/home/you/.claude/mcp-servers/gemini/index.js"],      "env": {        "GEMINI_API_KEY": "your-key-here"      }    }  }}

Or with npx:

json
{  "mcpServers": {    "gemini": {      "command": "npx",      "args": ["-y", "claude-gemini-mcp"],      "env": {        "GEMINI_API_KEY": "your-key-here"      }    }  }}

Usage Examples

Ask a question

> Use gemini_ask to explain the difference between std::expected and std::optional
Gemini says: std::optional<T> represents a value that may or may not be present...std::expected<T, E> additionally carries an error value when the expected value is absent...

Analyze code

> Use gemini_analyze to review this function for performance issues:  instruction: "Find performance bottlenecks"  content: <your code here>
Gemini says: Line 12 allocates inside the loop — move the vector outside...

Multi-turn conversation

> Use gemini_chat with messages:  [{"role": "user", "content": "Design a REST API for a task manager"},   {"role": "model", "content": "Here's a RESTful design..."},   {"role": "user", "content": "Now add authentication"}]
Gemini says: Building on the previous design, add JWT-based auth...

Override model per call

> Use gemini_ask with model: "gemini-2.5-flash" to quickly summarize this error log

Environment Variables

VariableDefaultDescription
GEMINI_API_KEY(required)Google AI Studio API key
GEMINI_MODELgemini-2.5-proDefault model for all tools

Models

ModelBest for
gemini-2.5-proBest quality, large context (1M tokens)
gemini-2.5-flashFast, good for most tasks
gemini-2.0-flashFastest, simple tasks

Every tool accepts an optional model parameter to override the default per-call.

Features

  • Retry with exponential backoff on rate limits (429) and server errors (5xx)
  • Graceful error reporting back to the MCP client (no crashes)
  • Per-call model override
  • Zero configuration beyond the API key

Troubleshooting

ProblemSolution
GEMINI_API_KEY is not setAdd the key to your env block in settings.json
429 Too Many RequestsBuilt-in retry handles this — wait a few seconds
Model not foundRun gemini_models to list valid model names
Tools not appearing in Claude CodeCheck ~/.claude/settings.json syntax, restart Claude Code
ECONNREFUSEDCheck network/firewall — the server calls generativelanguage.googleapis.com

Development

bash
git clone https://github.com/PavelGuzenfeld/gemini-mcp.gitcd gemini-mcpnpm installnpm test          # Run smoke testsnode index.js     # Start the MCP server locally

License

MIT

來源:README.md,提交 5532298

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分