Skip to content

Allow disabling MCP config filtering#207

Open
i1bro wants to merge 1 commit into
mainfrom
disable-mcp-config-filtering-env
Open

Allow disabling MCP config filtering#207
i1bro wants to merge 1 commit into
mainfrom
disable-mcp-config-filtering-env

Conversation

@i1bro

@i1bro i1bro commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@i1bro i1bro requested a review from AlexandrSuhinin June 16, 2026 13:13

@AlexandrSuhinin AlexandrSuhinin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we need a test for this.

Comment thread src/CodexAcpClient.ts
// Deduplicates new servers against existing config to prevent Codex from deep-merging
// incompatible field types (e.g., mixing url and stdio schemas).
const existingNames = await this.getConfigMcpServerNames(projectPath);
const existingNames = this.disableMcpConfigFiltering

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would create a single function shouldDeduplicateMcpConflicts() that will check for env variable or arg. And would avoid leaking it to constructor, field, etc.

Comment thread src/CodexAcpClient.ts
name: sanitizeMcpServerName(mcp.name),
server: mcp,
}));
const uniqueServers = requestedServers.filter(mcp => !existingNames.has(mcp.name));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather check it here, right where we filter mcp's to make the code explicit.

const uniqueServers ...
let mcpSevers ...

if (should deduplicate) {
filter
} else {
...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants