@danwahl/gemini-cli-mcp 0.1.3 → 0.1.4
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/cli.js +1 -3
- package/dist/index.js +11 -6
- package/package.json +1 -1
package/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import {
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
3
|
import { createRequire } from "node:module";
|
|
5
4
|
import { z } from "zod";
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
6
7
|
|
|
7
|
-
//#region src/
|
|
8
|
-
const { version } = createRequire(import.meta.url)("../package.json");
|
|
8
|
+
//#region src/lib.ts
|
|
9
9
|
function buildGeminiArgs(prompt, model, sessionId, outputFormat = "json") {
|
|
10
10
|
const args = [
|
|
11
11
|
"-p",
|
|
@@ -164,6 +164,10 @@ function runGemini(prompt, cwd, model, timeoutMs, sessionId) {
|
|
|
164
164
|
});
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
|
+
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/index.ts
|
|
170
|
+
const { version } = createRequire(import.meta.url)("../package.json");
|
|
167
171
|
const server = new McpServer({
|
|
168
172
|
name: "gemini-cli-mcp",
|
|
169
173
|
version
|
|
@@ -211,6 +215,7 @@ server.registerTool("cli", {
|
|
|
211
215
|
structuredContent: structured
|
|
212
216
|
};
|
|
213
217
|
});
|
|
218
|
+
const transport = new StdioServerTransport();
|
|
219
|
+
await server.connect(transport);
|
|
214
220
|
|
|
215
|
-
//#endregion
|
|
216
|
-
export { buildGeminiArgs, extractStructuredOutput, parseGeminiOutput, runGemini, server };
|
|
221
|
+
//#endregion
|