feat(mcp): add authenticated HTTP transport - #205
Conversation
|
I have enough context to write the full review. Let me compile the findings. PR #205 —
|
| # | File | Line | Severity | Issue |
|---|---|---|---|---|
| 1 | crates/plumb-cli/src/commands/mcp.rs |
34 | REQUEST_CHANGES | Ok(token) should be Ok(token.trim().to_owned()) — untrimmed token is a silent footgun |
| 2 | crates/plumb-mcp/src/lib.rs |
769 | Warning | # Errors says "service cannot be constructed" but the McpError::Service path is handler.shutdown(), not construction — fix the description |
| 3 | crates/plumb-cli/tests/mcp_http.rs |
— | Warning | No test covering trimmed-whitespace token acceptance once item 1 is fixed |
| 4 | crates/plumb-mcp/src/lib.rs |
104 | Security note | ct_eq leaks token length; acceptable for loopback, but document the scope constraint if --bind is ever added |
Verdict: REQUEST_CHANGES
Summary
Closes #81
plumb mcp --transport http --port <PORT>alongside the existing stdio defaultPLUMB_MCP_TOKENat HTTP boot and reject missing/invalid bearer tokens with 401Scope
Validation
Codex reported validation during implementation, but the ACP run timed out before returning details. Verified after completion:
git diff --check HEAD~1..HEAD— passedFollow-up CI will run the full cargo test/clippy matrix.