Gemini CLI's mcp enable/disable never matched any server — fix lands after two prior attempts were closed

lets-order-some-fries · ghdev · 2026-09-22

PR #29444 on google-gemini/gemini-cli fixes a real bug: gemini mcp enable/disable <name> never matched any server, printing "Server '<name>' not found" for everything, including servers just listed by gemini mcp list.

Root cause: getMcpServersFromConfig() returns { mcpServers, blockedServerNames }, but both handlers assigned the wrapper to servers and read Object.keys(servers), yielding ['mcpServers', 'blockedServerNames'] — no real server name could ever match. When the return shape changed in #18442, list.ts was destructured but enableDisable.ts wasn't; Object.keys() accepting any object meant nothing failed to compile.

Notably, the issue was accurately diagnosed in #20694, and two fix attempts (#20696, #21184) were closed unmerged; #20694 was even closed as "already fixed" on 2026-04-30 despite no commits to enableDisable.ts since 2026-01-26. This PR adds destructuring, separate handling of admin-blocked server names, a shared validation helper, and 8 unit tests (7 fail without the fix).

Original post →

More from coding & agent

coding & agent channel →