gcmcp
v0.1.3
Published
Interactive MCP servers switcher for Gemini CLI (~/.gemini/settings.json)
Maintainers
Readme
gcmcp
Interactive CLI to toggle Gemini CLI (~/.gemini/settings.json) mcpServers on/off.
- Disabled entries are not deleted, but moved to a sidecar JSON next to the settings file, e.g.
~/.gemini/settings.json.disabled.json, so you can re‑enable them anytime. This avoids conflicts when using multiple settings files. - ESM + TypeScript, single‑file bundle via
tsup(no source map in package).
Requirements
- Node.js >= 20
Install
Use via npx (once published):
npx gcmcpOr run locally from source (see Development below).
Usage
Interactive toggle UI (default):
gcmcp # launch interactive checklist UISubcommands:
gcmcp ls # list enabled servers (use --all or --disabled)
gcmcp enable <id> # move <id> from disabled list to enabled
gcmcp disable <id> # move <id> from enabled to disabled list
gcmcp diff # show current enabled/disabled state
gcmcp diff --compose a,b # preview changes if only a,b are enabledOptions:
--dry-runto show changes without writing files (supported bytoggle/enable/disable).
Paths
- Settings:
~/.gemini/settings.json(override withGEMINI_SETTINGS_PATH). - Disabled list:
<settings path>.disabled.json(sidecar next to settings; JSON map of id -> definition).
Development
Install deps and build:
npm i
npm run build # TypeScript -> single ESM at dist/index.jsRun locally:
node dist/index.js
node dist/index.js ls --all
node dist/index.js enable <id>
node dist/index.js disable <id>Quality checks:
npm run typecheck # TypeScript type checking (no emit)
npm run lint # ESLint on .ts/.tsx
npm run validate # typecheck + lint + testsTests (Vitest):
npm testPublishing (npm)
WSL-friendly login options:
# 1) Device flow (no browser auto-open)
npm login --auth-type=web --browser=none
# 2) Legacy (if your org allows)
# npm login --auth-type=legacyOr create a classic token on npmjs.com and use a per-project .npmrc:
cp .npmrc.example .npmrc
export NPM_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxPre-flight and publish:
npm run validate
npm version patch # or minor / major
npm publish --access publicNotes:
prepackbuilds automatically; published files are limited todistandREADME.md.- Engines require Node >= 20.
Notes
- The tool never edits server definitions; it only moves entries between enabled (
settings.json.mcpServers) and disabled (disabled.json). - A single backup is written as
<settings path>.gcmcp.bak(overwritten each time).
