Skip to content

Streamable MCP run normally and return results, but soon get unexpected status 400 Bad Request error #6540

@zxzxzxzzy0119

Description

@zxzxzxzzy0119

What version of Codex is running?

0.57.0

What subscription do you have?

use azure api Key, model = "gpt-5-codex" model_provider = "azure"

Which model were you using?

gpt-5-codex, azure

What platform is your computer?

windows 11 wsl

What issue are you seeing?

The configuration in config.toml is as follows:

[mcp_servers.mymcp]
url = "http://ip:port/sse"
http_headers = { "live" = "true", "user" = "tom" }

MCP can run normally and return results, but soon messages like
Reconnecting... 1/5, Reconnecting... 2/5, Reconnecting... 3/5, Reconnecting... 4/5, Reconnecting... 5/5
appear, followed by the following error:

unexpected status 400 Bad Request: {
"error": {
"message": "Invalid 'input[3].name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.",
"type": "invalid_request_error",
"param": "input[3].name",
"code": "invalid_value"
}
}

What steps can reproduce the bug?

config.toml

[mcp_servers.mymcp]
url = "http://ip:port/sse"
http_headers = { "live" = "true", "user" = "tom" }

then call mcp server in prompt

What is the expected behavior?

No response

Additional information

Normal Q&A、coding works fine, but this problem occurs when using the MCP server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething 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