Skip to content

Commit 333221d

Browse files
committed
fix: adding amazonq_mcpConfig to enable and disable config cases
1 parent a262884 commit 333221d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/mcp/mcpEventHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ export class McpEventHandler {
778778

779779
try {
780780
await McpManager.instance.updateServerPermission(serverName, perm)
781+
this.#emitMCPConfigEvent()
781782
} catch (error) {
782783
this.#features.logging.error(`Failed to enable MCP server: ${error}`)
783784
}
@@ -804,6 +805,7 @@ export class McpEventHandler {
804805

805806
try {
806807
await McpManager.instance.updateServerPermission(serverName, perm)
808+
this.#emitMCPConfigEvent()
807809
} catch (error) {
808810
this.#features.logging.error(`Failed to disable MCP server: ${error}`)
809811
}
@@ -996,6 +998,7 @@ export class McpEventHandler {
996998
const mcpServerPermission = await this.#processPermissionUpdates(updatedPermissionConfig)
997999

9981000
await McpManager.instance.updateServerPermission(serverName, mcpServerPermission)
1001+
this.#emitMCPConfigEvent()
9991002

10001003
// Get server config to emit telemetry
10011004
const serverConfig = McpManager.instance.getAllServerConfigs().get(serverName)

server/aws-lsp-codewhisperer/src/language-server/agenticChat/tools/mcp/mcpManager.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import type { Features } from '@aws/language-server-runtimes/server-interface/server'
77
import { ChatTelemetryEventName } from '../../../../shared/telemetry/types'
8-
import { ChatTelemetryController } from '../../../chat/telemetry/chatTelemetryController'
98
import { getGlobalMcpConfigPath } from './mcpUtils'
109
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
1110
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
@@ -64,11 +63,6 @@ export class McpManager {
6463
this.toolNameMapping = new Map<string, { serverName: string; toolName: string }>()
6564
}
6665

67-
/**
68-
* Initialize or return existing manager, then discover all servers.
69-
*/
70-
#telemetryController?: ChatTelemetryController
71-
7266
public static async init(
7367
configPaths: string[],
7468
personaPaths: string[],

0 commit comments

Comments
 (0)