Skip to content

Feature request: per-invocation MCP control in headless print mode (--no-mcp / --mcp-config) #342

@sumitake

Description

@sumitake

Summary

Please add a way to disable or scope MCP servers per-invocation in headless print mode (-p / --print) — e.g. a --no-mcp flag and/or a --mcp-config <path> override.

Motivation

We run agy -p programmatically (CI, multi-agent orchestration, scripted code reviews) where the prompt is self-contained and the model is explicitly instructed not to use tools. In that mode, the globally-configured MCP servers (~/.gemini/config/mcp_config.json) are pure startup overhead — every headless call still initializes all of them.

Concretely: on this machine a trivial agy -p "reply OK" takes ~9s, the same as a substantial review, because startup (incl. loading 6 MCP servers) dominates over the model round-trip. There is currently no CLI surface to skip MCP for a single call — --dangerously-skip-permissions only auto-approves, and there is no --no-mcp / --mcp-config flag (verified against agy --help on 1.0.6).

Proposed solutions (any one would help)

  1. --no-mcp — start the print-mode session with zero MCP servers loaded.
  2. --mcp-config <path> — point a single invocation at an alternate (e.g. empty) MCP config, leaving the global interactive config untouched.
  3. An env var (e.g. AGY_CLI_NO_MCP=1) honored in print mode.

Why per-invocation (not global)

Disabling MCP globally would degrade the operator's interactive sessions, which legitimately use those tools. Automation just needs a per-call opt-out so headless calls aren't taxed by tooling they never invoke.

Environment

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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