feat(mcp): log MCP enabled/disabled state at startup - #33
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
MCPEnabledconfig field comment anddocs/mcp.mdto 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 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 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": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small ops/UX follow-up to the MCP feature, prompted by a real misconfig: setting
DC_MCP_ENABLE(a typo — missing the trailingD) left MCP silently off while/mcphappily 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 configuredSo a typo'd/forgotten flag is obvious at a glance. Verified by running the binary in all three states.
Doc/comment accuracy — a disabled
/mcpfalls through to the SPA (or a bare404only when no UI is embedded), not always a 404. Correcteddocs/mcp.mdand theMCPEnabledconfig 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