claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] MCP server 'args' configuration ignored - servers launched without specified arguments

Open GitlyHallows opened this issue 1 year ago • 4 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code ignores the args field in MCP server configuration (~/.claude.json), launching MCP servers without passing the specified command-line arguments. This prevents proper configuration of MCP servers that require arguments to function correctly.

What Should Happen?

Claude Code should pass all arguments specified in the args array of an MCP server configuration to the server process when launching it, similar to how other MCP-compatible tools (like codex) handle the same configuration.

Error Messages/Logs

No error messages - the server launches but silently ignores configured arguments.

Steps to Reproduce

Install Brave Browser on Mac

Configure an MCP server with arguments in ~/.claude.json:

{
  "mcpServers": {
      "playwright": {
          "command": "/opt/homebrew/bin/npx",
          "args": [
            "@playwright/mcp@latest",
            "--extension",
            "--executable-path=/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
          ]
      }
  }
}

Start Claude Code: claude --debug

Check the running process: ps aux | grep mcp-server-playwright

Actual result: Process runs without arguments:

node /Users/alex/.npm/_npx/9833c18b2d85bc59/node_modules/.bin/mcp-server-playwright

Expected result: Process should run with configured arguments:

node /Users/alex/.npm/_npx/9833c18b2d85bc59/node_modules/.bin/mcp-server-playwright --extension --executable-path=/Applications/Brave Browser.app/Contents/MacOS/Brave Browser

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

1.0.120 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The same MCP configuration works correctly in codex and other MCP-compatible agents.

Debug logs show MCP server connecting successfully but don't show the command/args being used

This affects any MCP server that requires command-line arguments

GitlyHallows avatar Sep 23 '25 21:09 GitlyHallows

From your output, it looks like Claude Code IS passing the arguments. Here is the command you're trying to run:

/opt/homebrew/bin/npx @playwright/mcp@latest ...

If there weren't any arguments passed, this is the command you'd actually run: /opt/homebrew/bin/npx (note how it doesn't include anything related to playwright)

This is the process you're seeing:

node /Users/alex/.npm/_npx/9833c18b2d85bc59/node_modules/.bin/mcp-server-playwright (note how this IS running playwright)

This means Claude Code is passing the arguments to npx, and the problem lies elsewhere. So this isn't a bug in Claude Code. It's either in npx or in whatever wrapper scripts are in between that and what actually launch the code. I can't help any further, I use pnpm and pnpm dlx.

brandon-fryslie avatar Oct 23 '25 20:10 brandon-fryslie

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 11 '25 10:12 github-actions[bot]

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] avatar Jan 13 '26 10:01 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Jan 21 '26 14:01 github-actions[bot]