Skip to content

feat(mcp): log MCP enabled/disabled state at startup - #33

Merged
malickyeu merged 1 commit into
mainfrom
feat/mcp-startup-log
Jun 14, 2026
Merged

feat(mcp): log MCP enabled/disabled state at startup#33
malickyeu merged 1 commit into
mainfrom
feat/mcp-startup-log

Conversation

@malickyeu

Copy link
Copy Markdown
Contributor

Small ops/UX follow-up to the MCP feature, prompted by a real misconfig: setting DC_MCP_ENABLE (a typo — missing the trailing D) left MCP silently off while /mcp happily served the SPA, and nothing in the log said so.

  • Startup log line — boot now logs the resolved MCP state:

    • MCP server: disabled (set DC_MCP_ENABLED=1 to enable)
    • MCP server: ENABLED at http://host/mcp — auth: bearer tokens only (set DC_MCP_PUBLIC_URL to enable OAuth)
    • … — auth: bearer tokens + OAuth (https://…) when a public URL is configured

    So a typo'd/forgotten flag is obvious at a glance. Verified by running the binary in all three states.

  • Doc/comment accuracy — a disabled /mcp falls through to the SPA (or a bare 404 only when no UI is embedded), not always a 404. Corrected docs/mcp.md and the MCPEnabled config comment.

No new logic or attack surface — the enabled/disabled config and route mounting are already covered by TestMCPMountToggle; this is the bootstrap log + docs.

Type of change

  • New feature (small / ops)

Surfaces whether the remote MCP server is on, at what path, and which auth modes
are available — so a misconfig (e.g. a DC_MCP_ENABLED typo) is obvious from the
log instead of silently serving the SPA on /mcp. Also corrects the docs/comment
wording: a disabled /mcp falls through to the SPA (or 404 without an embedded
UI), not always a bare 404.
Copilot AI review requested due to automatic review settings June 13, 2026 21:12

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.

Pull request overview

This PR improves MCP operational visibility by logging the resolved MCP enabled/disabled state at server startup, and updates documentation/comments to accurately describe how /mcp behaves when MCP is disabled (falls through to the SPA when embedded UI is present, otherwise 404).

Changes:

  • Add a startup log line indicating whether MCP is enabled, and what auth modes are available.
  • Update the MCPEnabled config field comment and docs/mcp.md to reflect the real “disabled” routing behavior.
  • Update web/package-lock.json (appears unrelated to the described MCP logging/docs scope).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
cmd/dockercmd/main.go Logs MCP enabled/disabled state and auth mode at startup.
internal/config/config.go Adjusts MCPEnabled comment to reflect SPA fallthrough vs 404 when disabled.
docs/mcp.md Updates docs to match actual disabled-route behavior and mentions the new startup log line.
web/package-lock.json Lockfile changes (adds "peer": true flags / removes some entries).
Files not reviewed (1)
  • web/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/dockercmd/main.go
Comment on lines +241 to +246
if cfg.MCPEnabled {
oauth := "bearer tokens only (set DC_MCP_PUBLIC_URL to enable OAuth)"
if cfg.MCPPublicURL != "" {
oauth = "bearer tokens + OAuth (" + cfg.MCPPublicURL + ")"
}
log.Printf("MCP server: ENABLED at %s://%s/mcp — auth: %s", scheme, cfg.Addr, oauth)
Comment thread web/package-lock.json
Comment on lines 181 to 185
"resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.1.tgz",
"integrity": "sha512-+BIjw/AG3tDQ4pJgTLPYdAW25eDE66YsvM4LKyVPgGzVgZ4a9Wj1SRX8kPVKgBDdPt8oHtZ15F0qx7p0oOHdHw==",
"license": "MIT",
"peer": true,
"dependencies": {
@malickyeu
malickyeu merged commit 42644b1 into main Jun 14, 2026
4 checks passed
@malickyeu
malickyeu deleted the feat/mcp-startup-log branch July 31, 2026 08:09
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