Project scope MCP
Resolved 💬 16 comments Opened Sep 1, 2025 by yaroslavyaroslav Closed Nov 11, 2025
💡 Likely answer: A maintainer (yaroslavyaroslav, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
The codex cli is so powerful in working with plain bash, yet there're still options where using MCP servers are the most convenient way to work with.
One of such is fixing diagnostic issues through LSP servers instances. But such servers are project related and should not leak in codex global scope.
Thus I suggest to either add project/session related mcp servers setup or profile related mcp servers as more general solution.
like:
[profiles.gpt-5]
model = "gpt-5"
model_provider = "openai"
approval_policy = "on-failure"
disable_response_storage = false
model_reasoning_effort = "medium"
[profiles.gpt-5.mcp_servers.dash]
command = "uvx"
args = ["--from", "git+https://github.com/Kapeli/dash-mcp-server.git", "dash-mcp-server"]
Are you interested in implementing this feature?
It strictly depends on chances it's being merged afterwards 😅
Additional information
_No response_
16 Comments
oh, i thought project-scoped mcp servers already supported :(
I would be great indeed.
I guess this won't be a lucky one.
See also:
Here's my workaround in the meantime using shell functions:
Basic:
Advanced, with secure token storage/retrieval built in (on macOS):
It would also be great to have MCP configurations that could be selected on-demand in the chat (CLI or VS Code/Cursor extension). I often want to enable/disable MCPs for particular tasks, instead of having all of the MCPs & tools in the context window for every task in a project.
Example configs
Full-Stack Web Development
DevOps & Infrastructure
Backend API Development
Frontend Development
Documentation Writing
any update on this?
I saw that
0.46.0added anenabledconfig item to MCP definitions. So theoretically you could have that disabled for everything and then just toggle it on with--configas an interim workaround:this is really important, developers should not spend time enabling mcp servers needed by a specific project or app folder!
I submitted PR #3864 with similar functionality\! It added flag support and config merging logic where project configs override globals. Unfortunately it was closed due to the team's current policy on new features. The LSP server use case you mentioned is perfect - those should definitely be project-scoped rather than global. Would love to see this feature get implemented\! ⭐
There's a closed branch from me somewhere above, which is also closed but by me this time. So u can use it if u build codex locally. Luckily the code and the build system pretty straightforward thus it's no mess to manage such approach.
Just to mention. As I said in a closing comment in the mine pr, I'm kinda disappointed in MCP in overall in favor to local tinny cli wrappers for whatever tools u can imagine. I assume the team is kinda same here, thus I won't be expected drastic improvement in this part of codex in foreseeable future
/2c: As an unrelated outsider, but keeping watch on the changes being made to codex, I don't think that conclusion aligns with reality. In recent versions the codex team has been putting in major effort to refactoring and improving the core of their MCP support, from the legacy (self implemented?) system, to switching out to the 'official' rust package / implementation.
If I was to guess / bet, I would say that there is a much higher chance that they are more focussed on finishing that core refactor work before adding little extra bits of polish like this; than that they believe MCP is dissapointing and not a direction worth pursuing / maintaining well.
To add my 2c to this, the workflow I use in elixir language development relies on running an MCP server (tidewave.ai) inside each project, which provides source code locations, in-context evaluations, DB access, etc. It's very useful but it relies on running on the development web server port of each project. The MCP server runs inside the project and shares its own local HTTP port.
Having a per-project MCP config is necessary for this development style. Currently, it's not supported in codex, it would be very nice if it was!
As a workaround, you can define the MCP config globally and disable it; then enable it per project via the CLI arg to toggle the enabled property.
Alternatively you can provide the full MCP config via that same CLI arg without needing it in your global config at all.
To make that a bit cleaner per-project you can wrap it in a shell script or similar.
Obviously not the most ideal long term solution; but works pretty well as an interim workaround.
Closing this in favor of #2628, which has more upvotes.