Skip to content

Commit 8b20b01

Browse files
committed
Add mcp configuration button
1 parent 7fcb137 commit 8b20b01

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

packages/core/src/codewhisperer/activation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ import { detectCommentAboveLine } from '../shared/utilities/commentUtils'
9393
import { globalMcpConfigPath } from '../codewhispererChat/constants'
9494
import { McpManager } from '../codewhispererChat/tools/mcp/mcpManager'
9595
import globals from '../shared/extensionGlobals'
96-
import { ToolUtils } from '../codewhispererChat/tools/toolUtils'
9796

9897
let localize: nls.LocalizeFunc
9998

@@ -382,6 +381,8 @@ export async function activate(context: ExtContext): Promise<void> {
382381
*/
383382
const mgr = await McpManager.initMcpManager(globalMcpConfigPath)
384383
globals.mcpManager = mgr
384+
// const mgr = await McpManager.initMcpManager(globalMcpConfigPath)
385+
// globals.mcpManager = mgr
385386
setSubscriptionsForMcp()
386387

387388
function shouldRunAutoScan(editor: vscode.TextEditor | undefined, isScansEnabled?: boolean) {

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ export class ChatController {
200200
this.tabBarController = new TabBarController(this.messenger)
201201

202202
// todo: move to activate function?
203-
// McpManager.initMcpManager(globalMcpConfigPath)
204-
// .then((manager) => {
205-
// if (manager) {
206-
// globals.mcpManager = manager
207-
// }
208-
// })
209-
// .catch((err) => {
210-
// getLogger().error(`Failed to initialize MCP manager in controller: ${err}`)
211-
// })
203+
McpManager.initMcpManager(globalMcpConfigPath)
204+
.then((manager) => {
205+
if (manager) {
206+
globals.mcpManager = manager
207+
}
208+
})
209+
.catch((err) => {
210+
getLogger().error(`Failed to initialize MCP manager in controller: ${err}`)
211+
})
212212

213213
onDidChangeAmazonQVisibility((visible) => {
214214
if (visible) {

packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class Messenger {
436436
)
437437
}
438438

439-
this.telemetryHelper.recordToolUseSuggested(toolUse, messageID)
439+
// this.telemetryHelper.recordToolUseSuggested(toolUse, messageID)
440440
} else {
441441
throw new Error('Tool not found')
442442
}

packages/core/src/codewhispererChat/controllers/chat/tabBarController.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import { Database } from '../../../shared/db/chatDb/chatDb'
1515
import { TabBarButtonClick, SaveChatMessage } from './model'
1616
import { Conversation, messageToChatItem, Tab } from '../../../shared/db/chatDb/util'
1717
import { DetailedListItemGroup, MynahIconsType } from '@aws/mynah-ui'
18-
import path from 'path'
19-
import { UserWrittenCodeTracker } from '../../../codewhisperer/tracker/userWrittenCodeTracker'
2018
import { globalMcpConfigPath } from '../../constants'
2119

2220
export class TabBarController {

packages/core/src/codewhispererChat/tools/mcp/mcpTool.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
import { Writable } from 'stream'
66
import { getLogger } from '../../../shared/logger/logger'
7-
import { ToolUtils } from '../toolUtils'
87
import { CommandValidation, InvokeOutput, OutputKind } from '../toolShared'
98
import globals from '../../../shared/extensionGlobals'
109

packages/core/src/codewhispererChat/tools/toolUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class ToolUtils {
6060
case ToolType.ListDirectory:
6161
return tool.tool.requiresAcceptance()
6262
case ToolType.Mcp:
63-
return { requiresAcceptance: false }
63+
return { requiresAcceptance: true }
6464
}
6565
}
6666

packages/core/src/extension.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ import { setupUninstallHandler } from './shared/handleUninstall'
5555
import { maybeShowMinVscodeWarning } from './shared/extensionStartup'
5656
import { getLogger } from './shared/logger/logger'
5757
import { setContext } from './shared/vscode/setContext'
58-
import { McpManager } from './codewhispererChat/tools/mcp/mcpManager'
59-
import { globalMcpConfigPath } from './codewhispererChat/constants'
6058

6159
disableAwsSdkWarning()
6260

0 commit comments

Comments
 (0)