Configure MCP servers in settings.json

mcp & extensions

// what it does

The mcpServers object in settings.json is the declarative form of gemini mcp add. Each server needs one of command (stdio), url (SSE), or httpUrl (HTTP), plus optional args, env, cwd, and timeout (default 600000 ms). Restrict its surface with includeTools (whitelist) or excludeTools (blacklist), and set trust: true to skip per-call confirmation.

// shell

$ /mcp

// gotcha

trust: true auto-approves every tool from that server with no prompt — reserve it for servers you control, since it removes the safety net for destructive actions. excludeTools takes precedence over includeTools when both list the same tool.

// resources