Skip to content

Remote MCP Server | Session Terminated after 1st interaction #702

@hayescode

Description

@hayescode

Describe the bug

I'm using OpenAI Responses API and the remote GitHub MCP server with PAT authentication. Starting a few days ago I noticed that the first interaction works fine, but then every subsequent tool call fails. This used to work fine.

Some users report setting stateless_http=True in the MCP server itself seems to fix this issue (Source).

    "name": "list_pull_requests",
    "server_label": "github",
    "type": "mcp_call",
    "error": {
      "type": "mcp_protocol_error",
      "code": 32600,
      "message": "Session terminated"
    },

Affected version

latest

Steps to reproduce the behavior

response = await llm.responses.create(
    model="gpt-4.1",
    tools=[
        Mcp(
            server_label="github",
            server_url="https://api.githubcopilot.com/mcp/",
            type="mcp",
            headers={
                "Authorization": f"Bearer {GITHUB_PAT}",
            },
            require_approval="never",
        )
    ],
    input="what is my github username? how many issues do i have open?"
)
print(response.model_dump_json(indent=2))

Expected vs actual behavior

The session should persist for multiple tool calls.

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy