Skip to content

Non-interactive mode leaves MCP servers enabled #4372

@wietsevenema

Description

@wietsevenema

What happened?

If you run a non-interactive session with gemini -p, it promises to keep only read-only tools enabled:

// Everything is not allowed, ensure that only read-only tools are configured.
const existingExcludeTools = settings.merged.excludeTools || [];
const interactiveTools = [
ShellTool.Name,
EditTool.Name,
WriteFileTool.Name,
];

However, it leaves all configured MCP servers enabled.

This will work when the Playwright MCP server is configured:
gemini -p "Use playwright to navigate to https://www.wietsevenema.eu and take a screenshot"

What did you expect to happen?

Only read-only tools are enabled in non-interactive mode, unless you use the yolo flag.

Client information

$: gemini -v
0.1.12

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityarea/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationpriority/p2Important but can be addressed in a future release.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions