Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/network-policy/customize-network-policy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ CONNECT tunnel failed, response 403
This recipe applies only when URL-based MCP traffic uses the sandbox proxy and fails with that CONNECT 403 response.
An OAuth MCP login failure such as `getaddrinfo EAI_AGAIN`, or any direct-DNS path that bypasses the proxy, is a separate transport problem and is not fixed by widening this allowlist.

Add a preset with the MCP host, the exact Streamable HTTP MCP route, the HTTP methods that route uses (`GET` and `POST`), and only the process binary that opens the connection:
Add a preset with the MCP host, the exact Streamable HTTP MCP route, the HTTP methods that route uses (`GET`, `POST`, and `DELETE`), and only the process binary that opens the connection.
Streamable HTTP MCP clients can use `DELETE` on the same endpoint to terminate a session, so keep that method scoped to the exact MCP route instead of widening the path:

```yaml
preset:
Expand All @@ -176,6 +177,7 @@ network_policies:
rules:
- allow: { method: GET, path: "/mcp" }
- allow: { method: POST, path: "/mcp" }
- allow: { method: DELETE, path: "/mcp" }
binaries:
- { path: /usr/local/bin/node }
```
Expand Down
2 changes: 2 additions & 0 deletions test/policy-roundtrip-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ describe("policy round-trip documentation examples", () => {
expect(section).toBeDefined();
expect(section).toContain('- allow: { method: GET, path: "/mcp" }');
expect(section).toContain('- allow: { method: POST, path: "/mcp" }');
expect(section).toContain('- allow: { method: DELETE, path: "/mcp" }');
expect(section).not.toContain('path: "/**"');
expect(section?.match(/- \{ path: \/usr\/local\/bin\//g)).toHaveLength(1);
expect(section).toContain("only the process that opens the connection");
expect(section).toContain("terminate a session");
expect(section).toContain("do not replace it with `/**`");
expect(section).toContain("does not disable OpenShell's SSRF protection");
expect(section).toContain("getaddrinfo EAI_AGAIN");
Expand Down
Loading