@@ -12,13 +12,14 @@ import { assertType } from '../../../../../base/common/types.js';
12
12
import { generateUuid } from '../../../../../base/common/uuid.js' ;
13
13
import { localize } from '../../../../../nls.js' ;
14
14
import { ICommandService } from '../../../../../platform/commands/common/commands.js' ;
15
+ import { ExtensionIdentifier } from '../../../../../platform/extensions/common/extensions.js' ;
15
16
import { ServicesAccessor } from '../../../../../platform/instantiation/common/instantiation.js' ;
16
17
import { IQuickInputButton , IQuickInputService , IQuickPickItem , IQuickPickSeparator } from '../../../../../platform/quickinput/common/quickInput.js' ;
17
18
import { IEditorService } from '../../../../services/editor/common/editorService.js' ;
18
- import { IExtensionsWorkbenchService } from '../../../extensions/common/extensions.js' ;
19
+ import { ExtensionEditorTab , IExtensionsWorkbenchService } from '../../../extensions/common/extensions.js' ;
19
20
import { McpCommandIds } from '../../../mcp/common/mcpCommandIds.js' ;
20
21
import { 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' ;
22
23
import { ILanguageModelToolsService , IToolData , ToolDataSource , ToolSet } from '../../common/languageModelToolsService.js' ;
23
24
import { ConfigureToolSets } from '../tools/toolSetsContribution.js' ;
24
25
@@ -59,8 +60,9 @@ export async function showToolsPicker(
59
60
const mcpService = accessor . get ( IMcpService ) ;
60
61
const mcpRegistry = accessor . get ( IMcpRegistry ) ;
61
62
const commandService = accessor . get ( ICommandService ) ;
62
- const extensionWorkbenchService = accessor . get ( IExtensionsWorkbenchService ) ;
63
+ const extensionsWorkbenchService = accessor . get ( IExtensionsWorkbenchService ) ;
63
64
const editorService = accessor . get ( IEditorService ) ;
65
+ const mcpWorkbenchService = accessor . get ( IMcpWorkbenchService ) ;
64
66
const toolsService = accessor . get ( ILanguageModelToolsService ) ;
65
67
66
68
const mcpServerByTool = new Map < string , IMcpServer > ( ) ;
@@ -88,7 +90,7 @@ export async function showToolsPicker(
88
90
89
91
const addMcpPick : CallbackPick = { type : 'item' , label : localize ( 'addServer' , "Add MCP Server..." ) , iconClass : ThemeIcon . asClassName ( Codicon . add ) , pickable : false , run : ( ) => commandService . executeCommand ( McpCommandIds . AddConfiguration ) } ;
90
92
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' ) } ;
92
94
const addPick : CallbackPick = {
93
95
type : 'item' , label : localize ( 'addAny' , "Add More Tools..." ) , iconClass : ThemeIcon . asClassName ( Codicon . add ) , pickable : false , run : async ( ) => {
94
96
const pick = await quickPickService . pick (
@@ -143,7 +145,13 @@ export async function showToolsPicker(
143
145
toolBuckets . set ( key , bucket ) ;
144
146
145
147
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 ) {
147
155
buttons . push ( {
148
156
iconClass : ThemeIcon . asClassName ( Codicon . settingsGear ) ,
149
157
tooltip : localize ( 'configMcpCol' , "Configure {0}" , collection . label ) ,
0 commit comments