@danwahl/gemini-cli-mcp 0.1.5 → 0.1.7
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 +4 -4
- package/dist/index.js +21 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,16 +34,16 @@ npm run build
|
|
|
34
34
|
**User install** (available across all projects):
|
|
35
35
|
|
|
36
36
|
```sh
|
|
37
|
-
claude mcp add
|
|
37
|
+
claude mcp add gemini-cli -s user -- npx -y @danwahl/gemini-cli-mcp
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
**Project install** (shared with your team via `.mcp.json`):
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
|
-
claude mcp add
|
|
43
|
+
claude mcp add gemini-cli -s project -- npx -y @danwahl/gemini-cli-mcp
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Or from source, replace `npx @danwahl/gemini-cli-mcp` with `node /absolute/path/to/gemini-cli-mcp/
|
|
46
|
+
Or from source, replace `npx -y @danwahl/gemini-cli-mcp` with `node /absolute/path/to/gemini-cli-mcp/dist/index.js`.
|
|
47
47
|
|
|
48
48
|
Verify with `claude mcp list`.
|
|
49
49
|
|
|
@@ -96,7 +96,7 @@ Gemini runs with `--approval-mode yolo`, giving it full tool access: read/write
|
|
|
96
96
|
## Development
|
|
97
97
|
|
|
98
98
|
```sh
|
|
99
|
-
npm run build # compile with
|
|
99
|
+
npm run build # compile with tsc
|
|
100
100
|
npm test # run unit tests
|
|
101
101
|
```
|
|
102
102
|
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,20 @@ const server = new McpServer({
|
|
|
10
10
|
version,
|
|
11
11
|
});
|
|
12
12
|
server.registerTool("cli", {
|
|
13
|
-
description: "Send a task
|
|
14
|
-
"Gemini runs headlessly with full tool access (file read/write, web search, shell commands)
|
|
15
|
-
"
|
|
13
|
+
description: "Send a task to Gemini CLI and return the response. " +
|
|
14
|
+
"Gemini runs headlessly with full tool access (file read/write, web search, shell commands) " +
|
|
15
|
+
"and operates in the working directory you specify via `cwd`.\n\n" +
|
|
16
|
+
"When to use this tool:\n" +
|
|
17
|
+
"- Delegating rote coding tasks: boilerplate generation, repetitive refactors, bulk edits across many files\n" +
|
|
18
|
+
"- Getting a second opinion: code review, architecture feedback, sanity-checking an approach\n" +
|
|
19
|
+
"- Research and brainstorming: Gemini has web search and a large context window, useful for exploring options or summarizing docs\n" +
|
|
20
|
+
"- Large file analysis: processing files that would be expensive to handle directly\n" +
|
|
21
|
+
"- Parallel workstreams: offloading independent subtasks while you continue other work\n\n" +
|
|
22
|
+
"Session resumption: each response includes a `sessionId`. " +
|
|
23
|
+
"Pass it back via the `sessionId` parameter to continue a conversation " +
|
|
24
|
+
"without re-sending context — useful for multi-step tasks or follow-up questions.\n\n" +
|
|
25
|
+
"Keep prompts self-contained: include all necessary context in the `prompt` since " +
|
|
26
|
+
"Gemini has no access to your conversation history or MCP state.",
|
|
16
27
|
inputSchema: {
|
|
17
28
|
prompt: z
|
|
18
29
|
.string()
|
|
@@ -31,6 +42,11 @@ server.registerTool("cli", {
|
|
|
31
42
|
.string()
|
|
32
43
|
.optional()
|
|
33
44
|
.describe("Resume a previous Gemini session by ID. The session ID is returned in the structured output of each call."),
|
|
45
|
+
timeout: z
|
|
46
|
+
.number()
|
|
47
|
+
.optional()
|
|
48
|
+
.default(120)
|
|
49
|
+
.describe("Timeout in seconds. Default: 120. Increase for complex multi-step tasks."),
|
|
34
50
|
},
|
|
35
51
|
outputSchema: {
|
|
36
52
|
sessionId: z.string().nullable().describe("Gemini CLI session ID"),
|
|
@@ -42,8 +58,8 @@ server.registerTool("cli", {
|
|
|
42
58
|
readOnlyHint: false,
|
|
43
59
|
openWorldHint: true,
|
|
44
60
|
},
|
|
45
|
-
}, async ({ prompt, cwd, model, sessionId }) => {
|
|
46
|
-
const timeoutMs =
|
|
61
|
+
}, async ({ prompt, cwd, model, sessionId, timeout }) => {
|
|
62
|
+
const timeoutMs = (timeout ?? 120) * 1000;
|
|
47
63
|
const result = await runGemini(prompt, cwd, model, timeoutMs, sessionId);
|
|
48
64
|
if (result.isError) {
|
|
49
65
|
return {
|