@maxanatsko/gemini-mcp-tool 2.1.0 → 2.1.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/LICENSE +1 -0
- package/README.md +113 -145
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -2
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,230 +1,198 @@
|
|
|
1
|
+
# Gemini MCP Tool
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
<br>
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- Ask gemini natural questions, through claude or Brainstorm new ideas in a party of 3!
|
|
18
|
-
|
|
19
|
-
> 📚 **Original Documentation**: [View Full Documentation](https://jamubc.github.io/gemini-mcp-tool/) - Examples, FAQ, Troubleshooting, Best Practices
|
|
20
|
-
|
|
21
|
-
## TLDR: [](#) + [](#)
|
|
5
|
+
```
|
|
6
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
7
|
+
│ │
|
|
8
|
+
│ Model Context Protocol server for Google Gemini CLI │
|
|
9
|
+
│ │
|
|
10
|
+
│ Claude ──────────────── Gemini │
|
|
11
|
+
│ │
|
|
12
|
+
│ Leverage Gemini's massive token window │
|
|
13
|
+
│ for large file and codebase analysis │
|
|
14
|
+
│ │
|
|
15
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
16
|
+
```
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
<br>
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
**Version** `2.1.0`
|
|
21
|
+
**License** `MIT`
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
---
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
- **100% Async I/O**: All file operations converted from `fs` to `fs/promises` (no event loop blocking)
|
|
31
|
-
- **Robust Error Handling**: Fixed all empty catch blocks with proper logging and user feedback
|
|
32
|
-
- **Optimized Cleanup**: Session cleanup now runs at 80% threshold (not on every save)
|
|
33
|
-
- **Enhanced Security**: Improved session ID sanitization with 3-step regex validation
|
|
34
|
-
- **Graceful Degradation**: Session failures no longer break tool functionality
|
|
35
|
-
- **Consistent LRU**: All tools now use LRU eviction policy for better performance
|
|
36
|
-
- **Type Safety**: Maintained generic `SessionManager<T>` with full type safety
|
|
37
|
-
- **Better Logging**: Consistent log levels with tool-specific prefixes
|
|
25
|
+
<br>
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
- Lazy initialization with race condition protection
|
|
41
|
-
- Helper methods to reduce code duplication
|
|
42
|
-
- Centralized configuration defaults
|
|
43
|
-
- `createdAt` field always guaranteed to be set
|
|
44
|
-
- Async error handling in tool integrations
|
|
27
|
+
## Prerequisites
|
|
45
28
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
```
|
|
30
|
+
Node.js ≥ 16.0.0
|
|
31
|
+
Google Gemini CLI (configured)
|
|
32
|
+
```
|
|
50
33
|
|
|
51
|
-
>
|
|
34
|
+
<br>
|
|
52
35
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Before using this tool, ensure you have:
|
|
36
|
+
---
|
|
56
37
|
|
|
57
|
-
|
|
58
|
-
2. **[Google Gemini CLI](https://github.com/google-gemini/gemini-cli)** installed and configured
|
|
38
|
+
<br>
|
|
59
39
|
|
|
40
|
+
## Installation
|
|
60
41
|
|
|
61
|
-
|
|
42
|
+
<br>
|
|
62
43
|
|
|
63
|
-
|
|
44
|
+
### Recommended
|
|
64
45
|
|
|
65
46
|
```bash
|
|
66
47
|
claude mcp add gemini-cli -- npx -y maxanatsko/gemini-mcp-tool
|
|
67
48
|
```
|
|
68
49
|
|
|
69
|
-
|
|
50
|
+
<br>
|
|
51
|
+
|
|
52
|
+
### Local Development
|
|
70
53
|
|
|
71
54
|
```bash
|
|
72
|
-
# Clone the repository
|
|
73
55
|
git clone https://github.com/maxanatsko/gemini-mcp-tool.git
|
|
74
56
|
cd gemini-mcp-tool
|
|
75
57
|
|
|
76
|
-
# Build and link
|
|
77
58
|
npm install
|
|
78
59
|
npm run build
|
|
79
60
|
npm link
|
|
80
61
|
|
|
81
|
-
# Add to Claude
|
|
82
62
|
claude mcp add gemini-cli -- gemini-mcp
|
|
83
63
|
```
|
|
84
64
|
|
|
85
|
-
|
|
65
|
+
<br>
|
|
66
|
+
|
|
67
|
+
### Verify
|
|
86
68
|
|
|
87
69
|
```bash
|
|
88
|
-
|
|
70
|
+
/mcp
|
|
89
71
|
```
|
|
90
72
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Type `/mcp` inside Claude Code to verify the gemini-cli MCP is active.
|
|
73
|
+
<br>
|
|
94
74
|
|
|
95
75
|
---
|
|
96
76
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
If you already have it configured in Claude Desktop:
|
|
100
|
-
|
|
101
|
-
1. Add to your Claude Desktop config:
|
|
102
|
-
```json
|
|
103
|
-
"gemini-cli": {
|
|
104
|
-
"command": "npx",
|
|
105
|
-
"args": ["-y", "maxanatsko/gemini-mcp-tool"]
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
2. Import to Claude Code:
|
|
110
|
-
```bash
|
|
111
|
-
claude mcp add-from-claude-desktop
|
|
112
|
-
```
|
|
77
|
+
<br>
|
|
113
78
|
|
|
114
79
|
## Configuration
|
|
115
80
|
|
|
116
|
-
|
|
81
|
+
<br>
|
|
117
82
|
|
|
118
|
-
###
|
|
119
|
-
|
|
120
|
-
Add this configuration to your Claude Desktop config file:
|
|
83
|
+
### Claude Desktop
|
|
121
84
|
|
|
122
85
|
```json
|
|
123
86
|
{
|
|
124
87
|
"mcpServers": {
|
|
125
88
|
"gemini-cli": {
|
|
126
89
|
"command": "npx",
|
|
127
|
-
"args": ["-y", "gemini-mcp-tool"]
|
|
90
|
+
"args": ["-y", "maxanatsko/gemini-mcp-tool"]
|
|
128
91
|
}
|
|
129
92
|
}
|
|
130
93
|
}
|
|
131
94
|
```
|
|
132
95
|
|
|
133
|
-
|
|
96
|
+
<br>
|
|
134
97
|
|
|
135
|
-
|
|
98
|
+
### Config Locations
|
|
136
99
|
|
|
137
|
-
```json
|
|
138
|
-
{
|
|
139
|
-
"mcpServers": {
|
|
140
|
-
"gemini-cli": {
|
|
141
|
-
"command": "gemini-mcp"
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
100
|
```
|
|
101
|
+
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
102
|
+
Windows %APPDATA%\Claude\claude_desktop_config.json
|
|
103
|
+
Linux ~/.config/claude/claude_desktop_config.json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
<br>
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
<br>
|
|
146
111
|
|
|
147
|
-
|
|
112
|
+
## Usage
|
|
148
113
|
|
|
149
|
-
|
|
150
|
-
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
151
|
-
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
152
|
-
- **Linux**: `~/.config/claude/claude_desktop_config.json`
|
|
114
|
+
<br>
|
|
153
115
|
|
|
154
|
-
|
|
116
|
+
### File Analysis
|
|
155
117
|
|
|
156
|
-
|
|
118
|
+
```
|
|
119
|
+
ask gemini to analyze @src/main.js
|
|
120
|
+
use gemini to summarize @.
|
|
121
|
+
analyze @package.json dependencies
|
|
122
|
+
```
|
|
157
123
|
|
|
158
|
-
|
|
159
|
-
- **Claude Code**: Type `/gemini-cli` and commands will populate in Claude Code's interface.
|
|
124
|
+
<br>
|
|
160
125
|
|
|
161
|
-
|
|
126
|
+
### General Questions
|
|
162
127
|
|
|
163
|
-
|
|
128
|
+
```
|
|
129
|
+
ask gemini about React best practices
|
|
130
|
+
use gemini to explain div centering
|
|
131
|
+
ask gemini for latest tech news
|
|
132
|
+
```
|
|
164
133
|
|
|
165
|
-
|
|
166
|
-
- `use gemini to summarize @. the current directory`
|
|
167
|
-
- `analyze @package.json and tell me about dependencies`
|
|
134
|
+
<br>
|
|
168
135
|
|
|
169
|
-
###
|
|
136
|
+
### Sandbox Mode
|
|
170
137
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
138
|
+
```
|
|
139
|
+
use gemini sandbox to run @script.py
|
|
140
|
+
ask gemini to safely test this code
|
|
141
|
+
use gemini sandbox to install numpy
|
|
142
|
+
```
|
|
174
143
|
|
|
175
|
-
|
|
144
|
+
<br>
|
|
176
145
|
|
|
177
|
-
|
|
146
|
+
---
|
|
178
147
|
|
|
179
|
-
|
|
180
|
-
- `ask gemini to safely test @script.py and explain what it does`
|
|
181
|
-
- `use gemini sandbox to install numpy and create a data visualization`
|
|
182
|
-
- `test this code safely: Create a script that makes HTTP requests to an API`
|
|
148
|
+
<br>
|
|
183
149
|
|
|
184
|
-
|
|
150
|
+
## Tools
|
|
185
151
|
|
|
186
|
-
|
|
152
|
+
<br>
|
|
187
153
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
- **`Ping`**: A simple test tool that echoes back a message.
|
|
196
|
-
- **`Help`**: Shows the Gemini CLI help text.
|
|
154
|
+
| Tool | Description |
|
|
155
|
+
|:-----|:------------|
|
|
156
|
+
| `ask-gemini` | Query Gemini with `@` file references |
|
|
157
|
+
| `brainstorm` | Creative ideation with frameworks |
|
|
158
|
+
| `review-code` | Interactive code review sessions |
|
|
159
|
+
| `ping` | Connection test |
|
|
160
|
+
| `help` | CLI documentation |
|
|
197
161
|
|
|
198
|
-
|
|
162
|
+
<br>
|
|
199
163
|
|
|
200
|
-
|
|
164
|
+
### Parameters
|
|
201
165
|
|
|
202
|
-
|
|
203
|
-
- **`prompt`** (required): The analysis prompt. Use `@` syntax to include files (e.g., `/analyze prompt:@src/ summarize this directory`) or ask general questions (e.g., `/analyze prompt:Please use a web search to find the latest news stories`).
|
|
204
|
-
- **/sandbox**: Safely tests code or scripts in Gemini's sandbox environment.
|
|
205
|
-
- **`prompt`** (required): Code testing request (e.g., `/sandbox prompt:Create and run a Python script that processes CSV data` or `/sandbox prompt:@script.py Test this script safely`).
|
|
206
|
-
- **/help**: Displays the Gemini CLI help information.
|
|
207
|
-
- **/ping**: Tests the connection to the server.
|
|
208
|
-
- **`message`** (optional): A message to echo back.
|
|
166
|
+
<br>
|
|
209
167
|
|
|
210
|
-
|
|
168
|
+
**ask-gemini**
|
|
211
169
|
|
|
212
|
-
|
|
170
|
+
```
|
|
171
|
+
prompt Required Analysis request with @ syntax
|
|
172
|
+
model Optional gemini-2.5-pro (default)
|
|
173
|
+
sandbox Optional Safe code execution
|
|
174
|
+
session Optional Conversation continuity
|
|
175
|
+
changeMode Optional Structured edit suggestions
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
<br>
|
|
213
179
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
<br>
|
|
217
183
|
|
|
218
|
-
|
|
184
|
+
## Links
|
|
219
185
|
|
|
220
|
-
|
|
186
|
+
<br>
|
|
221
187
|
|
|
222
|
-
|
|
188
|
+
[Documentation](https://jamubc.github.io/gemini-mcp-tool/)
|
|
189
|
+
[Original Project](https://github.com/jamubc/gemini-mcp-tool)
|
|
190
|
+
[This Fork](https://github.com/maxanatsko/gemini-mcp-tool)
|
|
223
191
|
|
|
224
|
-
|
|
192
|
+
<br>
|
|
225
193
|
|
|
226
|
-
|
|
194
|
+
---
|
|
227
195
|
|
|
228
|
-
|
|
196
|
+
<br>
|
|
229
197
|
|
|
230
|
-
|
|
198
|
+
<sub>MIT License — Not affiliated with Google</sub>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAgBA,cAAc,eAAe,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Tool Registry Index - Registers all tools
|
|
2
2
|
import { toolRegistry } from './registry.js';
|
|
3
3
|
import { askGeminiTool } from './ask-gemini.tool.js';
|
|
4
|
-
import { pingTool, helpTool } from './simple-tools.js';
|
|
5
4
|
import { brainstormTool } from './brainstorm.tool.js';
|
|
6
5
|
import { fetchChunkTool } from './fetch-chunk.tool.js';
|
|
7
6
|
import { timeoutTestTool } from './timeout-test.tool.js';
|
|
8
7
|
import { reviewCodeTool } from './review-code.tool.js';
|
|
9
|
-
toolRegistry.push(askGeminiTool,
|
|
8
|
+
toolRegistry.push(askGeminiTool, brainstormTool, fetchChunkTool, timeoutTestTool, reviewCodeTool);
|
|
10
9
|
export * from './registry.js';
|
|
11
10
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,YAAY,CAAC,IAAI,CACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,CACf,CAAC;AAEF,cAAc,eAAe,CAAC"}
|