Skip to content

Fix: Don't expose /mcp/sys route when DIFC is disabled#277

Merged
lpcox merged 4 commits intomainfrom
copilot/fix-expose-sys-route
Jan 16, 2026
Merged

Fix: Don't expose /mcp/sys route when DIFC is disabled#277
lpcox merged 4 commits intomainfrom
copilot/fix-expose-sys-route

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

The /mcp/sys route was unconditionally registered in routed mode, creating an exposed but non-functional endpoint when DIFC is disabled (the default).

Changes

  • internal/server/routed.go: Only include "sys" in route registration when DIFC is enabled
  • internal/server/unified.go: Add IsDIFCEnabled() getter to expose DIFC configuration
  • internal/server/routed_test.go: Add tests verifying sys route presence/absence based on DIFC status

Behavior

Before:

$ ./awmg --routed --config config.toml
2026/01/16 01:15:15 Registered route: /mcp/sys      # ← Always registered
2026/01/16 01:15:15 Registered route: /mcp/github

After:

$ ./awmg --routed --config config.toml
2026/01/16 01:20:16 Registered route: /mcp/github   # ← sys route omitted

$ ./awmg --routed --config config.toml --enable-difc
2026/01/16 01:20:18 Registered route: /mcp/sys      # ← sys route only when DIFC enabled
2026/01/16 01:20:18 Registered route: /mcp/github
Original prompt

This section details on the original issue you should resolve

<issue_title>2026/01/10 00:21:11 Registered route: /mcp/sys</issue_title>
<issue_description>Don't expose the sys server</issue_description>

<agent_instructions>can you please confirm that the route /mcp/sys is not exposed to clients?</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 16, 2026 01:14
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
…registration

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix route exposure for /mcp/sys Fix: Don't expose /mcp/sys route when DIFC is disabled Jan 16, 2026
Copilot AI requested a review from lpcox January 16, 2026 01:21
@lpcox lpcox closed this Jan 16, 2026
@lpcox lpcox reopened this Jan 16, 2026
@lpcox lpcox marked this pull request as ready for review January 16, 2026 03:20
@lpcox lpcox merged commit 19880fc into main Jan 16, 2026
6 checks passed
@lpcox lpcox deleted the copilot/fix-expose-sys-route branch January 16, 2026 03:20
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.

2026/01/10 00:21:11 Registered route: /mcp/sys

2 participants