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.

View original on GitHub ↗

43 Comments

OhadRubin · 1 year ago

Tbh, It's kinda weird that it was launched without MCP support, it's kind of a standard.

vigneshchinnadurai · 1 year ago

we need MCP support. Without MCP, this is not much useful

jacob-israel-turner · 1 year ago

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.

plwalters · 1 year ago

I can't really test this without MCP support, it would be a step back

lefrog-dont-code · 1 year ago

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:

  • Connecting to multiple servers (stdio, streamable-http, websockets, etc.)
  • Aggregating capabilities (tools, resources, prompts) from all of them.
  • Handling the sampling/createMessage delegation flow securely (so Codex keeps control of the main LLM calls).
  • Built on top of the official @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!

jasonkneen · 1 year ago

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.

Stewart86 · 1 year ago

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

jasonkneen · 1 year ago

Running final tests etc.

jasonkneen · 1 year ago

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

jasonkneen · 1 year ago

PR in

wtesler · 1 year ago

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:

{
  "model": "o4-mini",
  "mcpServers": {
    "playwright": { "url": "http://localhost:8931/sse" },
  }
}

Then you can run the MCP server locally like:

npx @playwright/mcp@latest --port 8931

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.

gaiar · 1 year ago

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

MatanYemini contributor · 1 year ago

nice! when it would be out?

michabbb · 1 year ago

@gaiar FYI: https://x.com/alexalbert__/status/1918017889548026263

Max plan subscribers now get Claude Code included as part of their plan.
Damecek · 1 year ago

FYI this is the latest take on adding MCP support to ts version of codex

sobri909 · 1 year ago

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...

ramarivera · 1 year ago

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

jasonkneen · 1 year ago

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

schdief · 1 year ago

Why was the PR abandoned?

macseem · 1 year ago

surprised of absence of MCP for so long

jasonkneen · 1 year ago

Another PR took over

marcoscale98 · 1 year ago

OpenAI has introduced MCP Server tool for Responses API: news.
You can start from this news for the next PRs

attilapalfi92 · 1 year ago

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.

fkalny-groupon · 1 year ago

I am itching to try switching to Codex from Claude Code! MCP is the only blocker 🙏

niallkeys · 1 year ago

Would like to see this happen!

Damecek · 1 year ago

FYI mcp is supported in rust version.

iamdeveloperidevelop · 1 year ago

Must have for any dev tool now.

eirikb · 1 year ago
Must have for any dev tool now.

FWIW as @Damecek mentioned it is available in the rust version. It can be run like this:

npx @openai/codex@native
MovGP0 · 1 year ago
FWIW as @Damecek mentioned it is available in the rust version. It can be run like this: npx @openai/codex@native

The installation of that gives me an error on Windows 11/x64 😔 So not sure if useful.

marcoscale98 · 1 year ago
> FWIW as @Damecek mentioned it is available in the rust version. It can be run like this: > npx @openai/codex@native The installation of that gives me an error on Windows 11/x64 😔 So not sure if useful.

Are you using WSL2?

MovGP0 · 1 year ago
Are you using WSL2?

I've tried both, with and without WSL.

Native

npx @openai/codex@native
file:///C:/Users/.../AppData/Local/npm-cache/_npx/8cdb45da5f5a3f47/node_modules/@openai/codex/bin/codex.js:72
    throw new Error(`Unsupported platform: ${platform} (${arch})`);
          ^

Error: Unsupported platform: win32 (x64)
    at file:///C:/Users/.../AppData/Local/npm-cache/_npx/8cdb45da5f5a3f47/node_modules/@openai/codex/bin/codex.js:72:11
    at ModuleJob.run (node:internal/modules/esm/module_job:358:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5)

Node.js v24.2.

WSL 2.0 / Ubuntu

npx @openai/codex@native
'\\wsl.localhost\Ubuntu\home\...'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
file:///C:/Users/.../AppData/Local/npm-cache/_npx/8cdb45da5f5a3f47/node_modules/@openai/codex/bin/codex.js:72
    throw new Error(`Unsupported platform: ${platform} (${arch})`);
          ^

Error: Unsupported platform: win32 (x64)
    at file:///C:/Users/.../AppData/Local/npm-cache/_npx/8cdb45da5f5a3f47/node_modules/@openai/codex/bin/codex.js:72:11
    at ModuleJob.run (node:internal/modules/esm/module_job:358:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5)

Node.js v24.2.0
michabbb · 1 year ago

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.1

MovGP0 · 1 year ago

Also not Working on Windows 11 / ARM 64 (Snapdragon X)

npx @openai/codex@native
Need to install the following packages:
@openai/codex@0.1.2505291658
Ok to proceed? (y) y

npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
file:///C:/Users/movgp/AppData/Local/npm-cache/_npx/8cdb45da5f5a3f47/node_modules/@openai/codex/bin/codex.js:72
    throw new Error(`Unsupported platform: ${platform} (${arch})`);
          ^

Error: Unsupported platform: win32 (arm64)
    at file:///C:/Users/movgp/AppData/Local/npm-cache/_npx/8cdb45da5f5a3f47/node_modules/@openai/codex/bin/codex.js:72:11
    at ModuleJob.run (node:internal/modules/esm/module_job:327:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:663:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5)

Node.js v24.1.0

Additional Info

Windows 11 Build: 26100.1
PowerShell Core Version: 7.5.1
TraMZzz · 1 year ago

Need this too

riodw · 1 year ago

Any update?

marcoscale98 · 1 year ago
Any update?

The new v0.2.0 has MCP Support. Checkout the master branch to view the details

bolinfest collaborator · 1 year ago
jacob-israel-turner · 10 months ago

Sorry to comment on a closed thread - but I'm not sure where else to ask. Will Codex Cloud ever receive MCP support?

michabbb · 10 months ago

@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?

jacob-israel-turner · 10 months ago

@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_.

michabbb · 10 months ago

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....

ai-hakzarov · 9 months ago

@michabbb

so codex cloud can call codex cli, gemini cli, opencode or Claude code for example

Any example in a real project? Orchestrating multiple agents is very complicated

michabbb · 9 months ago

@ai-hakzarov you have to ask @jacob-israel-turner he's the one who asked for mcp