Error using MCP Server using Open AI API / Playground

Hi guys, so let me tell you a brief overview of what problem I’m facing. Basically, I started working in a company as an intern and my manager told me to make a Streamable HTTP MCP server. So I learnt the basics by reading documentation and made a basic MCP server having 2-3 tools one like fetching static data like user and second updating that static data. I made the MCP server, deployed it on docker and used MCP inspector to check it and it worked flawlessly. Then I connected it to Claude desktop and it worked perfectly. Now, as it was working I deployed it on Claude and my company uses Open Al, so used it to verify if my MCP server was working and that’s where things start getting worse.

My Server is detected by Open Al, a connection is also made and when it tries to use any tool, that’s when the session gets terminated. Now Open Al don’t say any errors but I get error code 32600. Now what I think is it’s session management issue like my server creates a session id and account to MCP documentation, the client have to add that session id to any new request otherwise the session will be terminated. Now how do I solve it? I don’t want to modify anything from client side. Please help me.

1 Like

i have the same issue: , McpCall(id=‘mcp_687409b29ce08193a9c47c4ef3f6d376031933f613a06b3d’, arguments=‘{“server_id”:“1392371611310751795”}’, name=‘get_channels’, server_label=‘discord_server’, type=‘mcp_call’, error={‘type’: ‘mcp_protocol_error’, ‘code’: 32600, ‘message’: ‘Session terminated’} . Here is the code: with open(“./prompt.md”,“r”) as f:
prompt= f.read()

user_message = “”“Help me moderate my discord server with id 1392371611310751795 Look in support tickets and public chat. Respond to the user using a send message tool”“”

client = OpenAI()

resp = client.responses.create(
model=“gpt-4.1”,
tools=[
{
“type”:“mcp”,
“server_label”:“discord_server”,
“server_url”:url,
“require_approval”:“never”
}
],
instructions=prompt,
input=user_message
)

print(resp)

1 Like

I found a solution, you can make the MCP server, http-stateless which will solve the error for now

1 Like

Make sure your mcp server is setup as “sse” instead of “http”. your url then might look like this : url/sse instead of /mcp in the end.

checkout FastMCP docs if you’re using that, it’s just a one word replacement : http ->sse in the run command :

if name == “main”:
mcp.run(transport=“sse”, host=“0.0.0.0”, port=4000)