@@ -25,6 +25,7 @@ import type {
2525} from './tools/ToolDefinition.js' ;
2626import type { InsightName , TraceResult } from './trace-processing/parse.js' ;
2727import { getInsightOutput , getTraceSummary } from './trace-processing/parse.js' ;
28+ import type { InstalledExtension } from './utils/ExtensionRegistry.js' ;
2829import { paginate } from './utils/pagination.js' ;
2930import type { PaginationOptions } from './utils/types.js' ;
3031
@@ -60,6 +61,7 @@ export class McpResponse implements Response {
6061 types ?: string [ ] ;
6162 includePreservedMessages ?: boolean ;
6263 } ;
64+ #listExtensions?: boolean ;
6365 #devToolsData?: DevToolsData ;
6466 #tabId?: string ;
6567
@@ -81,6 +83,10 @@ export class McpResponse implements Response {
8183 } ;
8284 }
8385
86+ setListExtensions ( ) : void {
87+ this . #listExtensions = true ;
88+ }
89+
8490 setIncludeNetworkRequests (
8591 value : boolean ,
8692 options ?: PaginationOptions & {
@@ -297,6 +303,11 @@ export class McpResponse implements Response {
297303 }
298304 }
299305
306+ let extensions : InstalledExtension [ ] | undefined ;
307+ if ( this . #listExtensions) {
308+ extensions = context . listExtensions ( ) ;
309+ }
310+
300311 let consoleMessages : Array < ConsoleFormatter | IssueFormatter > | undefined ;
301312 if ( this . #consoleDataOptions?. include ) {
302313 let messages = context . getConsoleData (
@@ -395,6 +406,7 @@ export class McpResponse implements Response {
395406 networkRequests,
396407 traceInsight : this . #attachedTraceInsight,
397408 traceSummary : this . #attachedTraceSummary,
409+ extensions,
398410 } ) ;
399411 }
400412
@@ -409,6 +421,7 @@ export class McpResponse implements Response {
409421 networkRequests ?: NetworkFormatter [ ] ;
410422 traceSummary ?: TraceResult ;
411423 traceInsight ?: TraceInsightData ;
424+ extensions ?: InstalledExtension [ ] ;
412425 } ,
413426 ) : { content : Array < TextContent | ImageContent > ; structuredContent : object } {
414427 const response = [ `# ${ toolName } response` ] ;
@@ -474,6 +487,7 @@ Call ${handleDialog.name} to handle it before continuing.`);
474487 consoleMessages ?: object [ ] ;
475488 traceSummary ?: string ;
476489 traceInsights ?: Array < { insightName : string ; insightKey : string } > ;
490+ extensions ?: object [ ] ;
477491 } = { } ;
478492
479493 if ( this . #tabId) {
@@ -531,6 +545,21 @@ Call ${handleDialog.name} to handle it before continuing.`);
531545 data . detailedConsoleMessage . toJSONDetailed ( ) ;
532546 }
533547
548+ if ( data . extensions ) {
549+ structuredContent . extensions = data . extensions ;
550+ response . push ( '## Extensions' ) ;
551+ if ( data . extensions . length === 0 ) {
552+ response . push ( 'No extensions installed.' ) ;
553+ } else {
554+ const extensionsMessage = data . extensions
555+ . map ( extension => {
556+ return `id=${ extension . id } "${ extension . name } " v${ extension . version } ${ extension . isEnabled ? 'Enabled' : 'Disabled' } ` ;
557+ } )
558+ . join ( '\n' ) ;
559+ response . push ( extensionsMessage ) ;
560+ }
561+ }
562+
534563 if ( this . #networkRequestsOptions?. include ) {
535564 let requests = context . getNetworkRequests (
536565 this . #networkRequestsOptions?. includePreservedRequests ,
0 commit comments