|
| 1 | +# Docker MCP Gateway - Streaming Transport Configuration |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +When using the Docker MCP Gateway with the `streaming` transport mode, it's important to understand the correct URL configuration to avoid connection errors. |
| 6 | + |
| 7 | +## Issue |
| 8 | + |
| 9 | +When connecting an MCP client to the Docker MCP Gateway using the `streaming` transport (`docker mcp gateway run --transport streaming`), the connection will fail with errors like "Invalid session ID" if the client is configured to connect to the root URL (e.g., `http://localhost:8080`). |
| 10 | + |
| 11 | +## Root Cause |
| 12 | + |
| 13 | +The Docker MCP Gateway, when running in `streaming` mode, does not serve its MCP functionality from the root path of the server. Instead, it expects all MCP requests to be sent to the `/mcp` endpoint. |
| 14 | + |
| 15 | +## Solution |
| 16 | + |
| 17 | +### Correct Configuration |
| 18 | + |
| 19 | +When configuring your MCP client to connect to a Docker MCP Gateway running with streaming transport, you must include the `/mcp` path in the URL: |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "mcpServers": { |
| 24 | + "Docker_MCP_Gateway_streaming": { |
| 25 | + "type": "streamable-http", |
| 26 | + "url": "http://localhost:8080/mcp" |
| 27 | + } |
| 28 | + } |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +### Incorrect Configuration (Will Fail) |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "mcpServers": { |
| 37 | + "Docker_MCP_Gateway_streaming": { |
| 38 | + "type": "streamable-http", |
| 39 | + "url": "http://localhost:8080" // Missing /mcp path |
| 40 | + } |
| 41 | + } |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +## Quick Reference |
| 46 | + |
| 47 | +| Transport Type | Correct URL Format | |
| 48 | +| -------------- | --------------------------- | |
| 49 | +| Streaming | `http://localhost:8080/mcp` | |
| 50 | + |
| 51 | +## Additional Notes |
| 52 | + |
| 53 | +- This requirement is specific to the `streaming` transport mode |
| 54 | +- The port number (8080) may vary based on your Docker configuration |
| 55 | +- Always ensure the `/mcp` path is included when using streaming transport |
| 56 | + |
| 57 | +## Related Links |
| 58 | + |
| 59 | +- [MCP Documentation](https://docs.roocode.com/advanced-usage/mcp) |
| 60 | +- [Docker MCP Toolkit Documentation](https://docs.roocode.com/advanced-usage/mcp#docker-mcp-toolkit) |
0 commit comments