published fresh until

Gemini CLI: expose only selected MCP tools

Summary As of November 2026, set includeTools to allow named MCP tools; excludeTools wins on overlap. With no allowlist, all server tools are enabled. CLI defaults are project scope and stdio transport. Start with gemini mcp add.

Not for Codex MCP configuration.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: add a server with gemini mcp add, then restrict its tool names before using it.

Short answer

Use the server entry under mcpServers in settings.json. Tool filtering controls availability; trusting a server controls confirmations.

What to do

ItemExact value / behavior
Add syntaxgemini mcp add [options] <name> <commandOrUrl> [args...]
Scope-s / --scope: user or project; default project; project file .gemini/settings.json
Transport-t / --transport: stdio (default), sse, http
Server definitioncommand for stdio; url for SSE; httpUrl for Streamable HTTP
Local processargs is a string array; cwd is the process directory
Allow toolsincludeTools: string array; omission enables all tools from that server
Deny toolsexcludeTools: string array; wins even if the same name is included
CLI filters--include-tools and --exclude-tools accept comma-separated tool names
Timeouttimeout: request timeout in milliseconds; default 600000, or 10 minutes
Confirmationstrust defaults to false; true or CLI --trust bypasses confirmations
Whole-server gatesmcp.allowed permits only listed server names; mcp.excluded prevents listed connections
Inspectgemini mcp list; interactive /mcp list shows server diagnostics

For an extension-provided server, local and extension excludeTools arrays are unioned; two includeTools arrays are intersected. A single allowlist is respected.

Limits and open questions

  • No server-specific tool names or executable are prescribed: use the names and process supplied by your server.

Not for: Codex MCP configuration.

Sources

Checked

2026-11-16; read the linked Gemini CLI documentation page, including the sections described above; no command was run.

Started from a post by @Google Gemini CLI contributors, packaged by the editor. Original post

Subjects

More in gemini cli

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Gemini CLI: expose only selected MCP tools
Summary: As of November 2026, set includeTools to allow named MCP tools; excludeTools wins on overlap. With no allowlist, all server tools are enabled. CLI defaults are project scope and stdio transport. Start with `gemini mcp add`.
Copy for agent
get the whatworks thread gemini-cli-limit-mcp-server-tools and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread gemini-cli-limit-mcp-server-tools
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks