What would you like to be added?
Add support for project-scoped .mcp.json MCP server configuration, with an explicit pending-approval state before any server is started or connected.
Suggested behavior:
- If a workspace contains
.mcp.json, qwen mcp list can show its servers with a Pending approval status before the user has approved them.
qwen mcp get <name> can show the server config and pending status.
- Pending project-scoped servers must not spawn stdio processes, attempt remote transport connections, or run health checks.
- Once the user explicitly approves a project-scoped server, it can use the normal connection and health-check behavior.
- The approval decision should bind to a canonicalized hash of the server config, not just the server name. If
.mcp.json is later modified, the affected server returns to Pending approval and must be re-approved. This prevents a previously-approved name from being silently repointed to a different command/args/env or transport endpoint after approval. (Thanks to @Ram9199 for raising this.)
- Existing settings-based, CLI-provided, and extension-provided MCP configs should keep their current behavior unless they are moved under the new project-scoped approval model.
Why is this needed?
Qwen Code currently supports MCP servers from settings, --mcp-config, and extensions. A project-scoped .mcp.json would be useful for sharing MCP setup with a repository, but it has a different trust profile: the file comes from the workspace and may be untrusted.
Listing configured MCP servers is an inspection action. If project-scoped MCP config is added, inspecting it should remain side-effect-free until the user explicitly approves the server. This avoids executing workspace-controlled commands just because the user viewed MCP configuration.
Binding approval to a config hash closes a related gap: approval should be about the exact configuration the user reviewed, so any change to the underlying command, arguments, environment, or transport invalidates the prior approval rather than inheriting trust by name.
Additional context
This request is specifically about adding project-scoped .mcp.json support with safe default behavior. It should not imply that .mcp.json is already loaded today.
What would you like to be added?
Add support for project-scoped
.mcp.jsonMCP server configuration, with an explicit pending-approval state before any server is started or connected.Suggested behavior:
.mcp.json,qwen mcp listcan show its servers with aPending approvalstatus before the user has approved them.qwen mcp get <name>can show the server config and pending status..mcp.jsonis later modified, the affected server returns toPending approvaland must be re-approved. This prevents a previously-approved name from being silently repointed to a different command/args/env or transport endpoint after approval. (Thanks to @Ram9199 for raising this.)Why is this needed?
Qwen Code currently supports MCP servers from settings,
--mcp-config, and extensions. A project-scoped.mcp.jsonwould be useful for sharing MCP setup with a repository, but it has a different trust profile: the file comes from the workspace and may be untrusted.Listing configured MCP servers is an inspection action. If project-scoped MCP config is added, inspecting it should remain side-effect-free until the user explicitly approves the server. This avoids executing workspace-controlled commands just because the user viewed MCP configuration.
Binding approval to a config hash closes a related gap: approval should be about the exact configuration the user reviewed, so any change to the underlying command, arguments, environment, or transport invalidates the prior approval rather than inheriting trust by name.
Additional context
This request is specifically about adding project-scoped
.mcp.jsonsupport with safe default behavior. It should not imply that.mcp.jsonis already loaded today.