Repository navigation
[log] Add debug logging to mcp/http_transport.go - #16190
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
A critical active finding remains because the debug log can emit credentials or query tokens from the wrapped request URL without applying the required enclave-aware redaction.
1 open issue
What changed in this PR
Adds debug logging to previously unlogged HTTP transport connection, session-detection, and initialization failure paths in internal/mcp/http_transport.go.
Changes:
- Logs network-operation and session-not-found detection paths.
- Logs initialization request failures, non-OK responses, and JSON-RPC errors.
- Preserves response body-length-only diagnostics.
| File | Review |
|---|---|
internal/mcp/http_transport.go |
Adds diagnostic logging across HTTP transport and initialization paths. A critical issue remains: wrapped errors may include credentials or query-token parameters from backend URLs and must be sanitized before being logged. |
This pull request requires changes.
Review effort: Lite (auto)
This comment has been minimized.
This comment has been minimized.
Updated error logging to sanitize sensitive information. Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE ( No write of any kind succeeded or leaked through on this run.
|

Adds debug logging (existing
logHTTP/logConnloggers) to previously unlogged paths ininternal/mcp/http_transport.go:isHTTPConnectionError: network op error detectionisSessionNotFoundError/isSessionNotFoundHTTPResponse: which detection path matchedinitializeHTTPSessionContext: failure paths (request error, non-OK status, JSON-RPC error)No side effects in log args; no secrets or bodies logged. Validated with
go vet,go test ./internal/mcp, andgo build.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
thishostdoesnotexist12345.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.