Skip to content

SDK 0.4 not working with OpenAI's internal MCP client #1039

@mbuptivo

Description

@mbuptivo

Hi,
I created a stateless MCP server and I am trying to connect it with OpenAI, initially via platform's dashboard chat/prompt test interface. I'm facing a problem with openai sending a GET to my /mcp endpoint, which, in stateless mode, returns a 405 method not allowed error. Acording to mcp protocol description, this should be ok.

https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#listening-for-messages-from-the-server

The server MUST either return Content-Type: text/event-stream in response to this HTTP GET, or else return HTTP 405 Method Not Allowed, indicating that the server does not offer an SSE stream at this endpoint.

But this disrupts openai's client, which returns "Error retrieving tool list from MCP server: 'TestMCP'. Http status code: 405 (Method Not Allowed)". This happens any time before or after getting the tools list.

NOTICE: I've also temporarily tried without "stateless = true", but it gives another error. In any case, I want it to work in stateless mode.

Has anyone been able to work around this?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions