Skip to content

fix(mcp-store): disable MCPs from local config file#1601

Open
cvolzer3 wants to merge 3 commits intomainfrom
fix/codex-mcps
Open

fix(mcp-store): disable MCPs from local config file#1601
cvolzer3 wants to merge 3 commits intomainfrom
fix/codex-mcps

Conversation

@cvolzer3
Copy link
Copy Markdown
Contributor

@cvolzer3 cvolzer3 commented Apr 9, 2026

Problem

Codex sessions in PostHog Code were inheriting [mcp_servers.*] entries from the user's personal ~/.codex/config.toml, causing conflicts with the servers we intentionally supply via the MCP store.

Changes

  • Manually process the mcp_servers.* entries, and pass a command to disable each individually when spawning codex-acp
  • Minor changes to CodexSettingsManager to load settings upon initialization

How did you test this?

  • Ran existing tests
  • Tested locally

}
await this.loadSettings();
this.initialized = true;
// No-op: settings are loaded in the constructor. Kept async to
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't like this, but I couldn't find an elegant solution without jacking up the BaseSettingsManager interface (and subsequently, Claude adapter)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fine for now

@cvolzer3 cvolzer3 marked this pull request as ready for review April 9, 2026 21:29
Copy link
Copy Markdown
Contributor

adboio commented Apr 9, 2026

to clarify, this will mean users can't use any of the MCPs they have configured with codex? how will they use MCPs with codex then? i think as a user it'd be frustrating if i had a bunch of MCPs all set up and ready to go with codex native and then they didn't work or i had to set them all up again in ph code

@cvolzer3
Copy link
Copy Markdown
Contributor Author

cvolzer3 commented Apr 9, 2026

@adboio yeah, I was wondering what experience we wanted there. From how I understand it, we aren't importing the MCP servers from the user's Claude configs, so I mirrored that behavior with Codex. If we decide we want to bring their MCP integrations into PH Code, we would want to add a whole UI for that. Also, not sure how that'd work with sandbox agents.

Copy link
Copy Markdown
Contributor

@k11kirky k11kirky left a comment

Choose a reason for hiding this comment

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

approving to unblock but added a question

}
await this.loadSettings();
this.initialized = true;
// No-op: settings are loaded in the constructor. Kept async to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fine for now


// Disable the user's local MCPs one-by-one so Codex only uses the MCPs we
// provide via ACP. We can't use `-c mcp_servers={}` because that makes Codex
// ignore MCPs entirely, including the ones we inject later.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm - im not sure we want to remove all locals right? only if they conflict we should favor ours

Copy link
Copy Markdown
Contributor

adboio commented Apr 9, 2026

ahh i assumed we were bringing in claude MCPs, i don't use very many so i guess i never noticed lol

is this actively causing problems? if not, i think we should reconsider and try to find a way to bring in MCPs from both codex + claude instead of disabling them for both

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.

3 participants