Project-specific MCPs
Resolved 💬 30 comments Opened Aug 23, 2025 by nick-youngblut Closed Jan 26, 2026
💡 Likely answer: A maintainer (LaelLuo, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
The mcp docs in the readme state:
The Codex CLI can be configured to leverage MCP servers by defining an mcp_servers section in ~/.codex/config.toml
So, there appears to be no way of setting up project specific MCP settings (e.g., using MCP server A in Project X via config in the Project X root location, while using MCP server B in Project Y).
Given the proliferation of MCP servers, and the difficulty of current models to handle large numbers of MCP tools, it is best to limit the MCP tools to only those required for the target project.
See Project Configuration in the Cursor docs for an example of project-specific MCP setups.
Are you interested in implementing this feature?
No
Additional information
_No response_
30 Comments
Definitely the issue. I think the whole workflow for managing and configuring MCPs should be enhanced.
In CC lately I have been using --mcp-config=.claude/.mcp.json
It would be great to have the ability to just have a local json config for each project.
Very important feat that Claude has, but Codex CLI doest not.
It would be very very useful in Codex
bump
crucial feature
Would love to see this. I've created an agent network, and I like to give them usernames. I also don't always want the same MCP server for every project. However having a global setting is great for common MCP servers, so don't remove that feature. Agreed here, mcp json files are nice, but can't share one with other agents so make it unique, but tbh, toml is better than a conflict with another agents config.
This worked for me as a workaround:
This creates a project-level .codex/ directory. You’ll need to add a config.toml inside it with your MCP server configuration, for example:
[mcp_servers.myserver]
command = "npx"
args = ["-y", "some-mcp@latest", "--stdio"]
The symlink to ~/.codex/auth.json means you don’t have to re-authenticate in every project.
It’s a decent workaround until proper project-level config support is added.
This
codex2wrapper is handy in maintaining per-repository/per-project configs while we wait for OpenAI to officially support it.Had codex vibe code a script to do a bit more with all this:
https://gist.github.com/DevGuyRash/5340267a636de44d6c48ceb603f88846
Just run
codex-wrapper --init..envrcversion:I think you'll find 1MCP useful. I recently encountered the same issue while using Codex: the inability to configure MCP servers on a per-project basis. That's why I developed the proxy and
.1mcprcfeatures in 1MCP, which allow you to configure just one 1MCP proxy command in Codex while using project-specific.1mcprcfiles to group and filter all available MCP servers.Quick Example:
Now Codex automatically loads different MCP servers based on your project's
.1mcprcfile!The complete integration documentation is available at: https://docs.1mcp.app/guide/integrations/codex. If you encounter any issues, feel free to provide feedback at: https://github.com/1mcp-app/agent/issues
@xizhibei does 1mcp actually reduce context length and prevent context rot?
@nick-youngblut Yes, below is the example I test with ClaudeCode:
.mcp.jsonunder project root:Initial State: My
dev-backendpreset contains 3 servers (22 tools), occupying 7.5% of the context window.Using the preset editor to streamline servers:
After optimization: After reconnecting, the effect is immediate!
This feature would be really useful.
I actually submitted a PR (#3864) for this exact feature\! Unfortunately, it was closed since the team isn't accepting new features right now. Project-scoped MCP configuration is really needed - it prevents cluttering global config with project-specific tools. Really hope to see this implemented someday\! 👍
Please implement this, it is a major limitation for an otherwise good harness.
This should now work if you're using the Codex CLI. You can define a project-local
.codex/config.tomlfile and specify project-specific settings like MCP servers. One caveat: project-localconfig.tomlfiles are ignored if the project is not trusted.We're still working on plumbing this feature through for the Codex IDE Extension. I'll keep this thread open until that's complete.
This will be included in the next release of the IDE Extension! As I mentioned above, it has been implemented in the CLI for the past few releases.
it stopped working for me with latest update, anyone else experience this?
@vim-zz, project-local configs are ignored for untrusted projects. That might explain the behavior you're seeing.
@etraut-openai is there any plan to add project level config via cli
codex mcp add --project?Does the local
<project-root>/.codex/config.tomlstill work? I added this config but it doesn't load the mcp server, when I move it to~/.codex/config.toml, it works as normal.@codeaholicguy, is your local project trusted? Codex will not load a local project config if it's an untrusted project.
@etraut-openai yes, I have this config inside my
~/.codex/config.tomlBut let me try to remove and add it again. Thanks for the reply.
@codeaholicguy does it help?
yes, it worked after I removed and added again
Note for others that might find this, the codex app can load MCP in the project specific config, but it will not show it with /MCP. You have to ask your model whether it can access the MCP. You can also see them grayed out under settings -> mcp in the codex app. The codex cli will correctly list the MCP
i have same problem =(
Jumping in here. This is a major issue.
For example, If you have different database endpoint MCPs for different clients or projects you have to rely on Codex permissions to scope to a chat instead of having it set at the project level. And while you can add it directly in .codex/config.toml and it shows up in settings giving the impression of it working, it clearly doesn't, causing agents to go in circles before the user gives up and uses ~/.codex/config.toml
This effectively breaks a core aspect of project-scoped tools.
This is a closed issue. If you're seeing behavior that you think is a bug with the latest version of Codex, please open a new bug report and fill in all of the requested details in the bug report template. If you'd like to suggest new functionality, open a new feature request.