@vernikr/gemini-mcp 0.8.1 → 0.9.0

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.
Files changed (2) hide show
  1. package/README.md +93 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,19 +1,99 @@
1
1
  # @vernikr/gemini-mcp
2
2
 
3
- One-command Gemini **free-tier** MCP gateway (Python core: `gemini-mcp-gateway` on PyPI,
4
- bootstrapped via [uv](https://docs.astral.sh/uv/) — no system Python needed). Works
5
- **without any server**: default `direct` mode talks to Google AI Studio straight from
6
- your machine; `router` mode joins a fleet gateway with a shared quota ledger.
3
+ Gemini **free-tier** MCP gateway that needs **no server**: your MCP client (Freebuff,
4
+ Claude Desktop, Cursor, …) talks to Google AI Studio through a quota-aware router —
5
+ cascading Flash chain, per key×model RPD/RPM/TPM budgeting, minute-limit waiting,
6
+ massive-body chunked analysis with consolidation. Python core `gemini-mcp-gateway`
7
+ (PyPI), bootstrapped via [uv](https://docs.astral.sh/uv/) — no system Python needed.
8
+
9
+ ## Get API keys (free)
10
+
11
+ <https://aistudio.google.com/app/apikey> — several keys = several times the quota
12
+ (20 requests/day per key×model).
13
+
14
+ ## Wiring — 2 options
15
+
16
+ ### A · Wizard (recommended): `setup`, then paste one JSON block
7
17
 
8
18
  ```bash
9
- pnpm dlx @vernikr/gemini-mcp setup # wizard: AI Studio keys → ~/.config/gemini-mcp
10
- # → live key probe → client snippets
11
- pnpm dlx @vernikr/gemini-mcp doctor # self-check with fix commands
12
- pnpm dlx @vernikr/gemini-mcp quota # free-tier budget table
13
- pnpm dlx @vernikr/gemini-mcp uninstall --yes # remove keys+config
19
+ pnpm dlx @vernikr/gemini-mcp setup
20
+ ```
21
+
22
+ What it does — and what it does NOT:
23
+
24
+ - asks one question (simple/direct vs fleet/router; pick **1**);
25
+ - takes keys through a **masked** prompt and stores them in `~/.config/gemini-mcp/.env`
26
+ (mode `0600` — the only place keys live), plus a minimal `config.yaml`;
27
+ - probes keys live (listModels — zero quota spent) and prints fingerprints, never keys;
28
+ - **prints** the ready `mcpServers` JSON for your client — it does **not** edit any
29
+ client config itself (formats differ per client; you paste the block once).
30
+
31
+ After the wizard the client JSON needs no env/keys — the gateway auto-discovers
32
+ `~/.config/gemini-mcp/`:
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "gemini": { "command": "npx", "args": ["-y", "@vernikr/gemini-mcp", "stdio"] }
38
+ }
39
+ }
40
+ ```
41
+
42
+ ### B · JSON-only (skip the wizard entirely)
43
+
44
+ Is pasting JSON into `mcp.json` enough? **Yes — if the keys travel with it** (without
45
+ keys anywhere the gateway fails fast by design). Inline in `env`:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "gemini": {
51
+ "command": "npx",
52
+ "args": ["-y", "@vernikr/gemini-mcp", "stdio"],
53
+ "env": { "GEMINI_API_KEYS": "AIza…key1,AIza…key2" }
54
+ }
55
+ }
56
+ }
14
57
  ```
15
58
 
16
- Features: quota-aware routing across the Flash chain (two routes: `optimal` /
17
- `best_available`), massive-body chunked analysis with consolidation, file ingest with
18
- server-side RTF/DOCX→Markdown extraction, async tickets for long jobs, structured
19
- agent-facing errors. Repo: github.com/vernikr/gemini-mcp
59
+ …or — more private, secrets stay out of the client config — point at a keys **file**
60
+ (comma/whitespace/newline separated, `#` comments ok):
61
+
62
+ ```json
63
+ { "env": { "GEMINI_MCP_KEYS_FILE": "/absolute/path/keys.txt" } }
64
+ ```
65
+
66
+ Key sources, priority high → low: `--keys` / `--keys-file` CLI flags (any command,
67
+ before the subcommand) → `GEMINI_MCP_KEYS_FILE` → `router.keys_file` in config.yaml →
68
+ `GEMINI_API_KEYS` env (this is what the wizard's `.env` provides).
69
+
70
+ Backend auto-resolves to `direct`; logs and the local usage ledger (`state.db` —
71
+ quota counters survive restarts) go to `~/.config/gemini-mcp/`. Trade-off vs option A:
72
+ keys sit in the client config file instead of a `0600` `.env`.
73
+
74
+ Where to paste (restart the client fully afterwards): Freebuff `~/.agents/mcp.json` ·
75
+ Claude Desktop `~/Library/Application Support/Claude/claude_desktop_config.json` ·
76
+ Cursor `~/.cursor/mcp.json`. First launch pays a one-time uv resolve (~10–20 s).
77
+
78
+ ## Commands
79
+
80
+ ```bash
81
+ pnpm dlx @vernikr/gemini-mcp doctor # keys, chain, limits, live probe, ledger
82
+ pnpm dlx @vernikr/gemini-mcp quota # per key×model budget table (live)
83
+ pnpm dlx @vernikr/gemini-mcp calls -n 20 # local audit tail
84
+ pnpm dlx @vernikr/gemini-mcp uninstall --yes # remove keys, config and ledger
85
+ ```
86
+
87
+ All commands accept `--json` (agent-facing output). MCP tools: `analyze_large`,
88
+ `gemini_generate`, `analyze_file` (server-side RTF/DOCX extraction), `analyze_result`,
89
+ `quota_status`, `router_logs`. Every compute answer starts with a one-line `report`
90
+ (`backend=direct · route=… · model=… · req=N · …s · clean run`).
91
+
92
+ ## How the shim works
93
+
94
+ `bin/gemini-mcp.js` is a ~30-line bootstrap: it runs the version-pinned Python core
95
+ (`uvx --from gemini-mcp-gateway==<same version> gemini-mcp …`), self-installing uv
96
+ through `npx -y @astral-sh/uv` when needed. Zero logic in JS; npm ↔ PyPI versions are
97
+ lockstep. Fleet mode (shared quota ledger on your own server) and full docs:
98
+ [github.com/vernikr/gemini-mcp](https://github.com/vernikr/gemini-mcp) —
99
+ `docs/06-consumer.md`, `docs/08-dual-mode.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vernikr/gemini-mcp",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
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"