You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify MCP localhost rewrite, transport semantics, and reachability under network isolation (#6005)
* Initial plan
* docs: clarify MCP transport and localhost reachability rules
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Landon Cox <landon.cox@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- `command:`+ `args:` defines a **stdio** MCP server process.
1182
+
- `url:`defines an **HTTP** MCP server endpoint.
1183
+
2. **MCP gateway runtime config** — compiler-generated configuration consumed by the gateway.
1184
+
- Frontmatter stdio servers are compiled into gateway stdio (stdin/stdout) process entries.
1185
+
- Frontmatter `command:` is valid for workflow authors even though the gateway's internal schema differs.
1186
+
1187
+
#### Localhost rewrite in network isolation mode
1188
+
1189
+
When network isolation is enabled (i.e., when the MCP gateway runs in a Docker container), loopback HTTP MCP URLs in `mcp-servers` are rewritten by the compiler:
1190
+
- `http://localhost:PORT/...`
1191
+
- `http://127.0.0.1:PORT/...`
1192
+
- `http://[::1]:PORT/...`
1193
+
1194
+
becomes:
1195
+
1196
+
- `http://host.docker.internal:PORT/...`
1197
+
1198
+
This rewrite is required because the MCP gateway runs in a Docker container and cannot reach the host loopback interface directly.
1199
+
1200
+
#### Host-side HTTP server binding requirement
1201
+
1202
+
If a workflow starts a local HTTP MCP server in `steps:` and network isolation is enabled, the server must bind to `0.0.0.0` (or another non-loopback interface). Binding only to `127.0.0.1` / `::1` will not be reachable from the gateway via `host.docker.internal`.
1203
+
1204
+
Compiler/lint behavior:
1205
+
- The compiler SHOULD emit a warning when an HTTP MCP server URL is loopback-localhost and the same workflow appears to start a server with `--host 127.0.0.1`, `--bind 127.0.0.1`, `--host ::1`, or `--bind ::1`.
1206
+
1207
+
#### Network reachability matrix
1208
+
1209
+
| MCP Type | URL / Address | Network Isolation OFF | Network Isolation ON |
| Stdio | `command:` + `args:` (frontmatter) | ✅ Compiled to gateway stdio/stdin process config | ✅ Compiled to gateway stdio/stdin process config |
1216
+
1176
1217
### Engine Network Permissions
1177
1218
1178
1219
Control network access for AI engines using the top-level `network:` field. If no `network:` permission is specified, it defaults to `network: defaults` which provides access to basic infrastructure only.
0 commit comments