[FEATURE] --safe-mode should keep MCP servers passed explicitly with --mcp-config (the subscription path for claude -p once --bare is the default)

Status Open
Reported on v2.1.295
Maintainer reply None cached
Activity 0 comments · opened Oct 12, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

claude -p with a Claude subscription sign-in is how I run Claude Code headless from a desktop app on my own computer. The app gives Claude its tools through one local MCP server, passed with --strict-mcp-config --mcp-config <file>.

The headless docs say "--bare is the recommended mode for scripted and SDK calls, and will become the default for -p in a future release", and "In bare mode, Claude Code never reads OAuth credentials or the system keychain." So once that ships, -p stops working with a subscription.

In #38022 (now locked) the suggested path for subscription users was --safe-mode with -p. I tested it on 2.1.295: the subscription sign-in works, but no MCP server loads, including one passed explicitly with --mcp-config and --strict-mcp-config. The model is offered none of the app's tools. Without --safe-mode the same command offers and calls them. This matches the CLI reference, which lists MCP servers among what --safe-mode turns off, so this is a request, not a bug report.

Proposed Solution

Under --safe-mode, keep loading MCP servers that are passed explicitly on the command line with --mcp-config (at least together with --strict-mcp-config), while still skipping discovered ones (~/.claude.json, the project's .mcp.json, plugins). That matches how --bare already treats them: "connect only the MCP servers named on the command line" (CHANGELOG).

Alternative Solutions

Or please don't make --bare the default for -p. Running my own custom applications on Claude Code is a big part of why I pay $200 a month or more for Max, and a bare default would take that away.

If the default does change: a documented opt-out that keeps -p non-bare with the subscription sign-in (for example a flag or setting), or a note in the docs on the supported way for subscription users to run -p with their own MCP tools.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

claude -p --safe-mode --strict-mcp-config --mcp-config ./tools.json --input-format stream-json --output-format stream-json
Today: signed in on my plan, no tools. Wanted: signed in on my plan, the tools from tools.json available, nothing else from my personal setup loaded.

Additional Context

Related: #38022 (locked), #79738 (--bare breaks OAuth sign-in), #88922 (Max users can't use --bare), the headless and CLI reference docs. A date or version for the --bare default would also help anyone planning around it.

I'm not the only one: #38022 has 35 thumbs up, and commenters there raised this same worry about the default.

View original on GitHub ↗