Skip to content

Disable /reflect endpoints - #16411

Merged
lpcox merged 2 commits into
mainfrom
copilot/disable-reflect-endpoint
Nov 12, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/disable-reflect-endpoint

Conversation

Copilot AI commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Disable mcpg’s /reflect endpoint across unified and routed gateway modes and proxy mode, including /api/v3/reflect. Preserve /health and existing readiness behavior.

  • Routing: Remove gateway reflection registration and return 404 for proxy reflection paths before policy handling.
  • Docs and coverage: Remove endpoint documentation and update route tests to assert 404 while retaining health checks.
curl -i http://localhost:8080/reflect
curl -i http://localhost:8080/api/v3/reflect
# Both return 404 Not Found

Copilot AI linked an issue Nov 12, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Disable /reflect and return HTTP 404 Disable /reflect endpoints Nov 12, 2026
Copilot AI requested a review from lpcox November 12, 2026 17:41
@lpcox
lpcox marked this pull request as ready for review November 12, 2026 17:42
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review reports no active issues with the change disabling MCP Gateway reflection endpoints.

No open issues 🎉

What changed in this PR

Disables MCP Gateway’s reflection endpoints across unified, routed, and proxy modes, addressing #16410 while preserving health and readiness behavior.

Changes:

  • Removes gateway /reflect registration and returns 404 for proxy reflection paths, including /api/v3/reflect, before policy handling.
  • Updates route tests to expect 404 and retains health checks.
  • Removes reflection endpoint documentation and obsolete handler tests.
File Description
README.md Removes reflection endpoint documentation and response schema.
internal/​server/​reflect_test.go Checks 404 in both gateway modes and confirms /health remains available.
internal/​server/​handlers.go Removes the reflection handler and route registration.
internal/​server/​handle_health_reflect_test.go Removes reflection handler tests while retaining health tests.
internal/​proxy/​handler.go Returns 404 for normalized reflection paths before policy handling.
internal/​proxy/​handler_test.go Checks both reflection paths in normal and read-only proxy modes.
internal/​difc/​reflect.go Updates the snapshot type’s comment without changing behavior.
docs/​PROXY_MODE.md Removes proxy reflection endpoint documentation.

Review effort: Balanced (auto)

@lpcox
lpcox merged commit ced10aa into main Nov 12, 2026
55 checks passed
@lpcox
lpcox deleted the copilot/disable-reflect-endpoint branch November 12, 2026 17:58
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.

Disable /reflect and return HTTP 404

3 participants