Skip to content

Docker servers can't start - Invalid trailing data at the end of stream #1075

@drab0wl

Description

@drab0wl

Describe the bug
A clear and concise description of what the bug is.

MCP servers using Docker as an MCP gateway cannot start with the error message: "invalid trailing data at the end of stream"

To Reproduce
Steps to reproduce the behavior:

  1. Install an MCP server into docker. GitHub's local instructions include Docker instructions: https://github.com/github/github-mcp-server?tab=readme-ov-file#local-github-mcp-server
  2. Attempt to start server

Expected behavior
A clear and concise description of what you expected to happen.

The server starts without issue.

Logs
If applicable, add logs to help explain your problem.

Callstack:
at System.Threading.Channels.AsyncOperation2.GetResult(Int16 token) 12:49:36:075 at System.Threading.Channels.ChannelReader1.ReadAllAsync(CancellationToken cancellationToken)+MoveNext()
12:49:36:075 at ModelContextProtocol.McpSession.ProcessMessagesAsync(CancellationToken cancellationToken)
12:49:36:075 at ModelContextProtocol.McpSession.ProcessMessagesAsync(CancellationToken cancellationToken)
12:49:36:075 at ModelContextProtocol.McpEndpoint.DisposeUnsynchronizedAsync()
12:49:36:075 at ModelContextProtocol.Client.McpClient.DisposeUnsynchronizedAsync()
12:49:36:075 at ModelContextProtocol.Client.McpClient.DisposeUnsynchronizedAsync()
12:49:36:075 at ModelContextProtocol.McpEndpoint.DisposeAsync()
12:49:36:075 at ModelContextProtocol.Client.McpClient.ConnectAsync(CancellationToken cancellationToken)
12:49:36:075 at ModelContextProtocol.Client.McpClientFactory.CreateAsync(IClientTransport clientTransport, McpClientOptions clientOptions, ILoggerFactory loggerFactory, CancellationToken cancellationToken)
12:49:36:075 at ModelContextProtocol.Client.McpClientFactory.CreateAsync(IClientTransport clientTransport, McpClientOptions clientOptions, ILoggerFactory loggerFactory, CancellationToken cancellationToken)

Additional context
Add any other context about the problem here.

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