@@ -47,16 +47,18 @@ export class CodexAcpClient {
4747 private readonly codexClient : CodexAppServerClient ;
4848 private readonly config : JsonObject ;
4949 private readonly modelProvider : string | null ;
50+ private readonly disableMcpConfigFiltering : boolean ;
5051 private gatewayConfig : GatewayConfig | null ;
5152 private pendingLoginCompleted : Promise < AccountLoginCompletedNotification > | null = null ;
5253 private pendingAccountUpdated : Promise < AccountUpdatedNotification > | null = null ;
5354 private readonly sessionNotificationQueues = new Map < string , Promise < void > > ( ) ;
5455
5556
56- constructor ( codexClient : CodexAppServerClient , codexConfig ?: JsonObject , modelProvider ?: string ) {
57+ constructor ( codexClient : CodexAppServerClient , codexConfig ?: JsonObject , modelProvider ?: string , disableMcpConfigFiltering = false ) {
5758 this . codexClient = codexClient ;
5859 this . config = codexConfig ?? { } ;
5960 this . modelProvider = modelProvider ?? null ;
61+ this . disableMcpConfigFiltering = disableMcpConfigFiltering ;
6062 this . gatewayConfig = null ;
6163 }
6264
@@ -314,7 +316,9 @@ export class CodexAcpClient {
314316
315317 // Deduplicates new servers against existing config to prevent Codex from deep-merging
316318 // incompatible field types (e.g., mixing url and stdio schemas).
317- const existingNames = await this . getConfigMcpServerNames ( projectPath ) ;
319+ const existingNames = this . disableMcpConfigFiltering
320+ ? new Set < string > ( )
321+ : await this . getConfigMcpServerNames ( projectPath ) ;
318322 const requestedServers = mcpServers . map ( mcp => ( {
319323 name : sanitizeMcpServerName ( mcp . name ) ,
320324 server : mcp ,
0 commit comments