mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
fix: remove redundant scope field from MCP server display and add CONCAT merge strategy for mcp allowed/excluded lists
This commit is contained in:
parent
817f24e0ea
commit
d32dcab5db
6 changed files with 11 additions and 20 deletions
|
|
@ -95,16 +95,10 @@ export const MCPManagementDialog: React.FC<MCPManagementDialogProps> = ({
|
|||
let source: 'user' | 'project' | 'extension' = 'user';
|
||||
if (serverConfig.extensionName) {
|
||||
source = 'extension';
|
||||
}
|
||||
|
||||
// Determine the scope of the configuration
|
||||
let scope: 'user' | 'workspace' | 'extension' = 'user';
|
||||
if (serverConfig.extensionName) {
|
||||
scope = 'extension';
|
||||
} else if (workspaceSettings.mcpServers?.[name]) {
|
||||
scope = 'workspace';
|
||||
source = 'project';
|
||||
} else if (userSettings.mcpServers?.[name]) {
|
||||
scope = 'user';
|
||||
source = 'user';
|
||||
}
|
||||
|
||||
// Use config.isMcpServerDisabled() to check if server is disabled
|
||||
|
|
@ -119,7 +113,6 @@ export const MCPManagementDialog: React.FC<MCPManagementDialogProps> = ({
|
|||
name,
|
||||
status,
|
||||
source,
|
||||
scope,
|
||||
config: serverConfig,
|
||||
toolCount: serverTools.length,
|
||||
invalidToolCount,
|
||||
|
|
@ -343,7 +336,7 @@ export const MCPManagementDialog: React.FC<MCPManagementDialogProps> = ({
|
|||
|
||||
// Determine the scope based on server configuration location
|
||||
let targetScope: 'user' | 'workspace' = 'user';
|
||||
if (server.scope === 'extension') {
|
||||
if (server.source === 'extension') {
|
||||
// Extension servers should not be disabled through user/workspace settings
|
||||
// Show error message and return
|
||||
debugLogger.warn(
|
||||
|
|
@ -351,7 +344,7 @@ export const MCPManagementDialog: React.FC<MCPManagementDialogProps> = ({
|
|||
);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
} else if (server.scope === 'workspace') {
|
||||
} else if (server.source === 'project') {
|
||||
targetScope = 'workspace';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue