Skip to content

Add MCP support. #5

Closed
Closed

Description

@LuciferMornens

Would it be possible to have MCP servers support in codex?

i'd defo love to see that. me and many others.

Activity

  1. OhadRubin commented on Apr 16, 2025

    @OhadRubin

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

  2. vigneshchinnadurai commented on Apr 16, 2025

    @vigneshchinnadurai

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

  3. jacob-israel-turner commented on Apr 16, 2025

    @jacob-israel-turner

    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.

  4. added
    enhancement
    on Apr 16, 2025
  5. plwalters commented on Apr 17, 2025

    @plwalters

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

  6. lefrog-dont-code commented on Apr 17, 2025

    @lefrog-dont-code

    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!

  7. jasonkneen commented on Apr 17, 2025

    @jasonkneen

    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.

  8. Stewart86 commented on Apr 17, 2025

    @Stewart86

    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

  9. jasonkneen commented on Apr 17, 2025

    @jasonkneen

    Running final tests etc.

  10. jasonkneen commented on Apr 17, 2025

    @jasonkneen

    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

  11. jasonkneen commented on Apr 17, 2025

    @jasonkneen

    PR in

  12. wtesler commented on Apr 18, 2025

    @wtesler

    I've created what I believe is a more minimal implementation of MCP support. You can find it here:

    wtesler@1136135

    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.

  13. gaiar commented on Apr 24, 2025

    @gaiar

    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

  14. MatanYemini commented on May 3, 2025

    @MatanYemini
    Contributor

    nice! when it would be out?

  15. michabbb commented on May 3, 2025

    @michabbb
  16. 34 remaining items

  17. added a commit that references this issue on Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions