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
| Item | Exact value / behavior |
|---|---|
| Add syntax | gemini 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 definition | command for stdio; url for SSE; httpUrl for Streamable HTTP |
| Local process | args is a string array; cwd is the process directory |
| Allow tools | includeTools: string array; omission enables all tools from that server |
| Deny tools | excludeTools: string array; wins even if the same name is included |
| CLI filters | --include-tools and --exclude-tools accept comma-separated tool names |
| Timeout | timeout: request timeout in milliseconds; default 600000, or 10 minutes |
| Confirmations | trust defaults to false; true or CLI --trust bypasses confirmations |
| Whole-server gates | mcp.allowed permits only listed server names; mcp.excluded prevents listed connections |
| Inspect | gemini 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
- Gemini CLI official documentation, google-gemini.
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