@@ -48,17 +48,19 @@ export class CodexAcpClient {
4848 private readonly codexClient : CodexAppServerClient ;
4949 private readonly config : JsonObject ;
5050 private readonly modelProvider : string | null ;
51+ private readonly disableMcpConfigFiltering : boolean ;
5152 private gatewayConfig : GatewayConfig | null ;
5253 private pendingLoginCompleted : Promise < AccountLoginCompletedNotification > | null = null ;
5354 private pendingAccountUpdated : Promise < AccountUpdatedNotification > | null = null ;
5455 private readonly sessionNotificationQueues = new Map < string , Promise < void > > ( ) ;
5556 private skillExtraRoots : string [ ] = [ ] ;
5657
5758
58- constructor ( codexClient : CodexAppServerClient , codexConfig ?: JsonObject , modelProvider ?: string ) {
59+ constructor ( codexClient : CodexAppServerClient , codexConfig ?: JsonObject , modelProvider ?: string , disableMcpConfigFiltering = false ) {
5960 this . codexClient = codexClient ;
6061 this . config = codexConfig ?? { } ;
6162 this . modelProvider = modelProvider ?? null ;
63+ this . disableMcpConfigFiltering = disableMcpConfigFiltering ;
6264 this . gatewayConfig = null ;
6365 }
6466
@@ -328,7 +330,9 @@ export class CodexAcpClient {
328330
329331 // Deduplicates new servers against existing config to prevent Codex from deep-merging
330332 // incompatible field types (e.g., mixing url and stdio schemas).
331- const existingNames = await this . getConfigMcpServerNames ( projectPath ) ;
333+ const existingNames = this . disableMcpConfigFiltering
334+ ? new Set < string > ( )
335+ : await this . getConfigMcpServerNames ( projectPath ) ;
332336 const requestedServers = mcpServers . map ( mcp => ( {
333337 name : sanitizeMcpServerName ( mcp . name ) ,
334338 server : mcp ,
0 commit comments