Skip to content

GitLab MCP works via mcp-remote, but Codex 0.46.0 fails during initialize #16262

@pierrekarampournis-mc

Description

@pierrekarampournis-mc

What version of the Codex App are you using (From “About Codex” dialog)?

0.46.0

What subscription do you have?

Enterprise

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

Codex cannot complete MCP initialization against GitLab MCP, even though authentication succeeds and the GitLab MCP server is reachable outside Codex.

With direct GitLab MCP config:

experimental_use_rmcp_client = true

[mcp_servers.GitLab]
url = "https://gitlab.com/api/v4/mcp"

OAuth login succeeds:

Successfully logged in to MCP server 'GitLab'.

But MCP access fails during initialize:

failed to get client: MCP startup failed: handshaking with MCP server failed:
Send message error ... error decoding response body, when send initialize request

With a stdio bridge using mcp-remote, Codex still fails during initialize:

failed to get client: MCP startup failed: handshaking with MCP server failed:
connection closed: initialize response

In the same environment, GitLab MCP itself is reachable outside Codex and returns a valid initialize response.

What steps can reproduce the bug?

  1. Use Codex CLI 0.46.0 on macOS.
  2. Configure GitLab MCP with:
experimental_use_rmcp_client = true

[mcp_servers.GitLab]
url = "https://gitlab.com/api/v4/mcp"
  1. Run:
codex mcp login GitLab
  1. Complete the OAuth flow successfully.
  2. Attempt to use the GitLab MCP server from Codex, for example via MCP resource listing.
    Observed result:
failed to get client: MCP startup failed: handshaking with MCP server failed:
Send message error ... error decoding response body, when send initialize request

Additional reproduction:

  1. Replace direct transport with a stdio bridge using mcp-remote.
  2. Restart Codex.
  3. Retry the same MCP access.

Observed result:

failed to get client: MCP startup failed: handshaking with MCP server failed:
connection closed: initialize response

Control test outside Codex:

  • A reference client can connect successfully to the same GitLab MCP endpoint after OAuth.
  • A direct initialize round-trip against GitLab MCP returns:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-03-26",
    "capabilities": {
      "tools": {
        "listChanged": false
      }
    },
    "serverInfo": {
      "name": "Official GitLab MCP Server",
      "version": "18.11.0-pre"
    }
  }
}

PII/confidential details redacted:

  • repo/group names omitted
  • tokens omitted
  • local usernames/paths omitted

Session id / token usage / context window:

  • not applicable

What is the expected behavior?

f GitLab MCP is configured and authenticated successfully, Codex should be able to initialize the MCP server and use its tools/resources without failing during initialize.

Additional information

GitLab-side requirements were enabled before testing:

  • GitLab Duo Core
  • experiment / beta features at the top-level group

This appears to be a Codex MCP client/runtime compatibility issue rather than a GitLab entitlement or OAuth issue, because:

  • OAuth succeeds
  • the GitLab MCP server is reachable outside Codex
  • Codex fails specifically during MCP initialize / transport handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIappIssues related to the Codex desktop appbugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions