Skip to content

GitHub Copilot CLI MCP client do not persist Mcp-Session-Id header #3668

@ari-luokkala

Description

@ari-luokkala

Describe the bug

Summary: When connecting to a remote MCP server via http transport that assigns a session ID during initialization, GitHub Copilot does not include the Mcp-Session-Id header on subsequent requests, resulting in HTTP 400 errors.

Affected version

GitHub Copilot CLI 1.0.59

Actual behavior

The Mcp-Session-Id header from the server's initialize response is not persisted or sent on follow-up requests (e.g., tools/list, tools/call). The server responds with 400 Bad Request.

Expected behavior

Per the MCP Streamable HTTP specification (2025-06-18+), when a server returns an Mcp-Session-Id header in the initialize response, the client MUST include that header in all subsequent HTTP requests.

Other Info

Environment:

  • Transport type: http
  • Remote MCP server with sessions enabled
  • MCP protocol version: 2025-11-25

Spec reference: https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#session-management

Impact: Cannot use any session-dependent MCP server, including features like elicitation and sampling. Workaround is disabling sessions on the server side, which limits functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions