MCP server-level trust silently approves all future tools from a trusted server (no first-seen confirmation)

Open
#30,369 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
cli, security

Research direction

Start with packages/core/src/tools/mcp-tool.ts, especially getConfirmationDetails(), and trace how mcpServerConfig.trust and the server-name allowlist affect confirmation for tools added later. Then review the policy engine’s existing confirmation rules. Done when newly seen tools from a trusted server receive the intended confirmation or policy behavior, with tests covering both existing and newly added tools.

Written by the indexing model from the issue text.

Description

status/need-triage

Server-level MCP trust skips confirmation for every tool the server serves, including tools added after the user approved

Type: trust-granularity architecture (verified against current main source)

The code

packages/core/src/tools/mcp-tool.ts, getConfirmationDetails():

if (this.cliConfig?.isTrustedFolder() && this.trust) {
  return false; // server is trusted, no confirmation needed
}

this.trust comes from mcpServerConfig.trust — a per-server flag. The confirmation skip therefore applies to every tool the server currently serves and ever will serve: the allowlist key is serverName, and a tool added by the server after the user granted trust inherits the same silent 'allow'.

An MCP server's tool list is remote-controlled (stdio process or HTTP with mutable registry). The user's mental model when setting trust: true is "I trust this server as I saw it" — but the effective grant is "I trust every future tool this server declares", with no re-confirmation and no first-seen prompt for new tools.

Why this matters

This same pattern exists in downstream forks of this codebase (qwen-code, where I filed a corresponding issue today). Gemini CLI is the origin of the family, and it has no classifier-layer backstop: the policy engine's git-command hardening (line ~450: forcing ASK_USER for git in untrusted workspaces) shows the codebase already knows trust must be re-verified per-call for shell — the same reasoning should apply to remote-declared MCP tools.

Suggested direction

Keep server-level trust as transport trust (spawn/connect/health-check), but either:

  • prompt once per newly seen tool on trusted servers (first-seen confirmation), or
  • expose a policy-engine knob (mcp.trust.mode = server | tool) defaulting to tool.

Happy to elaborate on the cross-framework comparison if useful.

Dominant language
TypeScript
Stars
109k
Forks
15k
Avg merge
1d 1h
Merged PRs (30d)
106

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google-gemini/gemini-cli

All issues in google-gemini/gemini-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.