feat(connect): on-demand per-client status REST route + denied remediation (spec 075 T025-T029)#711
Conversation
…ation (spec 075 T025-T029)
Polish for the macOS TCC-safe Connect wizard (spec 075). The overall
GET /api/v1/connect listing already serialized the additive access_state/
remediation fields; this completes the REST contract:
- Add GET /api/v1/connect/{client}: on-demand single-client status that
reads the config at request time and resolves access_state to
accessible|absent|malformed|denied (the sole endpoint that may raise a
macOS App-Data prompt, scoped to user action). Unknown client -> 404;
a denial is reported in-band (200 + access_state="denied" + remediation).
- Map a permission-denied connect/disconnect (*connect.AccessError) to 403
carrying the remediation text, distinct from a generic 400 or 404.
- Docs: macOS "App Data privacy & Connect" note (cause + tccutil reset) in
docs/api/rest-api.md and a CLAUDE.md REST-payload note for the new fields.
- Regenerate oas/ (swagger + docs.go) for the new route.
Verification: go build personal + -tags server; go test -race
./internal/connect/... ./internal/httpapi/... green; golangci-lint v2
(connect + httpapi) 0 issues; scripts/test-api-e2e.sh 65/65 pass.
Related #696
Deploying mcpproxy-docs with
|
| Latest commit: |
14c9dc5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0ff9a168.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-075-connect-rest-polish.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27838284908 --repo smart-mcp-proxy/mcpproxy-go
|
…t/disconnect (MCP-2994) Fold the MCP-2994 review fix into the canonical Connect-polish PR: the connect/disconnect handlers now return 403 on a macOS App-Data permission denial, so document it in their godoc @failure annotations and regenerate oas/. Supersedes the redundant PR #730 (same change, minus the unrelated package-lock churn). Related #696 Co-Authored-By: Paperclip <noreply@paperclip.ing>
There was a problem hiding this comment.
APPROVE — reviewed via Claude Code (CodexReviewer model unavailable). REST-layer-only on top of merged #707. Critical #706 constraint verified: GET /api/v1/connect listing stays stat-only (AccessState=unknown, zero reads), only the new per-client route + connect/disconnect read content on explicit action. Error handling classifies by error class (fs.ErrPermission→denied) not string-match; denied→in-band 200 or 403 remediation wired end-to-end. go build clean; httpapi + connect tests pass; gofmt/vet clean. MCP-2832.
What
Polish for the macOS TCC-safe Connect wizard (spec 075, T025–T029). Completes the REST contract in
specs/075-macos-tcc-connect/contracts/connect-status.mdon top of the already-merged US1 (#706) and US2 (#707).GET /api/v1/connect/{client}(new): on-demand single-client status that reads the config at request time and resolvesaccess_statetoaccessible|absent|malformed|denied. This is the sole Connect endpoint that opens a client config file, so on macOS it is the only place an App-Data privacy prompt may legitimately appear (scoped to user action). Unknown client →404; a denial is reported in-band (200+access_state="denied"+remediation), not as an HTTP error.403: a permission-denied*connect.AccessErrormaps to403 Forbiddencarrying the remediation text, distinct from a generic400or a404not-found.GET /api/v1/connectlisting already serialized the additiveaccess_state(unknown) /remediationfields — confirmed additive-only, no content reads.tccutil reset) indocs/api/rest-api.md; CLAUDE.md REST-payload note for the new fields.oas/(swagger + docs.go) for the new route.Note: the diagnostics
<diag-pkg>doctor check (T027/T029 mention) is a separate issue (MCP-2831) not yet onmain, so it is out of this PR's lint/test scope.Tests (TDD)
New
internal/httpapi/connect_test.gocases, written failing first:TestHandleGetConnectStatus_IncludesAccessStateUnknown— overall listing additive, no content read.TestHandleGetConnectClientStatus_Connected|Absent|UnknownClient|DeniedSurfacesRemediation— on-demand route resolution + 404 + in-band denial.TestHandleConnectClient_DeniedReturnsRemediation— denied write →403with remediation.Verification
go build ./cmd/mcpproxy+go build -tags server ./cmd/mcpproxy✅go test -race ./internal/connect/... ./internal/httpapi/...✅golangci-lint run --config .github/.golangci.yml ./internal/connect/... ./internal/httpapi/...→ 0 issues ✅./scripts/test-api-e2e.sh→ 65/65 PASS (SC-006, no regression) ✅Related #696