@houtini/gemini-mcp 1.4.5 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +316 -834
  2. package/claude_desktop_config_example.json +1 -0
  3. package/dist/config/index.d.ts.map +1 -1
  4. package/dist/config/index.js +8 -4
  5. package/dist/config/index.js.map +1 -1
  6. package/dist/config/types.d.ts +5 -0
  7. package/dist/config/types.d.ts.map +1 -1
  8. package/dist/image-viewer/image-viewer-app.html +180 -0
  9. package/dist/image-viewer/src/ui/image-viewer.html +142 -0
  10. package/dist/index-new.d.ts +3 -0
  11. package/dist/index-new.d.ts.map +1 -0
  12. package/dist/index-new.js +7 -0
  13. package/dist/index-new.js.map +1 -0
  14. package/dist/index.d.ts +3 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +70 -172
  17. package/dist/index.js.map +1 -1
  18. package/dist/landing-page-viewer/src/ui/landing-page-viewer.html +147 -0
  19. package/dist/services/gemini/export.d.ts +5 -0
  20. package/dist/services/gemini/export.d.ts.map +1 -0
  21. package/dist/services/gemini/export.js +5 -0
  22. package/dist/services/gemini/export.js.map +1 -0
  23. package/dist/services/gemini/image-service.d.ts +45 -0
  24. package/dist/services/gemini/image-service.d.ts.map +1 -0
  25. package/dist/services/gemini/image-service.js +248 -0
  26. package/dist/services/gemini/image-service.js.map +1 -0
  27. package/dist/services/gemini/index.d.ts +7 -2
  28. package/dist/services/gemini/index.d.ts.map +1 -1
  29. package/dist/services/gemini/index.js +132 -56
  30. package/dist/services/gemini/index.js.map +1 -1
  31. package/dist/services/gemini/types.d.ts +32 -0
  32. package/dist/services/gemini/types.d.ts.map +1 -1
  33. package/dist/services/gemini/video-service.d.ts +58 -0
  34. package/dist/services/gemini/video-service.d.ts.map +1 -0
  35. package/dist/services/gemini/video-service.js +325 -0
  36. package/dist/services/gemini/video-service.js.map +1 -0
  37. package/dist/services/media-server.d.ts +28 -0
  38. package/dist/services/media-server.d.ts.map +1 -0
  39. package/dist/services/media-server.js +195 -0
  40. package/dist/services/media-server.js.map +1 -0
  41. package/dist/svg-viewer/src/ui/svg-viewer.html +138 -0
  42. package/dist/tools/gemini-chat.d.ts.map +1 -1
  43. package/dist/tools/gemini-chat.js +7 -1
  44. package/dist/tools/gemini-chat.js.map +1 -1
  45. package/dist/tools/gemini-deep-research.d.ts +1 -2
  46. package/dist/tools/gemini-deep-research.d.ts.map +1 -1
  47. package/dist/tools/gemini-deep-research.js +12 -52
  48. package/dist/tools/gemini-deep-research.js.map +1 -1
  49. package/dist/tools/gemini-help.d.ts +3 -0
  50. package/dist/tools/gemini-help.d.ts.map +1 -0
  51. package/dist/tools/gemini-help.js +534 -0
  52. package/dist/tools/gemini-help.js.map +1 -0
  53. package/dist/tools/gemini-prompt-assistant.d.ts +20 -0
  54. package/dist/tools/gemini-prompt-assistant.d.ts.map +1 -0
  55. package/dist/tools/gemini-prompt-assistant.js +129 -0
  56. package/dist/tools/gemini-prompt-assistant.js.map +1 -0
  57. package/dist/tools/generate-landing-page.d.ts +15 -0
  58. package/dist/tools/generate-landing-page.d.ts.map +1 -0
  59. package/dist/tools/generate-landing-page.js +66 -0
  60. package/dist/tools/generate-landing-page.js.map +1 -0
  61. package/dist/tools/generate-svg.d.ts +14 -0
  62. package/dist/tools/generate-svg.d.ts.map +1 -0
  63. package/dist/tools/generate-svg.js +106 -0
  64. package/dist/tools/generate-svg.js.map +1 -0
  65. package/dist/tools/generate-video.d.ts +24 -0
  66. package/dist/tools/generate-video.d.ts.map +1 -0
  67. package/dist/tools/generate-video.js +163 -0
  68. package/dist/tools/generate-video.js.map +1 -0
  69. package/dist/tools/image-prompt-assistant.d.ts +3 -0
  70. package/dist/tools/image-prompt-assistant.d.ts.map +1 -0
  71. package/dist/tools/image-prompt-assistant.js +790 -0
  72. package/dist/tools/image-prompt-assistant.js.map +1 -0
  73. package/dist/tools/load-image-from-path.d.ts +11 -0
  74. package/dist/tools/load-image-from-path.d.ts.map +1 -0
  75. package/dist/tools/load-image-from-path.js +100 -0
  76. package/dist/tools/load-image-from-path.js.map +1 -0
  77. package/dist/tools/prompt-library/charts.d.ts +325 -0
  78. package/dist/tools/prompt-library/charts.d.ts.map +1 -0
  79. package/dist/tools/prompt-library/charts.js +384 -0
  80. package/dist/tools/prompt-library/charts.js.map +1 -0
  81. package/dist/tools/prompt-library/index.d.ts +8 -0
  82. package/dist/tools/prompt-library/index.d.ts.map +1 -0
  83. package/dist/tools/prompt-library/index.js +10 -0
  84. package/dist/tools/prompt-library/index.js.map +1 -0
  85. package/dist/tools/register-analyze-image.d.ts +3 -0
  86. package/dist/tools/register-analyze-image.d.ts.map +1 -0
  87. package/dist/tools/register-analyze-image.js +67 -0
  88. package/dist/tools/register-analyze-image.js.map +1 -0
  89. package/dist/tools/register-chat.d.ts +3 -0
  90. package/dist/tools/register-chat.d.ts.map +1 -0
  91. package/dist/tools/register-chat.js +71 -0
  92. package/dist/tools/register-chat.js.map +1 -0
  93. package/dist/tools/register-deep-research.d.ts +3 -0
  94. package/dist/tools/register-deep-research.d.ts.map +1 -0
  95. package/dist/tools/register-deep-research.js +59 -0
  96. package/dist/tools/register-deep-research.js.map +1 -0
  97. package/dist/tools/register-describe-image.d.ts +3 -0
  98. package/dist/tools/register-describe-image.d.ts.map +1 -0
  99. package/dist/tools/register-describe-image.js +59 -0
  100. package/dist/tools/register-describe-image.js.map +1 -0
  101. package/dist/tools/register-image-gen.d.ts +3 -0
  102. package/dist/tools/register-image-gen.d.ts.map +1 -0
  103. package/dist/tools/register-image-gen.js +235 -0
  104. package/dist/tools/register-image-gen.js.map +1 -0
  105. package/dist/tools/register-landing-page.d.ts +3 -0
  106. package/dist/tools/register-landing-page.d.ts.map +1 -0
  107. package/dist/tools/register-landing-page.js +79 -0
  108. package/dist/tools/register-landing-page.js.map +1 -0
  109. package/dist/tools/register-list-models.d.ts +3 -0
  110. package/dist/tools/register-list-models.d.ts.map +1 -0
  111. package/dist/tools/register-list-models.js +33 -0
  112. package/dist/tools/register-list-models.js.map +1 -0
  113. package/dist/tools/register-load-image.d.ts +3 -0
  114. package/dist/tools/register-load-image.d.ts.map +1 -0
  115. package/dist/tools/register-load-image.js +66 -0
  116. package/dist/tools/register-load-image.js.map +1 -0
  117. package/dist/tools/register-svg.d.ts +3 -0
  118. package/dist/tools/register-svg.d.ts.map +1 -0
  119. package/dist/tools/register-svg.js +84 -0
  120. package/dist/tools/register-svg.js.map +1 -0
  121. package/dist/tools/register-video.d.ts +3 -0
  122. package/dist/tools/register-video.d.ts.map +1 -0
  123. package/dist/tools/register-video.js +118 -0
  124. package/dist/tools/register-video.js.map +1 -0
  125. package/dist/tools/register-viewers.d.ts +8 -0
  126. package/dist/tools/register-viewers.d.ts.map +1 -0
  127. package/dist/tools/register-viewers.js +89 -0
  128. package/dist/tools/register-viewers.js.map +1 -0
  129. package/dist/tools/schemas.d.ts +33 -0
  130. package/dist/tools/schemas.d.ts.map +1 -0
  131. package/dist/tools/schemas.js +39 -0
  132. package/dist/tools/schemas.js.map +1 -0
  133. package/dist/tools/types.d.ts +12 -0
  134. package/dist/tools/types.d.ts.map +1 -0
  135. package/dist/tools/types.js +2 -0
  136. package/dist/tools/types.js.map +1 -0
  137. package/dist/ui/image-viewer.d.ts +2 -0
  138. package/dist/ui/image-viewer.d.ts.map +1 -0
  139. package/dist/ui/image-viewer.js +42 -0
  140. package/dist/ui/image-viewer.js.map +1 -0
  141. package/dist/utils/chart-design-system.d.ts +92 -0
  142. package/dist/utils/chart-design-system.d.ts.map +1 -0
  143. package/dist/utils/chart-design-system.js +235 -0
  144. package/dist/utils/chart-design-system.js.map +1 -0
  145. package/dist/utils/image-compress.d.ts +9 -0
  146. package/dist/utils/image-compress.d.ts.map +1 -0
  147. package/dist/utils/image-compress.js +43 -0
  148. package/dist/utils/image-compress.js.map +1 -0
  149. package/dist/utils/image-utils.d.ts +9 -0
  150. package/dist/utils/image-utils.d.ts.map +1 -0
  151. package/dist/utils/image-utils.js +257 -0
  152. package/dist/utils/image-utils.js.map +1 -0
  153. package/dist/utils/resolve-images.d.ts +29 -0
  154. package/dist/utils/resolve-images.d.ts.map +1 -0
  155. package/dist/utils/resolve-images.js +56 -0
  156. package/dist/utils/resolve-images.js.map +1 -0
  157. package/dist/utils/tool-wrapper.d.ts +13 -0
  158. package/dist/utils/tool-wrapper.d.ts.map +1 -0
  159. package/dist/utils/tool-wrapper.js +22 -0
  160. package/dist/utils/tool-wrapper.js.map +1 -0
  161. package/dist/utils/video-utils.d.ts +16 -0
  162. package/dist/utils/video-utils.d.ts.map +1 -0
  163. package/dist/utils/video-utils.js +319 -0
  164. package/dist/utils/video-utils.js.map +1 -0
  165. package/dist/video-viewer/src/ui/video-viewer.html +137 -0
  166. package/package.json +21 -7
  167. package/server.json +30 -29
package/README.md CHANGED
@@ -1,834 +1,316 @@
1
- # Gemini MCP Server
2
-
3
- [![npm version](https://img.shields.io/npm/v/@houtini/gemini-mcp.svg?style=flat-square)](https://www.npmjs.com/package/@houtini/gemini-mcp)
4
- [![Known Vulnerabilities](https://snyk.io/test/github/houtini-ai/gemini-mcp/badge.svg)](https://snyk.io/test/github/houtini-ai/gemini-mcp)
5
- [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue?style=flat-square)](https://registry.modelcontextprotocol.io)
6
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0)
7
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/)
8
- [![MCP](https://img.shields.io/badge/MCP-Compatible-green?style=flat-square)](https://modelcontextprotocol.io)
9
-
10
- A production-ready Model Context Protocol server for Google's Gemini AI models. I've built this with TypeScript and the latest MCP SDK (1.25.3), focusing on real-world reliability rather than feature bloat.
11
-
12
- ## What This Does
13
-
14
- This server connects Claude Desktop (or any MCP client) to Google's Gemini models. The integration is straightforward: chat with Gemini, get model information, and run deep research tasks with Google Search grounding built in.
15
-
16
- What I think matters here: the server discovers available models automatically from Google's API, which means you're always working with the latest releases without updating configuration files. No hardcoded model lists that go stale.
17
-
18
- ## Quick Start
19
-
20
- The simplest way to use this is with `npx` - no installation required:
21
-
22
- ```bash
23
- # Get your API key from Google AI Studio first
24
- # https://makersuite.google.com/app/apikey
25
-
26
- # Test it works (optional)
27
- npx @houtini/gemini-mcp
28
-
29
- # Add to Claude Desktop (configuration below)
30
- ```
31
-
32
- ## Installation Options
33
-
34
- ### Recommended: npx (No Installation)
35
-
36
- ```bash
37
- npx @houtini/gemini-mcp
38
- ```
39
-
40
- This approach pulls the latest version automatically. I prefer this because you don't clutter your system with global packages, and updates happen transparently.
41
-
42
- ### Alternative: Global Installation
43
-
44
- ```bash
45
- npm install -g @houtini/gemini-mcp
46
- gemini-mcp
47
- ```
48
-
49
- ### Alternative: Local Project
50
-
51
- ```bash
52
- npm install @houtini/gemini-mcp
53
- npx @houtini/gemini-mcp
54
- ```
55
-
56
- ### From Source (Developers)
57
-
58
- ```bash
59
- git clone https://github.com/houtini-ai/gemini-mcp.git
60
- cd gemini-mcp
61
- npm install
62
- npm run build
63
- npm start
64
- ```
65
-
66
- ## Configuration
67
-
68
- ### Step 1: Get Your API Key
69
-
70
- Visit [Google AI Studio](https://makersuite.google.com/app/apikey) to create a free API key. This takes about 30 seconds.
71
-
72
- ### Step 2: Configure Claude Desktop
73
-
74
- Add this to your Claude Desktop config file:
75
-
76
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
77
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
78
-
79
- #### Using npx (Recommended)
80
-
81
- ```json
82
- {
83
- "mcpServers": {
84
- "gemini": {
85
- "command": "npx",
86
- "args": ["@houtini/gemini-mcp"],
87
- "env": {
88
- "GEMINI_API_KEY": "your-api-key-here"
89
- }
90
- }
91
- }
92
- }
93
- ```
94
-
95
- #### Using Global Installation
96
-
97
- ```json
98
- {
99
- "mcpServers": {
100
- "gemini": {
101
- "command": "gemini-mcp",
102
- "env": {
103
- "GEMINI_API_KEY": "your-api-key-here"
104
- }
105
- }
106
- }
107
- }
108
- ```
109
-
110
- Requires `npm install -g @houtini/gemini-mcp` first.
111
-
112
- #### Using Local Build
113
-
114
- ```json
115
- {
116
- "mcpServers": {
117
- "gemini": {
118
- "command": "node",
119
- "args": ["./node_modules/@houtini/gemini-mcp/dist/index.js"],
120
- "env": {
121
- "GEMINI_API_KEY": "your-api-key-here"
122
- }
123
- }
124
- }
125
- }
126
- ```
127
-
128
- Only works if installed locally in the current directory.
129
-
130
- ### Step 3: Restart Claude Desktop
131
-
132
- After updating the config, restart Claude Desktop. The server loads on startup.
133
-
134
- ### Optional: Additional Configuration
135
-
136
- ```json
137
- {
138
- "mcpServers": {
139
- "gemini": {
140
- "command": "npx",
141
- "args": ["@houtini/gemini-mcp"],
142
- "env": {
143
- "GEMINI_API_KEY": "your-api-key-here",
144
- "LOG_LEVEL": "info",
145
- "GEMINI_ALLOW_EXPERIMENTAL": "false"
146
- }
147
- }
148
- }
149
- }
150
- ```
151
-
152
- **Environment Variables:**
153
-
154
- | Variable | Default | What It Does |
155
- |----------|---------|--------------|
156
- | `GEMINI_API_KEY` | *required* | Your Google AI Studio API key |
157
- | `LOG_LEVEL` | `info` | Logging detail: `debug`, `info`, `warn`, `error` |
158
- | `GEMINI_ALLOW_EXPERIMENTAL` | `false` | Include experimental models (set `true` to enable) |
159
- | `GEMINI_MCP_LOG_FILE` | `false` | Enable file logging (see Logging section below) |
160
- | `DEBUG_MCP` | `false` | Enable console debugging output (stderr) |
161
-
162
- ### Logging Configuration
163
-
164
- By default, the server operates with minimal logging to avoid interfering with MCP stdio communication. File logging is disabled unless explicitly enabled.
165
-
166
- **Enable File Logging:**
167
-
168
- Add `GEMINI_MCP_LOG_FILE=true` to your environment configuration:
169
-
170
- ```json
171
- {
172
- "mcpServers": {
173
- "gemini": {
174
- "command": "npx",
175
- "args": ["@houtini/gemini-mcp"],
176
- "env": {
177
- "GEMINI_API_KEY": "your-api-key-here",
178
- "GEMINI_MCP_LOG_FILE": "true"
179
- }
180
- }
181
- }
182
- }
183
- ```
184
-
185
- When enabled, logs are written to:
186
- - **Unix/macOS**: `~/.gemini-mcp/logs/`
187
- - **Windows**: `C:\Users\[username]\.gemini-mcp\logs\`
188
-
189
- Log files:
190
- - `error.log` - Error level messages only
191
- - `combined.log` - All log levels
192
- - Maximum 5MB per file, 5 files retained
193
-
194
- **Debug Mode:**
195
-
196
- For development or troubleshooting, enable console output (stderr):
197
-
198
- ```json
199
- {
200
- "env": {
201
- "GEMINI_API_KEY": "your-api-key-here",
202
- "DEBUG_MCP": "true"
203
- }
204
- }
205
- ```
206
-
207
- This outputs to stderr to avoid corrupting MCP stdio communication.
208
-
209
- ## Dynamic Model Discovery
210
-
211
- The server automatically discovers available Gemini models from Google's API on first use. This happens transparently - you don't need to configure anything.
212
-
213
- ### How It Works
214
-
215
- 1. Server starts instantly with reliable fallback models
216
- 2. First request triggers model discovery from Google's API (adds 1-2 seconds once)
217
- 3. Subsequent requests use the discovered models (no delay)
218
- 4. If discovery fails, fallback models work immediately
219
-
220
- What I've found: this approach keeps you current with Google's releases whilst maintaining instant startup. The server filters to stable production models by default, which avoids experimental model rate limits.
221
-
222
- ### What Gets Discovered
223
-
224
- - All available Gemini models (stable and experimental)
225
- - Accurate context window sizes directly from Google
226
- - Model capabilities and recommended use cases
227
- - Latest releases as soon as Google makes them available
228
-
229
- The default model selection prioritises: stable models over experimental, newest version available, Flash variants for speed, and capability matching for your request type.
230
-
231
- ### Performance Impact
232
-
233
- - Startup: 0ms (instant)
234
- - First request: +1-2 seconds (one-time discovery)
235
- - Subsequent requests: 0ms overhead
236
- - Discovery failure: 0ms (uses fallback immediately)
237
-
238
- Check your logs after first request to see what was discovered:
239
- ```
240
- Models discovered from API (count: 38, defaultModel: gemini-2.5-flash)
241
- ```
242
-
243
- ## Experimental Models
244
-
245
- By default, the server uses stable production models. This ensures reliable performance and avoids Google's stricter rate limits on experimental releases.
246
-
247
- ### Stable vs Experimental
248
-
249
- **Stable Models** (default behaviour):
250
- - Production-ready
251
- - Better rate limits
252
- - Consistent performance
253
- - Examples: `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-2.0-flash`
254
-
255
- **Experimental Models** (opt-in):
256
- - Latest features before stable release
257
- - Stricter rate limits
258
- - Potentially unexpected behaviour
259
- - Can be deprecated quickly
260
- - Examples: `gemini-exp-1206`, `gemini-2.0-flash-thinking-exp`
261
-
262
- ### Enabling Experimental Models
263
-
264
- Set `GEMINI_ALLOW_EXPERIMENTAL=true` in your configuration:
265
-
266
- ```json
267
- {
268
- "mcpServers": {
269
- "gemini": {
270
- "command": "npx",
271
- "args": ["@houtini/gemini-mcp"],
272
- "env": {
273
- "GEMINI_API_KEY": "your-api-key-here",
274
- "GEMINI_ALLOW_EXPERIMENTAL": "true"
275
- }
276
- }
277
- }
278
- }
279
- ```
280
-
281
- This includes experimental models in discovery and makes them eligible as defaults. You can still explicitly request any model regardless of this setting - the flag only affects which models are used automatically.
282
-
283
- ### When to Enable
284
-
285
- Keep experimental disabled if you need reliable, consistent performance or you're building production applications.
286
-
287
- Enable experimental if you're testing cutting-edge features, doing research, or you understand the rate limit trade-offs.
288
-
289
- ## Usage Examples
290
-
291
- ### Basic Chat
292
-
293
- ```
294
- Can you help me understand quantum computing using Gemini?
295
- ```
296
-
297
- Claude automatically uses the `gemini_chat` tool.
298
-
299
- ### Creative Writing
300
-
301
- ```
302
- Use Gemini to write a short story about artificial intelligence discovering creativity.
303
- ```
304
-
305
- ### Technical Analysis
306
-
307
- ```
308
- Use Gemini Pro to explain the differences between various machine learning algorithms.
309
- ```
310
-
311
- ### Model Selection
312
-
313
- ```
314
- Use Gemini 1.5 Pro to analyse this code and suggest improvements.
315
- ```
316
-
317
- ### Getting Model Information
318
-
319
- ```
320
- Show me all available Gemini models and their capabilities.
321
- ```
322
-
323
- ---
324
-
325
- ## Complete Prompting Guide
326
-
327
- Check the **[Comprehensive Prompting Guide](PROMPTING_GUIDE.md)** for:
328
-
329
- - Advanced prompting techniques
330
- - Model selection strategies
331
- - Parameter tuning (temperature, tokens, system prompts)
332
- - Using Google Search grounding
333
- - Creative workflows and use cases
334
- - Best practices
335
- - Troubleshooting
336
-
337
- **[Read the Prompting Guide](PROMPTING_GUIDE.md)**
338
-
339
- ---
340
-
341
- ## Google Search Grounding
342
-
343
- Google Search grounding is built in and enabled by default. This gives Gemini models access to current web information, which significantly improves accuracy for questions requiring up-to-date data.
344
-
345
- ### What It Does
346
-
347
- When you ask a question that benefits from current information:
348
- 1. Analyses your query to determine if web search helps
349
- 2. Generates relevant search queries automatically
350
- 3. Performs Google searches using targeted queries
351
- 4. Processes results and synthesises information
352
- 5. Provides enhanced response with inline citations
353
- 6. Shows search metadata including queries used
354
-
355
- ### Best Use Cases
356
-
357
- **Current Events & News**
358
- ```
359
- What are the latest developments in AI announced this month?
360
- Recent breakthroughs in quantum computing research?
361
- ```
362
-
363
- **Real-time Data**
364
- ```
365
- Current stock prices for major tech companies
366
- Today's weather forecast for London
367
- ```
368
-
369
- **Recent Developments**
370
- ```
371
- New software releases this week
372
- Latest scientific discoveries in medicine
373
- ```
374
-
375
- **Fact Checking**
376
- ```
377
- Verify recent statements about climate change
378
- Check the latest statistics on global internet usage
379
- ```
380
-
381
- ### Controlling Grounding
382
-
383
- Grounding is enabled by default. Disable it for purely creative or hypothetical responses:
384
-
385
- ```
386
- Use Gemini without web search to write a fictional story about dragons in space.
387
- ```
388
-
389
- For API calls, use the `grounding` parameter:
390
-
391
- ```json
392
- {
393
- "message": "Write a creative story about time travel",
394
- "grounding": false
395
- }
396
- ```
397
-
398
- ### Understanding Grounded Responses
399
-
400
- Grounded responses include source citations and search transparency:
401
-
402
- ```
403
- Sources: (https://example.com/article1) (https://example.com/article2)
404
- Search queries used: latest AI developments 2025, OpenAI GPT-5 release
405
- ```
406
-
407
- What I've found: grounding dramatically reduces hallucinations for factual queries whilst maintaining creative flexibility when you need it.
408
-
409
- ## Deep Research
410
-
411
- The server includes deep research capability that performs iterative multi-step research on complex topics. This synthesises comprehensive reports with proper citations.
412
-
413
- ### How It Works
414
-
415
- Deep research conducts multiple research iterations:
416
-
417
- 1. Initial broad exploration
418
- 2. Gap analysis identifying what's missing
419
- 3. Targeted research into specific areas
420
- 4. Synthesis into comprehensive report
421
- 5. Iteration until thorough coverage
422
-
423
- ### Using Deep Research
424
-
425
- ```
426
- Use Gemini deep research to investigate the impact of quantum computing on cybersecurity.
427
- ```
428
-
429
- With parameters:
430
- ```
431
- Use Gemini deep research with 7 iterations to create a comprehensive report on renewable energy trends, focusing on solar and wind power adoption rates.
432
- ```
433
-
434
- ### Research Parameters
435
-
436
- | Parameter | Type | Default | What It Does |
437
- |-----------|------|---------|--------------|
438
- | `research_question` | string | *required* | The topic to investigate |
439
- | `max_iterations` | integer | 5 | Research cycles (3-10) |
440
- | `focus_areas` | array | - | Specific aspects to emphasise |
441
- | `model` | string | *latest stable* | Which model to use |
442
-
443
- ### Best For
444
-
445
- - Academic research and literature reviews
446
- - Market analysis and competitive intelligence
447
- - Technology trend analysis
448
- - Policy research and impact assessments
449
- - Multi-faceted business problems
450
-
451
- ### Configuring Iterations by Environment
452
-
453
- Different AI environments have different timeout tolerances:
454
-
455
- **Claude Desktop (3-5 iterations recommended)**
456
- - Timeout: ~4 minutes
457
- - Safe maximum: 5 iterations
458
- - Use 3-4 for most tasks
459
-
460
- **Agent SDK / IDEs (7-10 iterations recommended)**
461
- - Timeout: 10+ minutes
462
- - Maximum: 10 iterations
463
- - Use 7-10 for comprehensive research
464
-
465
- **AI Platforms like Cline, Roo-Cline (7-10 iterations)**
466
- - Similar to Agent SDK
467
- - Can handle longer processes
468
-
469
- ### Handling Timeouts
470
-
471
- If you hit timeout or thread limits:
472
-
473
- 1. Reduce iterations (start with 3)
474
- 2. Narrow focus using `focus_areas` parameter
475
- 3. Split complex topics into smaller research tasks
476
- 4. Check which environment you're using
477
-
478
- Example with focused research:
479
- ```
480
- Use Gemini deep research with 3 iterations focusing on cost analysis and market adoption to examine solar panel technology trends.
481
- ```
482
-
483
- Deep research takes several minutes. It's designed for comprehensive analysis rather than quick answers.
484
-
485
- ## API Reference
486
-
487
- ### gemini_chat
488
-
489
- Chat with Gemini models.
490
-
491
- **Parameters:**
492
-
493
- | Parameter | Type | Required | Default | What It Does |
494
- |-----------|------|----------|---------|--------------|
495
- | `message` | string | Yes | - | The message to send |
496
- | `model` | string | No | *Latest stable* | Which model to use |
497
- | `temperature` | number | No | 0.7 | Randomness (0.0-1.0) |
498
- | `max_tokens` | integer | No | 8192 | Maximum response length (1-32768) |
499
- | `system_prompt` | string | No | - | System instruction |
500
- | `grounding` | boolean | No | true | Enable Google Search |
501
-
502
- **Example:**
503
- ```json
504
- {
505
- "message": "What are the latest developments in quantum computing?",
506
- "model": "gemini-1.5-pro",
507
- "temperature": 0.5,
508
- "max_tokens": 1000,
509
- "system_prompt": "You are a technology expert. Provide current information with sources.",
510
- "grounding": true
511
- }
512
- ```
513
-
514
- ### gemini_list_models
515
-
516
- Retrieve information about discovered Gemini models.
517
-
518
- **Parameters:** None required
519
-
520
- **Example:**
521
- ```json
522
- {}
523
- ```
524
-
525
- **Response includes:**
526
- - Model names and display names
527
- - Descriptions of strengths
528
- - Context window sizes from Google
529
- - Recommended use cases
530
-
531
- ### gemini_deep_research
532
-
533
- Conduct iterative multi-step research.
534
-
535
- **Parameters:**
536
-
537
- | Parameter | Type | Required | Default | What It Does |
538
- |-----------|------|----------|---------|--------------|
539
- | `research_question` | string | Yes | - | Topic to research |
540
- | `max_iterations` | integer | No | 5 | Research cycles (3-10) |
541
- | `focus_areas` | array | No | - | Specific areas to emphasise |
542
- | `model` | string | No | *Latest stable* | Model to use |
543
-
544
- **Example:**
545
- ```json
546
- {
547
- "research_question": "Impact of AI on healthcare diagnostics",
548
- "max_iterations": 7,
549
- "focus_areas": ["accuracy improvements", "cost implications", "regulatory challenges"]
550
- }
551
- ```
552
-
553
- ### Available Models
554
-
555
- Models are dynamically discovered from Google's API. Typical available models:
556
-
557
- | Model | Best For | Description |
558
- |-------|----------|-------------|
559
- | **gemini-2.5-flash** | General use | Latest Flash - fast, versatile |
560
- | **gemini-2.5-pro** | Complex reasoning | Latest Pro - advanced capabilities |
561
- | **gemini-2.0-flash** | Speed-optimised | Gemini 2.0 Flash - efficient |
562
- | **gemini-1.5-flash** | Quick responses | Gemini 1.5 Flash - fast |
563
- | **gemini-1.5-pro** | Large context | 2M token context window |
564
-
565
- Use `gemini_list_models` to see exact available models with current context limits.
566
-
567
- ## Development
568
-
569
- ### Building from Source
570
-
571
- ```bash
572
- git clone https://github.com/houtini-ai/gemini-mcp.git
573
- cd gemini-mcp
574
- npm install
575
- npm run build
576
- npm run dev
577
- ```
578
-
579
- ### Scripts
580
-
581
- | Command | What It Does |
582
- |---------|--------------|
583
- | `npm run build` | Compile TypeScript |
584
- | `npm run dev` | Development mode with live reload |
585
- | `npm start` | Run compiled server |
586
- | `npm test` | Run tests |
587
- | `npm run lint` | Check code style |
588
- | `npm run lint:fix` | Fix linting issues |
589
-
590
- ### Project Structure
591
-
592
- ```
593
- src/
594
- ├── config/ # Configuration management
595
- ├── services/ # Business logic
596
- │ └── gemini/ # Gemini API integration
597
- ├── tools/ # MCP tool implementations
598
- ├── utils/ # Logger and error handling
599
- ├── cli.ts # CLI entry
600
- └── index.ts # Main server
601
- ```
602
-
603
- ### Architecture
604
-
605
- The server follows clean, layered architecture:
606
-
607
- 1. CLI Layer - Command-line interface
608
- 2. Server Layer - MCP protocol handling
609
- 3. Tools Layer - MCP tool implementations
610
- 4. Service Layer - Business logic and API integration
611
- 5. Utility Layer - Logging and error handling
612
-
613
- ## Troubleshooting
614
-
615
- ### "GEMINI_API_KEY environment variable not set"
616
-
617
- Check your Claude Desktop configuration includes the API key in the `env` section.
618
-
619
- ### Server Not Appearing in Claude Desktop
620
-
621
- 1. Restart Claude Desktop after configuration changes
622
- 2. Verify config file path:
623
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
624
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
625
- 3. Validate JSON syntax
626
- 4. Test your API key at [Google AI Studio](https://makersuite.google.com/app/apikey)
627
-
628
- ### "Module not found" with npx
629
-
630
- ```bash
631
- # Clear npx cache
632
- npx --yes @houtini/gemini-mcp
633
-
634
- # Or install globally
635
- npm install -g @houtini/gemini-mcp
636
- ```
637
-
638
- ### Node.js Version Issues
639
-
640
- ```bash
641
- # Check version
642
- node --version
643
-
644
- # Should be v18.0.0 or higher
645
- # Update from https://nodejs.org
646
- ```
647
-
648
- ### Debug Mode
649
-
650
- Enable detailed logging:
651
-
652
- ```json
653
- {
654
- "mcpServers": {
655
- "gemini": {
656
- "command": "npx",
657
- "args": ["@houtini/gemini-mcp"],
658
- "env": {
659
- "GEMINI_API_KEY": "your-api-key-here",
660
- "LOG_LEVEL": "debug"
661
- }
662
- }
663
- }
664
- }
665
- ```
666
-
667
- ### Log Files
668
-
669
- Logs are written to:
670
- - Console output (Claude Desktop developer tools)
671
- - `logs/combined.log` - All levels
672
- - `logs/error.log` - Errors only
673
-
674
- ### Testing Your Setup
675
-
676
- Test with these queries:
677
- 1. "Can you list the available Gemini models?"
678
- 2. "Use Gemini to explain photosynthesis."
679
- 3. "Use Gemini 1.5 Pro with temperature 0.9 to write a creative poem about coding."
680
-
681
- ### Performance Tuning
682
-
683
- For better performance:
684
-
685
- - Adjust token limits based on your use case
686
- - Use appropriate models (Flash for speed, Pro for complexity)
687
- - Monitor logs for rate limiting issues
688
- - Set temperature values appropriately (0.7 balanced, 0.3 focused, 0.9 creative)
689
-
690
- ## Contributing
691
-
692
- Contributions welcome. Follow these steps:
693
-
694
- 1. Fork the repository
695
- 2. Create a feature branch: `git checkout -b feature/amazing-feature`
696
- 3. Make your changes and add tests
697
- 4. Run tests: `npm test`
698
- 5. Lint: `npm run lint:fix`
699
- 6. Build: `npm run build`
700
- 7. Commit: `git commit -m 'Add amazing feature'`
701
- 8. Push: `git push origin feature/amazing-feature`
702
- 9. Open a Pull Request
703
-
704
- ### Development Guidelines
705
-
706
- - Follow TypeScript best practices
707
- - Add tests for new functionality
708
- - Update documentation
709
- - Use conventional commit messages
710
- - Maintain backwards compatibility
711
-
712
- ## Technical Details
713
-
714
- ### Migration to MCP SDK 1.25.3
715
-
716
- This server has been migrated to the latest MCP SDK (1.25.3) with ES modules support. Key technical changes:
717
-
718
- **SDK Updates:**
719
- - Migrated from `Server` class to `McpServer` API
720
- - Tool registration uses `registerTool` with Zod validation
721
- - ES modules throughout (`"type": "module"`)
722
- - TypeScript configured for `nodenext` module resolution
723
-
724
- **Compatibility:**
725
- - Node.js 18+ (changed from 24+ for broader compatibility)
726
- - All imports use `.js` extensions for ES module compliance
727
- - Zod schemas for runtime type validation
728
- - Modern MCP protocol implementation
729
-
730
- **Build System:**
731
- - TypeScript compiles to ES2022 modules
732
- - Clean separation between business logic and MCP interface
733
- - Preserved all Gemini API client functionality
734
-
735
- What this means practically: the server now follows modern Node.js and MCP standards, which should prevent compatibility issues with future Claude Desktop updates whilst maintaining all existing functionality.
736
-
737
- ## Licence
738
-
739
- This project is licensed under the Apache 2.0 Licence - see the [LICENSE](LICENSE) file for details.
740
-
741
- ## Disclaimer
742
-
743
- **Use at Your Own Risk**: This software is provided "as is" without warranty. The authors accept no responsibility for damages, data loss, or other issues arising from use.
744
-
745
- **Content Safety**: This server interfaces with Google's Gemini AI models. Whilst content safety settings are implemented, AI-generated content quality cannot be guaranteed. Users are responsible for reviewing AI output before use and ensuring compliance with applicable laws.
746
-
747
- **API Key Security**: Your Google Gemini API key is sensitive. Keep it confidential, don't commit it to version control, rotate if exposed, and manage API usage costs.
748
-
749
- **Data Privacy**: This server processes data through the Model Context Protocol. Avoid sending sensitive or confidential information. Review Google's privacy policy and implement appropriate data handling.
750
-
751
- **Production Use**: Users deploying in production should conduct security audits, implement monitoring, have incident response procedures, and regularly update dependencies.
752
-
753
- **Third-Party Services**: This software relies on external services (Google Gemini API, npm packages). Service availability, pricing, and functionality may change.
754
-
755
- **No Professional Advice**: AI-generated content should not be considered professional advice (legal, medical, financial) without verification by qualified professionals.
756
-
757
- By using this software, you acknowledge these terms and agree to use at your own risk.
758
-
759
- ## Support
760
-
761
- - **GitHub Issues**: [Report bugs or request features](https://github.com/houtini-ai/gemini-mcp/issues)
762
- - **GitHub Discussions**: [Ask questions or share ideas](https://github.com/houtini-ai/gemini-mcp/discussions)
763
-
764
- ## Changelog
765
-
766
- ### v1.3.2 - Node.js 18+ Compatibility & Modern SDK
767
-
768
- **Breaking Changes:** None (all tool interfaces preserved)
769
-
770
- **Technical Updates:**
771
- - Updated to MCP SDK 1.25.3 (from 1.19.1)
772
- - Migrated to ES modules (`"type": "module"`)
773
- - Changed Node.js requirement to >=18.0.0 (from >=24.0.0) for broader compatibility
774
- - Migrated from `Server` to `McpServer` API
775
- - Implemented Zod schema validation for all tools
776
- - Updated TypeScript config to `nodenext` module resolution
777
-
778
- **Fixes:**
779
- - Resolved Node.js v24 ERR_MODULE_NOT_FOUND errors
780
- - Fixed TypeScript compilation with DOM types for fetch API
781
- - All imports now use `.js` extensions for ES module compliance
782
-
783
- **What This Means:**
784
- The server now works reliably with Node.js 18, 20, 22, and 24. All existing functionality preserved - this is purely a technical infrastructure update for better compatibility.
785
-
786
- ### v1.1.0 - Deep Research & Enhanced Discovery
787
-
788
- **New Features:**
789
- - Added deep research capability for iterative analysis
790
- - Enhanced model discovery with better filtering
791
- - Improved default model selection logic
792
- - Better handling of experimental vs stable models
793
-
794
- ### v1.0.4 - Security & Dependencies
795
-
796
- **Updates:**
797
- - Updated @google/generative-ai to v0.24.1
798
- - Updated @modelcontextprotocol/sdk to v1.19.1
799
- - Changed safety settings to BLOCK_MEDIUM_AND_ABOVE
800
- - Added comprehensive disclaimer
801
- - Zero vulnerabilities in dependencies
802
-
803
- ### v1.0.3 - Enhanced Grounding
804
-
805
- **Improvements:**
806
- - Fixed grounding metadata field names
807
- - Enhanced source citation processing
808
- - Improved grounding reliability
809
- - Better error handling for grounding
810
-
811
- ### v1.0.2 - Google Search Grounding
812
-
813
- **New Features:**
814
- - Added Google Search grounding (enabled by default)
815
- - Real-time web search integration
816
- - Source citations in responses
817
- - Configurable grounding parameter
818
-
819
- ### v1.0.0 - Initial Release
820
-
821
- **Core Features:**
822
- - Complete TypeScript rewrite
823
- - Professional modular architecture
824
- - Comprehensive error handling
825
- - Full MCP protocol compliance
826
- - Multiple Gemini model support
827
- - NPM package distribution
828
- - Production-ready build system
829
-
830
- ---
831
-
832
- **Built for the Model Context Protocol community**
833
-
834
- For more about MCP, visit [modelcontextprotocol.io](https://modelcontextprotocol.io)
1
+ # @houtini/gemini-mcp
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@houtini/gemini-mcp.svg?style=flat-square)](https://www.npmjs.com/package/@houtini/gemini-mcp)
4
+ [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue?style=flat-square)](https://registry.modelcontextprotocol.io)
5
+ [![Known Vulnerabilities](https://snyk.io/test/github/houtini-ai/gemini-mcp/badge.svg)](https://snyk.io/test/github/houtini-ai/gemini-mcp)
6
+ ${badge_line}
7
+
8
+ **I've been running this MCP server in my Claude Desktop setup for several months, and it's one of the few I leave enabled permanently.** Not because Gemini replaces Claude -- it doesn't -- but because grounded search, deep research, image generation, and video are things Gemini does well. Having them as tools inside Claude beats switching between browser tabs.
9
+
10
+ Thirteen tools. One `npx` command.
11
+
12
+ ### MCP App previews
13
+
14
+ Generated images and diagrams render inline in Claude Desktop with zoom controls, file paths, and prompt context:
15
+
16
+ | Image generation | SVG / diagram generation |
17
+ |:---:|:---:|
18
+ | ![Image preview in MCP App](image-preview-mcp-app.jpg) | ![Diagram preview in MCP App](diagram-preview-mcp-app.jpg) |
19
+
20
+ ---
21
+
22
+ ## Get started in two minutes
23
+
24
+ **Step 1: Get a Gemini API key**
25
+
26
+ Go to [Google AI Studio](https://aistudio.google.com/apikey) and create one. The free tier covers most development use -- you'll hit rate limits on deep research if you're hammering it, but for day-to-day work it's fine.
27
+
28
+ **Step 2: Add to your Claude Desktop config**
29
+
30
+ Config file locations:
31
+ - Windows: `C:\Users\{username}\AppData\Roaming\Claude\claude_desktop_config.json`
32
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "gemini": {
38
+ "command": "npx",
39
+ "args": ["@houtini/gemini-mcp"],
40
+ "env": {
41
+ "GEMINI_API_KEY": "your-api-key-here"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ **Step 3: Restart Claude Desktop**
49
+
50
+ That's it. The tools show up automatically. `npx` pulls the package on first run -- no separate install.
51
+
52
+ ### Local build instead
53
+
54
+ For development, or if you'd rather not rely on npx:
55
+
56
+ ```bash
57
+ git clone https://github.com/houtini-ai/gemini-mcp
58
+ cd gemini-mcp
59
+ npm install --include=dev
60
+ npm run build
61
+ ```
62
+
63
+ Then point your config at the local build:
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "gemini": {
69
+ "command": "node",
70
+ "args": ["C:/path/to/gemini-mcp/dist/index.js"],
71
+ "env": {
72
+ "GEMINI_API_KEY": "your-api-key-here"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ## What it does
82
+
83
+ ### Chat with Google Search grounding
84
+
85
+ ```
86
+ Use gemini:gemini_chat to ask: "What changed in the MCP spec in the last month?"
87
+ ```
88
+
89
+ Grounding is on by default. Gemini searches Google before answering, so you get current information rather than training data cutoff answers. Sources come back as markdown links.
90
+
91
+ For questions where you want reasoning over live search -- "explain this code" or similar -- set `grounding: false`.
92
+
93
+ Supports `thinking_level` on Gemini 3 models: `high` for maximum reasoning depth, `low` to keep it fast, `medium`/`minimal` on Gemini 3 Flash only.
94
+
95
+ ### Deep research
96
+
97
+ ```
98
+ Use gemini:gemini_deep_research with:
99
+ research_question="What are the current approaches to AI agent memory management?"
100
+ max_iterations=5
101
+ ```
102
+
103
+ Runs multiple grounded search iterations, then synthesises a full report. Takes 2-5 minutes depending on complexity. Worth it for anything where you need comprehensive coverage rather than a quick answer.
104
+
105
+ Set `max_iterations` to 3-4 in Claude Desktop (4-minute tool timeout). In IDEs (Cursor, Windsurf, VS Code) or agent frameworks with longer timeout tolerance, 7-10 iterations produces noticeably better synthesis. Pass `focus_areas` as an array to steer toward specific angles.
106
+
107
+ ### Image generation with search grounding
108
+
109
+ ```
110
+ Use gemini:generate_image with:
111
+ prompt="Stock price chart showing Apple (AAPL) closing prices for the last 5 trading days"
112
+ use_search=true
113
+ aspectRatio="16:9"
114
+ ```
115
+
116
+ Default model is `gemini-3-pro-image-preview` (Nano Banana Pro). Also supports `gemini-2.5-flash-image` for faster generation.
117
+
118
+ When `use_search=true`, Gemini searches Google for current data before generating. Financial and news queries work reliably and return 2-5 grounding sources as markdown links. Weather queries are inconsistent (Gemini API limitation, not a code issue).
119
+
120
+ ### Video generation with Veo 3.1
121
+
122
+ ```
123
+ Use gemini:generate_video with:
124
+ prompt="A close-up shot of a futuristic coffee machine brewing a glowing blue espresso, steam rising dramatically. Cinematic lighting."
125
+ resolution="1080p"
126
+ durationSeconds=8
127
+ ```
128
+
129
+ Uses Google's Veo 3.1 model. Generates 4-8 second videos at up to 4K resolution with native synchronised audio. Processing takes 2-5 minutes -- the tool polls automatically until the video is ready.
130
+
131
+ Options worth knowing about:
132
+ - `aspectRatio` -- `16:9` (landscape, default) or `9:16` (portrait/vertical)
133
+ - `generateAudio` -- on by default, produces dialogue and sound effects matching the prompt
134
+ - `sampleCount` -- generate up to 4 variations in one call
135
+ - `seed` -- for deterministic output across runs
136
+ - `generateThumbnail` -- extracts a frame via ffmpeg (needs ffmpeg in PATH)
137
+ - `generateHTMLPlayer` -- creates a local HTML player alongside the video
138
+
139
+ ### SVG generation
140
+
141
+ ```
142
+ Use gemini:generate_svg with:
143
+ prompt="Architecture diagram showing a microservices system with API gateway, three services, and a shared database"
144
+ style="technical"
145
+ width=1000
146
+ height=600
147
+ ```
148
+
149
+ Generates clean, production-ready SVG code for diagrams, illustrations, icons, and data visualisations. Styles: `technical` (diagrams), `artistic` (illustrations), `minimal` (simple), `data-viz` (charts).
150
+
151
+ ### Image editing and analysis
152
+
153
+ **Conversational editing** -- Gemini 3 Pro Image maintains context across editing turns using thought signatures. The server captures these automatically. Pass them back on subsequent edit calls for full continuity:
154
+
155
+ ```
156
+ Use gemini:edit_image with:
157
+ prompt="Change the colour scheme to blue and green"
158
+ images=[{data: imageBase64, mimeType: "image/png", thoughtSignature: "fromPreviousCall"}]
159
+ ```
160
+
161
+ Skip thought signatures and each edit starts from scratch.
162
+
163
+ **Analysis** -- two tools for different purposes:
164
+ - `describe_image` -- Fast general descriptions using Gemini 3 Flash
165
+ - `analyze_image` -- Structured extraction and detailed reasoning using Gemini 3.1 Pro
166
+
167
+ **Load local files:**
168
+ ```
169
+ Use gemini:load_image_from_path with filePath="C:/screenshots/error.png"
170
+ ```
171
+ Returns base64 data ready for any image tool.
172
+
173
+ ### Media resolution control
174
+
175
+ Reduce token usage by up to 75% whilst maintaining quality:
176
+
177
+ | Level | Tokens | Savings | Best for |
178
+ |-------|--------|---------|----------|
179
+ | `MEDIA_RESOLUTION_LOW` | 280 | 75% | Simple tasks, bulk operations |
180
+ | `MEDIA_RESOLUTION_MEDIUM` | 560 | 50% | PDFs/documents (OCR saturates here) |
181
+ | `MEDIA_RESOLUTION_HIGH` | 1120 | default | Detailed analysis |
182
+ | `MEDIA_RESOLUTION_ULTRA_HIGH` | 2000+ | per-image only | Maximum detail |
183
+
184
+ For PDF OCR, MEDIUM gives identical text extraction quality to HIGH at half the tokens. Set `global_media_resolution` to apply to all images, or override per-image with `mediaResolution`.
185
+
186
+ ### Landing page generation
187
+
188
+ ```
189
+ Use gemini:generate_landing_page with:
190
+ brief="A SaaS tool that helps developers monitor API latency"
191
+ companyName="PingWatch"
192
+ primaryColour="#6366F1"
193
+ style="startup"
194
+ sections=["hero", "features", "pricing", "cta"]
195
+ ```
196
+
197
+ Returns a self-contained HTML file -- inline CSS and vanilla JS, no external dependencies. Styles: `minimal`, `bold`, `corporate`, `startup`.
198
+
199
+ ### Professional chart design systems
200
+
201
+ The `gemini_prompt_assistant` tool includes 9 professional chart design systems:
202
+
203
+ | System | Inspiration | Best for |
204
+ |--------|------------|----------|
205
+ | **storytelling** | Cole Nussbaumer Knaflic | Executive presentations -- everything muted except one bold highlight |
206
+ | **financial** | Financial Times | Editorial journalism -- FT Pink background, serif titles |
207
+ | **terminal** | Bloomberg / Fintech | High-density dark mode with electric neon |
208
+ | **modernist** | W.E.B. Du Bois | Bold geometric blocks, stark contrasts |
209
+ | **professional** | IBM Carbon / Tailwind | Enterprise dashboards |
210
+ | **editorial** | FiveThirtyEight / Economist | Data journalism |
211
+ | **scientific** | Nature / Science | Academic rigour |
212
+ | **minimal** | Edward Tufte | Maximum data-ink ratio |
213
+ | **dark** | Observable | Modern dark mode |
214
+
215
+ ```
216
+ Use gemini:gemini_prompt_assistant with:
217
+ request_type="template"
218
+ use_case="product"
219
+ desired_outcome="Generate a professional product comparison chart"
220
+ ```
221
+
222
+ ### Help system
223
+
224
+ ```
225
+ Use gemini:gemini_help with topic="overview"
226
+ ```
227
+
228
+ Documentation for all features without leaving Claude. Topics: `overview`, `image_generation`, `image_editing`, `image_analysis`, `chat`, `deep_research`, `grounding`, `media_resolution`, `models`, `all`.
229
+
230
+ ---
231
+
232
+ ## Image output and storage
233
+
234
+ **Default behaviour:** Images return as inline base64 previews (quality 100, 1024px) rendered directly in Claude.
235
+
236
+ **Persistent storage:** Set `GEMINI_IMAGE_OUTPUT_DIR` to auto-save all generated images:
237
+
238
+ ```json
239
+ "env": {
240
+ "GEMINI_API_KEY": "your-api-key-here",
241
+ "GEMINI_IMAGE_OUTPUT_DIR": "C:/Users/username/Pictures/gemini-output"
242
+ }
243
+ ```
244
+
245
+ Every image saves with a timestamp filename. The tool returns both the inline preview and the file path.
246
+
247
+ **Per-call override:** Pass `outputPath` on any generation tool to save to a specific location.
248
+
249
+ The server uses a two-tier compression approach to handle the MCP protocol's ~1MB JSON-RPC limit whilst preserving full-resolution files on disk:
250
+
251
+ | Tier | Quality | Max dimension | Purpose |
252
+ |------|---------|---------------|---------|
253
+ | **Full-res** | Original | Original | Saved to disk |
254
+ | **Viewer preview** | 100 | 1024px | MCP App inline preview (~400KB) |
255
+
256
+ Gemini returns 2-5MB images. The full image is saved to disk immediately, and a compressed preview is created for the MCP App viewer.
257
+
258
+ ---
259
+
260
+ ## Configuration reference
261
+
262
+ | Variable | Required | Default | Description |
263
+ |----------|----------|---------|-------------|
264
+ | `GEMINI_API_KEY` | Yes | -- | Google AI API key from [AI Studio](https://aistudio.google.com/apikey) |
265
+ | `GEMINI_DEFAULT_MODEL` | No | `gemini-3.1-pro-preview` | Default model for `gemini_chat` and `analyze_image` |
266
+ | `GEMINI_DEFAULT_GROUNDING` | No | `true` | Enable Google Search grounding by default |
267
+ | `GEMINI_IMAGE_OUTPUT_DIR` | No | -- | Auto-save directory for generated images |
268
+ | `GEMINI_ALLOW_EXPERIMENTAL` | No | `false` | Include experimental/preview models in auto-discovery |
269
+ | `GEMINI_MCP_LOG_FILE` | No | `false` | Write logs to `~/.gemini-mcp/logs/` |
270
+ | `DEBUG_MCP` | No | `false` | Log to stderr for debugging tool calls |
271
+
272
+ ---
273
+
274
+ ## Tools reference
275
+
276
+ | Tool | Description |
277
+ |------|-------------|
278
+ | `gemini_chat` | Chat with Gemini 3.1 Pro. Google Search grounding on by default. Supports `thinking_level` for Gemini 3 |
279
+ | `gemini_deep_research` | Multi-step iterative research with Google Search. Synthesises comprehensive reports |
280
+ | `gemini_list_models` | Lists available models from the API |
281
+ | `gemini_help` | Documentation for all features without leaving Claude |
282
+ | `gemini_prompt_assistant` | Expert guidance for image generation with 9 chart design systems |
283
+ | `generate_image` | Image generation with search grounding and thought signatures for conversational editing |
284
+ | `edit_image` | Edit images with natural-language instructions. Supports multi-turn continuity |
285
+ | `describe_image` | Fast image descriptions using Gemini 3 Flash |
286
+ | `analyze_image` | Structured extraction and analysis using Gemini 3.1 Pro |
287
+ | `load_image_from_path` | Read a local image file and return base64 for any image tool |
288
+ | `generate_video` | Video generation with Veo 3.1 -- 4-8 seconds at up to 4K with native audio |
289
+ | `generate_svg` | Production-ready SVG graphics for diagrams, illustrations, and data visualisations |
290
+ | `generate_landing_page` | Self-contained HTML landing pages with inline CSS/JS |
291
+
292
+ ---
293
+
294
+ ## Model reference
295
+
296
+ | Model | Used by | Notes |
297
+ |-------|---------|-------|
298
+ | `gemini-3.1-pro-preview` | `gemini_chat`, `analyze_image` | Default. Advanced reasoning |
299
+ | `gemini-3-pro-image-preview` | `generate_image`, `edit_image` | Nano Banana Pro -- highest quality generation |
300
+ | `gemini-2.5-flash-image` | `generate_image` (optional) | Faster generation, higher volume |
301
+ | `gemini-3-flash-preview` | `describe_image` | Fast general descriptions |
302
+ | `veo-3.1-generate-preview` | `generate_video` | Veo 3.1 -- 4K video with native audio |
303
+
304
+ **Gemini 3 notes:** Temperature is forced to 1.0 on Gemini 3 models (Google's requirement -- lower values cause looping). Thought signatures are captured automatically for conversational image editing. Thinking level only applies to `gemini_chat`.
305
+
306
+ ---
307
+
308
+ ## Requirements
309
+
310
+ - Node.js 18+
311
+ - A Gemini API key from [Google AI Studio](https://aistudio.google.com/apikey)
312
+ - ffmpeg (optional, for video thumbnail extraction)
313
+
314
+ ## Licence
315
+
316
+ Apache-2.0