Add --npm-auto-yes flag to claude mcp add command

Resolved 💬 3 comments Opened Sep 19, 2025 by ExpertVagabond Closed Jan 6, 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

Problem Statement

The current claude mcp add command doesn't include the -y flag when
generating NPX commands, causing MCP servers to fail connection. This
creates a significant limitation where:

  • Claude CLI: Only 7/12 servers work (local + some NPX packages)
  • Claude Desktop: All 12 servers work perfectly with manually added

-y flags

Proposed Solution

When running:
```bash
claude mcp add filesystem npx "@modelcontextprotocol/server-filesystem"
"/Users/dev"

Claude CLI generates:
{
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/Users/dev"]
}
}

NPX fails because it needs:
{
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem",
"/Users/dev"]
}
}

Proposed Solution

Add a --npm-auto-yes or -y flag to the claude mcp add command:

claude mcp add filesystem npx "@modelcontextprotocol/server-filesystem"
"/Users/dev" --npm-auto-yes

This would automatically inject the -y flag for NPX commands.

Technical Implementation

Option 1: Automatic Detection

Automatically detect when command is npx and prepend -y to args array.

Alternative Solutions

Option 2: Explicit Flag

Add --npm-auto-yes flag that users can specify when adding NPX-based
servers.

Option 3: Default Behavior

Make -y the default for all NPX commands since it's almost always needed
in automation contexts.

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

Example Usage

# Current (fails)
claude mcp add filesystem npx "@modelcontextprotocol/server-filesystem"
"/Users/dev"

# Proposed (works)
claude mcp add filesystem npx "@modelcontextprotocol/server-filesystem"
"/Users/dev" --npm-auto-yes

# Or automatic detection
claude mcp add filesystem npx "@modelcontextprotocol/server-filesystem"
"/Users/dev"
# Would automatically add -y flag

This feature would make Claude CLI's MCP functionality fully
feature-complete and eliminate a major user experience gap.

Additional Context

Current Workaround

Users must manually edit Claude Desktop config files to add -y flags,
which works but creates inconsistency between CLI and Desktop
configurations.

User Benefits

  • Consistency: Same behavior between CLI and Desktop
  • Reliability: All NPX-based MCP servers work without manual configuration
  • Ease of Use: Single command setup for any MCP server type
  • Developer Experience: No need to manually edit JSON config files

Impact

This would:

  • ✅ Make Claude CLI fully compatible with all NPX-based MCP servers
  • ✅ Eliminate the discrepancy between CLI and Desktop configurations
  • ✅ Improve user experience for MCP server setup
  • ✅ Enable all 12+ servers to work in both CLI and Desktop environments

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗