Skip to content

docs(connect): add @Failure 403 swagger annotation to connect/disconnect handlers#730

Closed
Dumbris wants to merge 2 commits into
mainfrom
fix/mcp-2994-403-swagger-annotations
Closed

docs(connect): add @Failure 403 swagger annotation to connect/disconnect handlers#730
Dumbris wants to merge 2 commits into
mainfrom
fix/mcp-2994-403-swagger-annotations

Conversation

@Dumbris

@Dumbris Dumbris commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

Adds missing @Failure 403 swagger annotations to the connect/disconnect handlers in connect.go.

Fixes MCP-2994: swagger docs were missing the 403 response code for connect/disconnect handlers.

Changes

  • Added @Failure 403 annotations to connect and disconnect handler functions

Co-Authored-By: Paperclip noreply@paperclip.ing

Dumbris added 2 commits June 18, 2026 09:48
…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
…ect handlers

The writeIfAccessDenied helper in handleConnectClient and
handleDisconnectClient can return 403 when macOS TCC denies
App-Data access, but the swagger godoc annotations did not
declare this response. Add @failure 403 to both handlers and
regenerate oas/swagger.yaml + oas/docs.go.

Related #696
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a21d7db
Status: ✅  Deploy successful!
Preview URL: https://a44ca38e.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-mcp-2994-403-swagger-ann.mcpproxy-docs.pages.dev

View logs

Dumbris added a commit that referenced this pull request Jun 19, 2026
…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>
@Dumbris

Dumbris commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

Closing as folded into the canonical MCP-2832 PR #711.

#730 was branched from feat/075-connect-rest-polish and is a strict superset of #711 — its only substantive delta was the two @Failure 403 swagger annotations on the connect/disconnect handlers (the MCP-2994 fix), plus an unrelated frontend/package-lock.json churn ("dev": true additions from a local npm install).

I've cherry-picked the @Failure 403 annotations into #711 (commit 14c9dc5) and regenerated oas/ cleanly (no package-lock change), so #711 now carries the complete change. Keeping two open PRs that both add GET /api/v1/connect/{client} to main would guarantee a merge conflict, so this one is closed in favor of #711. The MCP-2994 deliverable lands via #711.

@Dumbris Dumbris closed this Jun 19, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 68.00000% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/httpapi/connect.go 66.66% 6 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Dumbris added a commit that referenced this pull request Jun 19, 2026
…ation (spec 075 T025-T029) (#711)

* feat(connect): on-demand per-client status REST route + denied remediation (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

* docs(connect): add @failure 403 swagger annotations for denied connect/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>

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants