Add MCP support.
Resolved 💬 43 comments Opened Apr 16, 2025 by LuciferMornens Closed Jul 17, 2025
💡 Likely answer: A maintainer (MatanYemini, contributor)
responded on this thread — see the highlighted reply below.
Would it be possible to have MCP servers support in codex?
i'd defo love to see that. me and many others.
43 Comments
Tbh, It's kinda weird that it was launched without MCP support, it's kind of a standard.
we need MCP support. Without MCP, this is not much useful
Codex is great, but a huge step backwards vs Cursor agent mode or Claude Code, which both have MCP support.
I will hold off testing Codex until MCP support is added.
I can't really test this without MCP support, it would be a step back
Hey folks, following up on the discussion about potentially integrating MCP here.
Just wanted to put a library I've been working on onto the radar, in case it might help accelerate things if we go down the MCP route. It's called
omcph(https://github.com/lefrog-dont-code/omcph) and it's basically a ready-made TypeScript client host for managing connections to MCP servers.The idea is to handle some of the boilerplate involved in being an MCP Host, like:
sampling/createMessagedelegation flow securely (so Codex keeps control of the main LLM calls).@modelcontextprotocol/sdk.Obviously, adding any dependency is a consideration, but thought it might be useful as a potential building block if the project decides to implement MCP host capabilities.
Let me know if this looks potentially helpful or if a different approach (like building directly on the base SDK) seems more appropriate for Codex!
I have a PR coming for MCP support -- have added commands based on claude code to add, remove and support local and global MCP servers; have got client invoking working and just testing -- should be PR today for this.
I stopped using it as soon as I realised I cannot call perplexity-search mcp it with. it's really fine if there is no support for MCP yet, but no web search? that's a bummer
Running final tests etc.
Bit rough, not happy with it but was a pig to get in there, so needs some more love I think but it works -- it's very fragile with MCP servers that don't behave well but I'm starting to test it now with a load.
Incoming shortly
PR in
I've created what I believe is a more minimal implementation of MCP support. You can find it here:
https://github.com/wtesler/codex-mcp/commit/1136135e692e560262f48f42f7e910179ee91f24
In my approach, you add the MCP config to ~/.codex/config.json like:
Then you can run the MCP server locally like:
If you want to try it out, download my fork, cd into codex-cli, npm install, npm run build, and then you can run codex like
bin/codex.Then you can make an MCP call like "Call the playwright tool browser_tab_new with url https://example.com"
Try it out and let me know what you think.
Yes, I would love to check what I can squeeze from 4.1 with a 1 million context window and https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking.
Claude Code, with his appetite, will make me bankrupt :D
nice! when it would be out?
@gaiar FYI: https://x.com/alexalbert__/status/1918017889548026263
FYI this is the latest take on adding MCP support to ts version of codex
It's been over a month and this still hasn't landed, unless I'm missing something. MCP is kind of table stakes these days...
Great to see efforts to deliver MCP :D
Just one small question, do we know if the stdio based commands will be sandboxed without network access as codex is? I'd love to add some MCPs for documentation search specifically and that would be a deal breaker
I absolutely do not want the same limitations as the cloud codex -- it's unsuable as-is with it's no internet access so if it's added, it need to be configurable please
Why was the PR abandoned?
surprised of absence of MCP for so long
Another PR took over
OpenAI has introduced MCP Server tool for Responses API: news.
You can start from this news for the next PRs
We are evaluating Claude Code vs OpenAI Codex in the company. I wanted to setup Codex for one of our projects.
In this setup I wanted to give access to our github enterprise server and sonarqube server with MCP.
I struggled for 2-3 hours until I realised MCP is not supported in Codex! I'm very supprised.
I hope they will add MCP support sooner than later.
I am itching to try switching to Codex from Claude Code! MCP is the only blocker 🙏
Would like to see this happen!
FYI mcp is supported in rust version.
Must have for any dev tool now.
FWIW as @Damecek mentioned it is available in the rust version. It can be run like this:
The installation of that gives me an error on Windows 11/x64 😔 So not sure if useful.
Are you using WSL2?
I've tried both, with and without WSL.
Native
WSL 2.0 / Ubuntu
WSL2 ubuntu: installing the native version worked for me without any issues - but i cannot use it because of #1344
npx version: 10.9.2
npx node --version: v22.13.1Also not Working on Windows 11 / ARM 64 (Snapdragon X)
Additional Info
Need this too
Any update?
The new v0.2.0 has MCP Support. Checkout the master branch to view the details
See https://github.com/openai/codex/blob/main/codex-rs/config.md#mcp_servers for docs.
Sorry to comment on a closed thread - but I'm not sure where else to ask. Will Codex Cloud ever receive MCP support?
@jacob-israel-turner what do you think is the reason, why this issue has been closed and this exists: https://github.com/openai/codex/blob/main/docs/config.md#mcp_servers?
@michabbb read my comment before responding.
Yes it's clear the Codex _CLI_ has received MCP support. There's no indication that Codex _Cloud_ has or will receive MCP support.
I'm inquiring about Codex _Cloud_.
Sorry. In that case I would say, add any coding cli agent to your virtual box that supports mcp, so codex cloud can call codex cli, gemini cli, opencode or Claude code for example... Whatever openai offers in the future, with that I would assume you have more possibilities....
@michabbb
Any example in a real project? Orchestrating multiple agents is very complicated
@ai-hakzarov you have to ask @jacob-israel-turner he's the one who asked for mcp