Skip to content

--disable-mcp-server flag ignored in -p (prompt) mode since v0.0.363 #725

@oaa8

Description

@oaa8

Describe the bug

When using --disable-mcp-server with -p (prompt) mode, the specified MCP server's tools are still available to the model. The flag is being ignored.

Affected version

0.0.363+

Steps to reproduce the behavior

  1. Have an MCP server configured (e.g., Playwright)
  2. Run: copilot -p "What playwright tools do you see?" --disable-mcp-server Playwright
  3. Observe that Playwright tools are still listed in the response

Expected behavior

The Playwright MCP server tools should not be available to the model when --disable-mcp-server Playwright is specified. The model should report no Playwright tools.

Additional context

  • Operating system: Windows 11
  • Shell: PowerShell

Regression info:

  • Works correctly in v0.0.357 and earlier (Playwright tools are hidden when disabled)
  • v0.0.358-0.0.362 had MCP tools removed from -p mode entirely (separate bug)
  • v0.0.363 restored MCP to -p mode but broke --disable-mcp-server flag
  • Bug persists through v0.0.367 (latest)

The regression was likely introduced in v0.0.363 when MCP support was restored to prompt mode - the --disable-mcp-server filtering isn't being applied in that code path.


Apart from Copilot's description that was made above, I can add that this reproduces on mac and it seems that disabling MCP servers interactively with /mcp disable Playwright doesn't work even though I get the confirmation that MCP server "Playwright" is already disabled.

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority-2Bug that affects more than a few users in a meaningful way but doesn't prevent core functions

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions