@@ -12,13 +12,14 @@ import { assertType } from '../../../../../base/common/types.js';
1212import { generateUuid } from '../../../../../base/common/uuid.js' ;
1313import { localize } from '../../../../../nls.js' ;
1414import { ICommandService } from '../../../../../platform/commands/common/commands.js' ;
15+ import { ExtensionIdentifier } from '../../../../../platform/extensions/common/extensions.js' ;
1516import { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js' ;
1617import { IQuickInputButton , IQuickInputService , IQuickPickItem , IQuickPickSeparator } from '../../../../../platform/quickinput/common/quickInput.js' ;
1718import { IEditorService } from '../../../../services/editor/common/editorService.js' ;
18- import { IExtensionsWorkbenchService } from '../../../extensions/common/extensions.js' ;
19+ import { ExtensionEditorTab , IExtensionsWorkbenchService } from '../../../extensions/common/extensions.js' ;
1920import { McpCommandIds } from '../../../mcp/common/mcpCommandIds.js' ;
2021import { IMcpRegistry } from '../../../mcp/common/mcpRegistryTypes.js' ;
21- import { IMcpServer , IMcpService , McpConnectionState } from '../../../mcp/common/mcpTypes.js' ;
22+ import { IMcpServer , IMcpService , IMcpWorkbenchService , McpConnectionState , McpServerEditorTab } from '../../../mcp/common/mcpTypes.js' ;
2223import { ILanguageModelToolsService , IToolData , ToolDataSource , ToolSet } from '../../common/languageModelToolsService.js' ;
2324import { ConfigureToolSets } from '../tools/toolSetsContribution.js' ;
2425
@@ -59,8 +60,9 @@ export async function showToolsPicker(
5960 const mcpService = accessor . get ( IMcpService ) ;
6061 const mcpRegistry = accessor . get ( IMcpRegistry ) ;
6162 const commandService = accessor . get ( ICommandService ) ;
62- const extensionWorkbenchService = accessor . get ( IExtensionsWorkbenchService ) ;
63+ const extensionsWorkbenchService = accessor . get ( IExtensionsWorkbenchService ) ;
6364 const editorService = accessor . get ( IEditorService ) ;
65+ const mcpWorkbenchService = accessor . get ( IMcpWorkbenchService ) ;
6466 const toolsService = accessor . get ( ILanguageModelToolsService ) ;
6567
6668 const mcpServerByTool = new Map < string , IMcpServer > ( ) ;
@@ -88,7 +90,7 @@ export async function showToolsPicker(
8890
8991 const addMcpPick : CallbackPick = { type : 'item' , label : localize ( 'addServer' , "Add MCP Server..." ) , iconClass : ThemeIcon . asClassName ( Codicon . add ) , pickable : false , run : ( ) => commandService . executeCommand ( McpCommandIds . AddConfiguration ) } ;
9092 const configureToolSetsPick : CallbackPick = { type : 'item' , label : localize ( 'configToolSet' , "Configure Tool Sets..." ) , iconClass : ThemeIcon . asClassName ( Codicon . gear ) , pickable : false , run : ( ) => commandService . executeCommand ( ConfigureToolSets . ID ) } ;
91- const addExpPick : CallbackPick = { type : 'item' , label : localize ( 'addExtension' , "Install Extension..." ) , iconClass : ThemeIcon . asClassName ( Codicon . add ) , pickable : false , run : ( ) => extensionWorkbenchService . openSearch ( '@tag:language-model-tools' ) } ;
93+ const addExpPick : CallbackPick = { type : 'item' , label : localize ( 'addExtension' , "Install Extension..." ) , iconClass : ThemeIcon . asClassName ( Codicon . add ) , pickable : false , run : ( ) => extensionsWorkbenchService . openSearch ( '@tag:language-model-tools' ) } ;
9294 const addPick : CallbackPick = {
9395 type : 'item' , label : localize ( 'addAny' , "Add More Tools..." ) , iconClass : ThemeIcon . asClassName ( Codicon . add ) , pickable : false , run : async ( ) => {
9496 const pick = await quickPickService . pick (
@@ -143,7 +145,13 @@ export async function showToolsPicker(
143145 toolBuckets . set ( key , bucket ) ;
144146
145147 const collection = mcpRegistry . collections . get ( ) . find ( c => c . id === mcpServer . collection . id ) ;
146- if ( collection ?. presentation ?. origin ) {
148+ if ( collection ?. source ) {
149+ buttons . push ( {
150+ iconClass : ThemeIcon . asClassName ( Codicon . settingsGear ) ,
151+ tooltip : localize ( 'configMcpCol' , "Configure {0}" , collection . label ) ,
152+ action : ( ) => collection . source ? collection . source instanceof ExtensionIdentifier ? extensionsWorkbenchService . open ( collection . source . value , { tab : ExtensionEditorTab . Features , feature : 'mcp' } ) : mcpWorkbenchService . open ( collection . source , { tab : McpServerEditorTab . Configuration } ) : undefined
153+ } ) ;
154+ } else if ( collection ?. presentation ?. origin ) {
147155 buttons . push ( {
148156 iconClass : ThemeIcon . asClassName ( Codicon . settingsGear ) ,
149157 tooltip : localize ( 'configMcpCol' , "Configure {0}" , collection . label ) ,
0 commit comments