Skip to content

Fix safe-outputs MCP server: Enable stateless mode for gateway compatibility#11147

Merged
pelikhan merged 2 commits intocopilot/convert-safe-outputs-to-html-transportfrom
copilot/review-gateway-logs-investigation
Jan 22, 2026
Merged

Fix safe-outputs MCP server: Enable stateless mode for gateway compatibility#11147
pelikhan merged 2 commits intocopilot/convert-safe-outputs-to-html-transportfrom
copilot/review-gateway-logs-investigation

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

The safe-outputs MCP HTTP server failed to register tools with error code=-32001, message=Session not found. The server required MCP protocol initialization (session handshake), but the MCP gateway calls methods directly without performing initialization.

Changes

File: actions/setup/js/safe-outputs-mcp-server.cjs

- startHttpServer({ port, logDir }).catch(error => {
+ startHttpServer({ port, logDir, stateless: true }).catch(error => {

Enables stateless mode (no session management) in the HTTP transport. The server now accepts direct method calls like tools/list without requiring prior initialize requests or Mcp-Session-Id headers.

Context

The MCP HTTP transport implementation in mcp_http_transport.cjs has two modes:

  • Stateful (default): Requires initialize → generates session ID → validates Mcp-Session-Id header on all subsequent requests
  • Stateless: Accepts method calls directly without session management

The MCP gateway uses the stateless pattern, calling methods immediately without the initialization handshake that stateful mode expects.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/21232198085/job/61092829424

Review gateway logs and investigate why the safeoutputs server failed to run


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…mpatibility

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate safeoutputs server failure in gateway logs Fix safe-outputs MCP server: Enable stateless mode for gateway compatibility Jan 22, 2026
Copilot AI requested a review from pelikhan January 22, 2026 01:38
@pelikhan pelikhan marked this pull request as ready for review January 22, 2026 01:40
@pelikhan pelikhan merged commit 5432a9e into copilot/convert-safe-outputs-to-html-transport Jan 22, 2026
@pelikhan pelikhan deleted the copilot/review-gateway-logs-investigation branch January 22, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants