@vernikr/gemini-mcp 0.9.1 → 0.9.3
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 +2 -1
- package/bin/gemini-mcp.js +41 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,7 +93,8 @@ All commands accept `--json` (agent-facing output). MCP tools: `analyze_large`,
|
|
|
93
93
|
|
|
94
94
|
`bin/gemini-mcp.js` is a ~30-line bootstrap: it runs the version-pinned Python core
|
|
95
95
|
(`uvx --from gemini-mcp-gateway==<same version> gemini-mcp …`), self-installing uv
|
|
96
|
-
through
|
|
96
|
+
through the official astral.sh installer when needed (uv is not distributed via npm).
|
|
97
|
+
Zero logic in JS; npm ↔ PyPI versions are
|
|
97
98
|
lockstep. Fleet mode (shared quota ledger on your own server) and full docs:
|
|
98
99
|
[github.com/vernikr/gemini-mcp](https://github.com/vernikr/gemini-mcp) —
|
|
99
100
|
`docs/06-consumer.md`, `docs/08-dual-mode.md`.
|
package/bin/gemini-mcp.js
CHANGED
|
@@ -4,22 +4,53 @@
|
|
|
4
4
|
(PyPI dist: gemini-mcp-gateway) through uv. No core logic lives here.
|
|
5
5
|
Version lockstep: this package's version == the PyPI pin. */
|
|
6
6
|
const { spawnSync } = require("node:child_process");
|
|
7
|
+
const fs = require("node:fs");
|
|
8
|
+
const os = require("node:os");
|
|
9
|
+
const path = require("node:path");
|
|
7
10
|
const CORE = "gemini-mcp-gateway";
|
|
8
11
|
const VER = require("../package.json").version;
|
|
12
|
+
const win = process.platform === "win32";
|
|
13
|
+
const HINT = "hint: install uv once: " + (win
|
|
14
|
+
? 'powershell -c "irm https://astral.sh/uv/install.ps1 | iex"'
|
|
15
|
+
: "curl -LsSf https://astral.sh/uv/install.sh | sh");
|
|
9
16
|
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
function findUvx() {
|
|
18
|
+
if (!win) {
|
|
19
|
+
const hit = spawnSync("sh", ["-c", "command -v uvx"], { encoding: "utf8" });
|
|
20
|
+
if (hit.status === 0 && hit.stdout.trim()) return hit.stdout.trim();
|
|
21
|
+
}
|
|
22
|
+
// MCP clients often launch with a minimal PATH — probe the usual homes too.
|
|
23
|
+
for (const d of [path.join(os.homedir(), ".local", "bin"),
|
|
24
|
+
path.join(os.homedir(), ".cargo", "bin"),
|
|
25
|
+
"/opt/homebrew/bin", "/usr/local/bin"]) {
|
|
26
|
+
const p = path.join(d, win ? "uvx.exe" : "uvx");
|
|
27
|
+
if (fs.existsSync(p)) return p;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let uvx = findUvx();
|
|
33
|
+
if (!uvx) {
|
|
34
|
+
// uv is NOT distributed via npm — bootstrap with the official standalone
|
|
35
|
+
// installer (one time), without touching shell rc files.
|
|
36
|
+
console.error("gemini-mcp: uv not found — running the official astral.sh installer (one time)…");
|
|
37
|
+
const r = win
|
|
38
|
+
? spawnSync("powershell", ["-ExecutionPolicy", "ByPass", "-c",
|
|
39
|
+
"irm https://astral.sh/uv/install.ps1 | iex"], { stdio: "inherit" })
|
|
40
|
+
: spawnSync("sh", ["-c",
|
|
41
|
+
"curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh"],
|
|
42
|
+
{ stdio: "inherit" });
|
|
43
|
+
uvx = (r.status === 0 && findUvx()) || null;
|
|
44
|
+
}
|
|
45
|
+
if (!uvx) {
|
|
46
|
+
console.error(`gemini-mcp: bootstrap failed: uv unavailable\n${HINT}`);
|
|
47
|
+
process.exit(1);
|
|
14
48
|
}
|
|
15
|
-
const [cmd, base] = uvx();
|
|
16
49
|
// bin name != dist name: uvx needs --from (verified against PyPI 0.7.1)
|
|
17
|
-
const res = spawnSync(
|
|
18
|
-
...process.argv.slice(2)],
|
|
19
|
-
{ stdio: "inherit" });
|
|
50
|
+
const res = spawnSync(uvx, ["--from", `${CORE}==${VER}`, "gemini-mcp",
|
|
51
|
+
...process.argv.slice(2)], { stdio: "inherit" });
|
|
20
52
|
if (res.error) {
|
|
21
|
-
console.error(`gemini-mcp: bootstrap failed: ${res.error.message}`);
|
|
22
|
-
console.error("hint: install uv once: curl -LsSf https://astral.sh/uv/install.sh | sh");
|
|
53
|
+
console.error(`gemini-mcp: bootstrap failed: ${res.error.message}\n${HINT}`);
|
|
23
54
|
process.exit(1);
|
|
24
55
|
}
|
|
25
56
|
process.exit(res.status == null ? 1 : res.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vernikr/gemini-mcp",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "One-command Gemini free-tier MCP gateway: quota-aware model routing, massive-body chunked analysis, file ingest (RTF/DOCX→Markdown), async tickets. Thin bootstrap for the Python core gemini-mcp-gateway.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gemini-mcp": "bin/gemini-mcp.js"
|