Skip to content
Back to search

mcp-gemini-cli

SkillWorks with Gemini CLIGitHub

A simple MCP server wrapper for Google's Gemini CLI that enables AI assistants to use Gemini's capabilities through the Model Context Protocol.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/choplin--mcp-gemini-cli/badge.svg)](/listings/choplin--mcp-gemini-cli)

HTML

<a href="/listings/choplin--mcp-gemini-cli"><img src="/api/listings/choplin--mcp-gemini-cli/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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"

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 242 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP Gemini CLI
  2. A simple MCP server wrapper for Google's Gemini CLI that enables AI assistants to use Gemini's capabilities through the Model Context Protocol.
  3. ## What it does
  4. This server exposes three tools that interact with Gemini CLI:
  5. - `googleSearch`: Asks Gemini to perform a Google search using your query
  6. - `chat`: Sends prompts directly to Gemini for general conversations
  7. - `analyzeFile`: Analyzes files (images, PDFs, text) using Gemini's multimodal capabilities
  8. ## Prerequisites
  9. - [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed and configured (optional with --allow-npx flag)
  10. ## 🚀 Quick Start with Claude Code
  11. ### 1. Add the MCP server
  12. ```bash
  13. claude mcp add -s project gemini-cli -- npx mcp-gemini-cli --allow-npx
  14. ```
  15. Or configure your MCP client with the settings shown in the Installation Options section below.
  16. ### 2. Try it out
  17. Example prompts:
  18. - **Search**: "Search for the latest TypeScript 5.0 features using Google"
  19. - **Chat**: "Ask Gemini to explain the difference between async/await and promises in JavaScript"
  20. - **File Analysis**: "Ask Gemini to analyze the image at /path/to/screenshot.png"
  21. ## 🔧 Installation Options
  22. ### Using npx with --allow-npx flag
  23. ```json
  24. {
  25. "mcpServers": {
  26. "mcp-gemini-cli": {
  27. "command": "npx",
  28. "args": ["mcp-gemini-cli", "--allow-npx"]
  29. }
  30. }
  31. }
  32. ```
  33. ### Local Development
  34. 1. Clone and install:
  35. ```bash
  36. git clone https://github.com/choplin/mcp-gemini-cli
  37. cd mcp-gemini-cli
  38. bun install
  39. ```
  40. 1. Add to Claude Desktop config:
  41. ```json
  42. {
  43. "mcpServers": {
  44. "mcp-gemini-cli": {
  45. "command": "bun",
  46. "args": ["run", "/path/to/mcp-gemini-cli/index.ts"]
  47. }
  48. }
  49. }
  50. ```
  51. ## 🛠️ Available Tools
  52. ### 1. googleSearch
  53. Performs a Google search using Gemini CLI.
  54. **Parameters:**
  55. - `query` (required): The search query
  56. - `limit` (optional): Maximum number of results
  57. - `sandbox` (optional): Run in sandbox mode
  58. - `yolo` (optional): Skip confirmations
  59. - `model` (optional): Gemini model to use (default: "gemini-2.5-pro")
  60. ### 2. chat
  61. Have a conversation with Gemini.
  62. **Parameters:**
  63. - `prompt` (required): The conversation prompt
  64. - `sandbox` (optional): Run in sandbox mode
  65. - `yolo` (optional): Skip confirmations
  66. - `model` (optional): Gemini model to use (default: "gemini-2.5-pro")
  67. ### 3. analyzeFile
  68. Analyze files using Gemini's multimodal capabilities.
  69. **Supported file types:**
  70. - **Images**: PNG, JPG, JPEG, GIF, WEBP, SVG, BMP
  71. - **Text**: TXT, MD, TEXT
  72. - **Documents**: PDF
  73. **Parameters:**
  74. - `filePath` (required): The absolute path to the file to analyze
  75. - `prompt` (optional): Additional instructions for analyzing the file
  76. - `sandbox` (optional): Run in sandbox mode
  77. - `yolo` (optional): Skip confirmations
  78. - `model` (optional): Gemini model to use (default: "gemini-2.5-pro")
  79. ## 💡 Example Prompts
  80. Try these prompts to see mcp-gemini-cli in action:
  81. - **Search**: "Search for the latest TypeScript 5.0 features using Google"
  82. - **Chat**: "Ask Gemini to explain the difference between async/await and promises in JavaScript"
  83. - **File Analysis**: "Ask Gemini to describe what's in this image: /Users/me/Desktop/screenshot.png"
  84. ## 🛠️ Example Usage
  85. ### googleSearch
  86. ```typescript
  87. // Simple search
  88. googleSearch({ query: "latest AI news" });
  89. // Search with limit
  90. googleSearch({
  91. query: "TypeScript best practices",
  92. limit: 5,
  93. });
  94. ```
  95. ### chat
  96. ```typescript
  97. // Simple chat
  98. chat({ prompt: "Explain quantum computing in simple terms" });
  99. // Using a different model
  100. chat({
  101. prompt: "Write a haiku about programming",
  102. model: "gemini-2.5-flash",
  103. });
  104. ```
  105. ### analyzeFile
  106. ```typescript
  107. // Analyze an image
  108. analyzeFile({
  109. filePath: "/path/to/image.png",
  110. prompt: "What objects are in this image?"
  111. });
  112. // Analyze a PDF
  113. analyzeFile({
  114. filePath: "/path/to/document.pdf",
  115. prompt: "Summarize the key points in this document"
  116. });
  117. // General analysis without specific instructions
  118. analyzeFile({ filePath: "/path/to/file.jpg" });
  119. ```
  120. ## 📝 Development
  121. > **Note**: Development requires [Bun](https://bun.sh) runtime.
  122. ### Run in Development Mode
  123. ```bash
  124. bun run dev
  125. ```
  126. ### Run Tests
  127. ```bash
  128. bun test
  129. ```
  130. ### Build for Production
  131. ```bash
  132. # Development build
  133. bun run build
  134. # Production build (minified)
  135. bun run build:prod
  136. ```
  137. ### Linting & Formatting
  138. ```bash
  139. # Lint code
  140. bun run lint
  141. # Format code
  142. bun run format
  143. ```
  144. ## 🤝 Contributing
  145. Contributions are welcome! Please feel free to submit a Pull Request.
  146. ## 📄 License
  147. This project is licensed under the MIT License - see the LICENSE file for details.
  148. ## 📋 Changelog
  149. ### [0.3.1] - 2025-07-03
  150. #### Fixed
  151. - Fixed Windows compatibility issue with `which` command
  152. ### [0.3.0] - 2025-07-02
  153. #### Breaking Changes
  154. - Tool names: `geminiChat` → `chat`, `geminiAnalyzeFile` → `analyzeFile`
  155. - Package name: `@choplin/mcp-gemini-cli` → `mcp-gemini-cli`
  156. #### New Features
  157. - `analyzeFile` tool for images (PNG/JPG/GIF/etc), PDFs, and text files
  158. ### [0.2.0] - Previous
  159. - Initial release with `googleSearch` and `geminiChat` tools
  160. ## 🔗 Related Links
  161. - [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
  162. - [Gemini CLI](https://github.com/google-gemini/gemini-cli)
  163. - [Bun Runtime](https://bun.sh)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.