Skip to content

Feature Request: Add CLI commands to dynamically enable/disable MCP servers without editing config #2617

@JordiNodeJS

Description

@JordiNodeJS

What would you like to be added?

I would like to add CLI commands or an interactive menu to dynamically enable/disable MCP (Model Context Protocol) servers at runtime, without having to manually edit configuration files.

Proposed commands:

# Enable/disable specific MCP servers
qwen mcp enable <server-name>
qwen mcp disable <server-name>

# Or toggle with a flag
qwen mcp toggle <server-name>

# List available MCPs with their status
qwen mcp list --status

Alternatively, enhance the existing qwen mcp interactive dialog to include enable/disable toggles for configured servers.

The current qwen mcp add and qwen mcp remove commands exist, but they add/remove servers entirely rather than enabling/disabling them temporarily. A toggle mechanism would preserve the configuration while allowing dynamic control.

Why is this needed?

Currently, to enable or disable an MCP server, users must:

  1. Manually edit the settings.json file (either project-level or user-level)
  2. Restart the session for changes to take effect

This is problematic for users who:

  • Work with multiple projects requiring different MCP configurations
  • Want to temporarily disable certain MCPs for testing or debugging
  • Need to switch between different tool sets frequently
  • Want to disable unused MCPs to reduce overhead during specific tasks

A toggle mechanism would improve the developer experience and make MCP management more flexible for power users.

Additional context

Related documentation: https://qwenlm.github.io/qwen-code-docs/zh/users/features/mcp/

This feature would complement the existing qwen mcp add and qwen mcp remove commands by providing a middle ground for temporary configuration changes.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions