@houtini/gemini-mcp 1.0.0 → 1.0.1
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.
- package/README.md +495 -442
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,442 +1,495 @@
|
|
|
1
|
-
# Gemini MCP Server
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/js/@houtini/gemini-mcp)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://www.typescriptlang.org/)
|
|
6
|
-
|
|
7
|
-
A professional, production-ready Model Context Protocol (MCP) server that provides seamless integration with Google's Gemini AI models. Built with TypeScript and designed for enterprise use, this package offers robust error handling, comprehensive logging, and easy deployment.
|
|
8
|
-
|
|
9
|
-
## 🚀 Quick Start
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
### Available
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
**
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
1
|
+
# Gemini MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/@houtini/gemini-mcp)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
|
|
7
|
+
A professional, production-ready Model Context Protocol (MCP) server that provides seamless integration with Google's Gemini AI models. Built with TypeScript and designed for enterprise use, this package offers robust error handling, comprehensive logging, and easy deployment.
|
|
8
|
+
|
|
9
|
+
## 🚀 Quick Start
|
|
10
|
+
|
|
11
|
+
The easiest way to get started is using `npx` - no installation required:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Get your API key from Google AI Studio
|
|
15
|
+
# https://makersuite.google.com/app/apikey
|
|
16
|
+
|
|
17
|
+
# Test the server (optional)
|
|
18
|
+
npx @houtini/gemini-mcp
|
|
19
|
+
|
|
20
|
+
# Add to Claude Desktop (see configuration below)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 📋 Table of Contents
|
|
24
|
+
|
|
25
|
+
- [Features](#-features)
|
|
26
|
+
- [Installation](#-installation)
|
|
27
|
+
- [Configuration](#-configuration)
|
|
28
|
+
- [Usage Examples](#-usage-examples)
|
|
29
|
+
- [API Reference](#-api-reference)
|
|
30
|
+
- [Development](#-development)
|
|
31
|
+
- [Troubleshooting](#-troubleshooting)
|
|
32
|
+
- [Contributing](#-contributing)
|
|
33
|
+
|
|
34
|
+
## ✨ Features
|
|
35
|
+
|
|
36
|
+
### Core Functionality
|
|
37
|
+
- **🤖 Multi-Model Support** - Access to 6 Gemini models including the latest Gemini 2.5 Flash
|
|
38
|
+
- **💬 Chat Interface** - Advanced chat functionality with customisable parameters
|
|
39
|
+
- **📊 Model Information** - Detailed model capabilities and specifications
|
|
40
|
+
- **🎛️ Fine-Grained Control** - Temperature, token limits, and system prompts
|
|
41
|
+
|
|
42
|
+
### Enterprise Features
|
|
43
|
+
- **🏗️ Professional Architecture** - Modular services-based design
|
|
44
|
+
- **🛡️ Robust Error Handling** - Comprehensive error handling with detailed logging
|
|
45
|
+
- **📝 Winston Logging** - Production-ready logging with file rotation
|
|
46
|
+
- **🔒 Security Focused** - No hardcoded credentials, environment-based configuration
|
|
47
|
+
- **🏷️ Full TypeScript** - Complete type safety and IntelliSense support
|
|
48
|
+
- **⚡ High Performance** - Optimised for minimal latency and resource usage
|
|
49
|
+
|
|
50
|
+
## 📦 Installation
|
|
51
|
+
|
|
52
|
+
### Prerequisites
|
|
53
|
+
|
|
54
|
+
- **Node.js** v24.0.0
|
|
55
|
+
- **Google AI Studio API Key** ([Get your key here](https://makersuite.google.com/app/apikey))
|
|
56
|
+
|
|
57
|
+
### Recommended: No Installation Required
|
|
58
|
+
|
|
59
|
+
The simplest approach uses `npx` to run the latest version automatically:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# No installation needed - npx handles everything
|
|
63
|
+
npx @houtini/gemini-mcp
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Alternative Installation Methods
|
|
67
|
+
|
|
68
|
+
#### Global Installation
|
|
69
|
+
```bash
|
|
70
|
+
# Install once, use anywhere
|
|
71
|
+
npm install -g @houtini/gemini-mcp
|
|
72
|
+
gemini-mcp
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Local Project Installation
|
|
76
|
+
```bash
|
|
77
|
+
# Install in your project
|
|
78
|
+
npm install @houtini/gemini-mcp
|
|
79
|
+
|
|
80
|
+
# Run with npx
|
|
81
|
+
npx @houtini/gemini-mcp
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### From Source (Developers)
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/houtini-ai/gemini-mcp.git
|
|
87
|
+
cd gemini-mcp
|
|
88
|
+
npm install
|
|
89
|
+
npm run build
|
|
90
|
+
npm start
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## ⚙️ Configuration
|
|
94
|
+
|
|
95
|
+
### Step 1: Get Your API Key
|
|
96
|
+
|
|
97
|
+
Visit [Google AI Studio](https://makersuite.google.com/app/apikey) to create your free API key.
|
|
98
|
+
|
|
99
|
+
### Step 2: Configure Claude Desktop
|
|
100
|
+
|
|
101
|
+
Add this configuration to your Claude Desktop config file:
|
|
102
|
+
|
|
103
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
104
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
105
|
+
|
|
106
|
+
#### ✅ Recommended Configuration (using npx)
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"gemini": {
|
|
112
|
+
"command": "npx",
|
|
113
|
+
"args": ["@houtini/gemini-mcp"],
|
|
114
|
+
"env": {
|
|
115
|
+
"GEMINI_API_KEY": "your-api-key-here"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Benefits of this approach:**
|
|
123
|
+
- ✅ No global installation required
|
|
124
|
+
- ✅ Always uses the latest version
|
|
125
|
+
- ✅ Cleaner system (no global packages)
|
|
126
|
+
- ✅ Works out of the box
|
|
127
|
+
|
|
128
|
+
#### Alternative: Global Installation
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"mcpServers": {
|
|
133
|
+
"gemini": {
|
|
134
|
+
"command": "gemini-mcp",
|
|
135
|
+
"env": {
|
|
136
|
+
"GEMINI_API_KEY": "your-api-key-here"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
*Note: Requires `npm install -g @houtini/gemini-mcp` first*
|
|
144
|
+
|
|
145
|
+
#### Alternative: Local Installation
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"mcpServers": {
|
|
150
|
+
"gemini": {
|
|
151
|
+
"command": "node",
|
|
152
|
+
"args": ["./node_modules/@houtini/gemini-mcp/dist/index.js"],
|
|
153
|
+
"env": {
|
|
154
|
+
"GEMINI_API_KEY": "your-api-key-here"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
*Note: Only works if installed locally in the current directory*
|
|
162
|
+
|
|
163
|
+
### Step 3: Restart Claude Desktop
|
|
164
|
+
|
|
165
|
+
After updating the configuration file, restart Claude Desktop to load the new MCP server.
|
|
166
|
+
|
|
167
|
+
### Optional Configuration
|
|
168
|
+
|
|
169
|
+
You can add additional environment variables for more control:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"mcpServers": {
|
|
174
|
+
"gemini": {
|
|
175
|
+
"command": "npx",
|
|
176
|
+
"args": ["@houtini/gemini-mcp"],
|
|
177
|
+
"env": {
|
|
178
|
+
"GEMINI_API_KEY": "your-api-key-here",
|
|
179
|
+
"LOG_LEVEL": "info"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Available Environment Variables:**
|
|
187
|
+
|
|
188
|
+
| Variable | Default | Description |
|
|
189
|
+
|----------|---------|-------------|
|
|
190
|
+
| `GEMINI_API_KEY` | *required* | Your Google AI Studio API key |
|
|
191
|
+
| `LOG_LEVEL` | `info` | Logging level: `debug`, `info`, `warn`, `error` |
|
|
192
|
+
|
|
193
|
+
### Using .env File (Development)
|
|
194
|
+
|
|
195
|
+
For development or testing, create a `.env` file:
|
|
196
|
+
|
|
197
|
+
```env
|
|
198
|
+
# Google Gemini Configuration
|
|
199
|
+
GEMINI_API_KEY=your-api-key-here
|
|
200
|
+
|
|
201
|
+
# Logging Configuration (optional)
|
|
202
|
+
LOG_LEVEL=info
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## 💡 Usage Examples
|
|
206
|
+
|
|
207
|
+
### Basic Chat
|
|
208
|
+
|
|
209
|
+
Ask Claude to use Gemini:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
Can you help me understand quantum computing using Gemini?
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Claude will automatically use the `gemini_chat` tool to get a response from Gemini.
|
|
216
|
+
|
|
217
|
+
### Creative Writing
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
Use Gemini to write a short story about artificial intelligence discovering creativity.
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Technical Analysis
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
Can you use Gemini Pro to explain the differences between various machine learning algorithms?
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Model Selection
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
Use Gemini 1.5 Pro to analyse this code and suggest improvements.
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Getting Model Information
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
Show me all available Gemini models and their capabilities.
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 🔧 API Reference
|
|
242
|
+
|
|
243
|
+
### Available Tools
|
|
244
|
+
|
|
245
|
+
#### `gemini_chat`
|
|
246
|
+
|
|
247
|
+
Chat with Gemini models to generate text responses.
|
|
248
|
+
|
|
249
|
+
**Parameters:**
|
|
250
|
+
|
|
251
|
+
| Parameter | Type | Required | Default | Description |
|
|
252
|
+
|-----------|------|----------|---------|-------------|
|
|
253
|
+
| `message` | string | ✅ | - | The message to send to Gemini |
|
|
254
|
+
| `model` | string | ❌ | "gemini-2.5-flash" | Model to use |
|
|
255
|
+
| `temperature` | number | ❌ | 0.7 | Controls randomness (0.0-1.0) |
|
|
256
|
+
| `max_tokens` | integer | ❌ | 2048 | Maximum tokens in response (1-8192) |
|
|
257
|
+
| `system_prompt` | string | ❌ | - | System instruction to guide the model |
|
|
258
|
+
|
|
259
|
+
**Example:**
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"message": "Explain machine learning in simple terms",
|
|
263
|
+
"model": "gemini-1.5-pro",
|
|
264
|
+
"temperature": 0.5,
|
|
265
|
+
"max_tokens": 1000,
|
|
266
|
+
"system_prompt": "You are a helpful teaching assistant. Explain concepts clearly and use analogies where appropriate."
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### `gemini_list_models`
|
|
271
|
+
|
|
272
|
+
Retrieve information about all available Gemini models.
|
|
273
|
+
|
|
274
|
+
**Parameters:** None required
|
|
275
|
+
|
|
276
|
+
**Example:**
|
|
277
|
+
```json
|
|
278
|
+
{}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Response includes:**
|
|
282
|
+
- Model names and display names
|
|
283
|
+
- Descriptions of each model's strengths
|
|
284
|
+
- Recommended use cases
|
|
285
|
+
|
|
286
|
+
### Available Models
|
|
287
|
+
|
|
288
|
+
| Model | Best For | Description |
|
|
289
|
+
|-------|----------|-------------|
|
|
290
|
+
| **gemini-2.5-flash** | General use, latest features | Latest Gemini 2.5 Flash - Fast, versatile performance |
|
|
291
|
+
| **gemini-2.0-flash** | Speed-optimised tasks | Gemini 2.0 Flash - Fast, efficient model |
|
|
292
|
+
| **gemini-1.5-flash** | Quick responses | Gemini 1.5 Flash - Fast, efficient model |
|
|
293
|
+
| **gemini-1.5-pro** | Complex reasoning | Gemini 1.5 Pro - Advanced reasoning capabilities |
|
|
294
|
+
| **gemini-pro** | Balanced performance | Gemini Pro - Balanced performance for most tasks |
|
|
295
|
+
| **gemini-pro-vision** | Multimodal tasks | Gemini Pro Vision - Text and image understanding |
|
|
296
|
+
|
|
297
|
+
## 🛠️ Development
|
|
298
|
+
|
|
299
|
+
### Building from Source
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# Clone the repository
|
|
303
|
+
git clone https://github.com/houtini-ai/gemini-mcp.git
|
|
304
|
+
cd gemini-mcp
|
|
305
|
+
|
|
306
|
+
# Install dependencies
|
|
307
|
+
npm install
|
|
308
|
+
|
|
309
|
+
# Build the project
|
|
310
|
+
npm run build
|
|
311
|
+
|
|
312
|
+
# Run in development mode
|
|
313
|
+
npm run dev
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Scripts
|
|
317
|
+
|
|
318
|
+
| Command | Description |
|
|
319
|
+
|---------|-------------|
|
|
320
|
+
| `npm run build` | Compile TypeScript to JavaScript |
|
|
321
|
+
| `npm run dev` | Run in development mode with live reload |
|
|
322
|
+
| `npm start` | Run the compiled server |
|
|
323
|
+
| `npm test` | Run test suite |
|
|
324
|
+
| `npm run lint` | Check code style |
|
|
325
|
+
| `npm run lint:fix` | Fix linting issues automatically |
|
|
326
|
+
|
|
327
|
+
### Project Structure
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
src/
|
|
331
|
+
├── config/ # Configuration management
|
|
332
|
+
│ ├── index.ts # Main configuration
|
|
333
|
+
│ └── types.ts # Configuration types
|
|
334
|
+
├── services/ # Core business logic
|
|
335
|
+
│ ├── base-service.ts
|
|
336
|
+
│ └── gemini/ # Gemini service implementation
|
|
337
|
+
│ ├── index.ts
|
|
338
|
+
│ └── types.ts
|
|
339
|
+
├── tools/ # MCP tool implementations
|
|
340
|
+
│ ├── gemini-chat.ts
|
|
341
|
+
│ └── gemini-list-models.ts
|
|
342
|
+
├── utils/ # Utility functions
|
|
343
|
+
│ ├── logger.ts # Winston logging setup
|
|
344
|
+
│ └── error-handler.ts
|
|
345
|
+
├── cli.ts # CLI entry point
|
|
346
|
+
└── index.ts # Main server implementation
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Architecture
|
|
350
|
+
|
|
351
|
+
The server follows a clean, layered architecture:
|
|
352
|
+
|
|
353
|
+
1. **CLI Layer** (`cli.ts`) - Command-line interface
|
|
354
|
+
2. **Server Layer** (`index.ts`) - MCP protocol handling
|
|
355
|
+
3. **Tools Layer** (`tools/`) - MCP tool implementations
|
|
356
|
+
4. **Service Layer** (`services/`) - Business logic and API integration
|
|
357
|
+
5. **Utility Layer** (`utils/`) - Cross-cutting concerns
|
|
358
|
+
|
|
359
|
+
## 🐛 Troubleshooting
|
|
360
|
+
|
|
361
|
+
### Common Issues
|
|
362
|
+
|
|
363
|
+
#### "GEMINI_API_KEY environment variable not set"
|
|
364
|
+
|
|
365
|
+
**Solution:**
|
|
366
|
+
```bash
|
|
367
|
+
# Make sure your API key is set in the Claude Desktop configuration
|
|
368
|
+
# See the Configuration section above
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
#### Server not appearing in Claude Desktop
|
|
372
|
+
|
|
373
|
+
**Solutions:**
|
|
374
|
+
1. **Restart Claude Desktop** after updating configuration
|
|
375
|
+
2. **Check your configuration file path**:
|
|
376
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
377
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
378
|
+
3. **Verify JSON syntax** - use a JSON validator if needed
|
|
379
|
+
4. **Ensure your API key is valid** - test at [Google AI Studio](https://makersuite.google.com/app/apikey)
|
|
380
|
+
|
|
381
|
+
#### "Module not found" errors with npx
|
|
382
|
+
|
|
383
|
+
**Solutions:**
|
|
384
|
+
```bash
|
|
385
|
+
# Clear npx cache and try again
|
|
386
|
+
npx --yes @houtini/gemini-mcp
|
|
387
|
+
|
|
388
|
+
# Or install globally if preferred
|
|
389
|
+
npm install -g @houtini/gemini-mcp
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
#### Node.js version issues
|
|
393
|
+
|
|
394
|
+
**Solution:**
|
|
395
|
+
```bash
|
|
396
|
+
# Check your Node.js version
|
|
397
|
+
node --version
|
|
398
|
+
|
|
399
|
+
# Should be v24.0.0 or higher
|
|
400
|
+
# Install latest Node.js from https://nodejs.org
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Debug Mode
|
|
404
|
+
|
|
405
|
+
Enable detailed logging by setting `LOG_LEVEL=debug` in your Claude Desktop configuration:
|
|
406
|
+
|
|
407
|
+
```json
|
|
408
|
+
{
|
|
409
|
+
"mcpServers": {
|
|
410
|
+
"gemini": {
|
|
411
|
+
"command": "npx",
|
|
412
|
+
"args": ["@houtini/gemini-mcp"],
|
|
413
|
+
"env": {
|
|
414
|
+
"GEMINI_API_KEY": "your-api-key-here",
|
|
415
|
+
"LOG_LEVEL": "debug"
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Log Files
|
|
423
|
+
|
|
424
|
+
Logs are written to:
|
|
425
|
+
- **Console output** (visible in Claude Desktop developer tools)
|
|
426
|
+
- **`logs/combined.log`** - All log levels
|
|
427
|
+
- **`logs/error.log`** - Error logs only
|
|
428
|
+
|
|
429
|
+
### Testing Your Setup
|
|
430
|
+
|
|
431
|
+
Test the server with these Claude queries:
|
|
432
|
+
|
|
433
|
+
1. **Basic connectivity**: "Can you list the available Gemini models?"
|
|
434
|
+
2. **Simple chat**: "Use Gemini to explain photosynthesis."
|
|
435
|
+
3. **Advanced features**: "Use Gemini 1.5 Pro with temperature 0.9 to write a creative poem about coding."
|
|
436
|
+
|
|
437
|
+
### Performance Tuning
|
|
438
|
+
|
|
439
|
+
For better performance:
|
|
440
|
+
|
|
441
|
+
1. **Adjust token limits** based on your use case
|
|
442
|
+
2. **Use appropriate models** (Flash for speed, Pro for complex tasks)
|
|
443
|
+
3. **Monitor logs** for rate limiting or API issues
|
|
444
|
+
4. **Set reasonable temperature values** (0.7 for balanced, 0.3 for focused, 0.9 for creative)
|
|
445
|
+
|
|
446
|
+
## 🤝 Contributing
|
|
447
|
+
|
|
448
|
+
Contributions are welcome! Please follow these steps:
|
|
449
|
+
|
|
450
|
+
1. **Fork the repository**
|
|
451
|
+
2. **Create a feature branch**: `git checkout -b feature/amazing-feature`
|
|
452
|
+
3. **Make your changes** and add tests if applicable
|
|
453
|
+
4. **Ensure all tests pass**: `npm test`
|
|
454
|
+
5. **Lint your code**: `npm run lint:fix`
|
|
455
|
+
6. **Build the project**: `npm run build`
|
|
456
|
+
7. **Commit your changes**: `git commit -m 'Add amazing feature'`
|
|
457
|
+
8. **Push to the branch**: `git push origin feature/amazing-feature`
|
|
458
|
+
9. **Open a Pull Request**
|
|
459
|
+
|
|
460
|
+
### Development Guidelines
|
|
461
|
+
|
|
462
|
+
- **Follow TypeScript best practices**
|
|
463
|
+
- **Add tests for new functionality**
|
|
464
|
+
- **Update documentation as needed**
|
|
465
|
+
- **Use conventional commit messages**
|
|
466
|
+
- **Ensure backwards compatibility**
|
|
467
|
+
|
|
468
|
+
## 📄 License
|
|
469
|
+
|
|
470
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
471
|
+
|
|
472
|
+
## 🆘 Support
|
|
473
|
+
|
|
474
|
+
- **GitHub Issues**: [Report bugs or request features](https://github.com/houtini-ai/gemini-mcp/issues)
|
|
475
|
+
- **GitHub Discussions**: [Ask questions or share ideas](https://github.com/houtini-ai/gemini-mcp/discussions)
|
|
476
|
+
|
|
477
|
+
## 📈 Changelog
|
|
478
|
+
|
|
479
|
+
### v1.0.0
|
|
480
|
+
|
|
481
|
+
**Initial Release**
|
|
482
|
+
- Complete Node.js/TypeScript rewrite from Python
|
|
483
|
+
- Professional modular architecture with services pattern
|
|
484
|
+
- Comprehensive error handling and logging system
|
|
485
|
+
- Full MCP protocol compliance
|
|
486
|
+
- Support for 6 Gemini models
|
|
487
|
+
- NPM package distribution ready
|
|
488
|
+
- Enterprise-grade configuration management
|
|
489
|
+
- Production-ready build system
|
|
490
|
+
|
|
491
|
+
---
|
|
492
|
+
|
|
493
|
+
**Built with ❤️ for the Model Context Protocol community**
|
|
494
|
+
|
|
495
|
+
For more information about MCP, visit [modelcontextprotocol.io](https://modelcontextprotocol.io)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@houtini/gemini-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Professional Model Context Protocol server for Google Gemini AI models with enterprise-grade features",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"typescript": "^5.5.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
|
-
"node": ">=
|
|
77
|
-
"npm": ">=
|
|
76
|
+
"node": ">=24.0.0",
|
|
77
|
+
"npm": ">=10.0.0"
|
|
78
78
|
},
|
|
79
79
|
"files": [
|
|
80
80
|
"dist/**/*",
|