Repository navigation
fix(monitoring): update status dashboard for II #4052 per-user trust model - #21
Merged
Merged
Conversation
The status dashboard's "II health & recognition" section was built on the
pre-#4052 model where II had a global mcp_server_origin config and reflected it
into a CSP form-action that listed the trusted MCP origin. #4052 removed
mcp_server_origin entirely and made trust per-user (each identity adds its
trusted server in II Settings, synced on-chain), so those checks now produce
false failures: "II recognises this MCP server" fails (form-action no longer
lists the origin) and the mcp_server_origin config checks fail (field gone).
With overall=fail, server.js returns 503 from /api/status.
Replace the obsolete checks with the new instance-wide signal:
- ii-mcp-flow: probe GET {ii}/mcp and confirm it is served (200) with a CSP
form-action relaxed to allow https: — i.e. the delegation callback can POST
back to an https MCP server (the #4052 relaxed policy for /mcp paths).
- ii-config: still confirm /.config is served and surface backend_canister_id,
but drop the removed mcp_server_origin parsing/matching.
- Remove ii-recognises-mcp and ii-config-mcp-origin; update suggestions to the
per-user-trust reality.
Update unit tests and the tool README to match. Verified live against beta:
the II section now passes (overall WARN only from the pre-existing informational
/oauth/authorize discovery probe), so /api/status returns 200 and the dashboard
renders healthy instead of a false failure.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01K2T7oqtTPLDSasZC3b4Yrv
There was a problem hiding this comment.
Pull request overview
Updates the monitoring/mcp-status dashboard’s Internet Identity (II) health checks to align with Internet Identity PR #4052, which removed instance-wide mcp_server_origin and moved MCP trust to a per-user setting.
Changes:
- Replaces the obsolete “II recognises this MCP server” logic with a new
ii-mcp-flowcheck that probesGET {ii}/mcpand validates its CSPform-actionallowshttps:callback posts. - Simplifies the
ii-configcheck to stop parsing/matchingmcp_server_originand instead surfacebackend_canister_id. - Updates unit tests and README to reflect the post-#4052 trust model and the new checks.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| monitoring/mcp-status/README.md | Updates documentation to describe the post-#4052 per-user trust model and the new /mcp-based health signal. |
| monitoring/mcp-status/checks.test.js | Rewrites II-related tests to validate the new /mcp delegation flow and simplified .config parsing. |
| monitoring/mcp-status/checks.js | Implements the new ii-mcp-flow check, removes mcp_server_origin-based checks, and updates suggestions accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
Fixes the status dashboard (
monitoring/mcp-status, served athttps://mcp.beta.id.ai/status/), which was reporting false failures after the Internet Identity #4052 breaking changes.Why it was broken
The dashboard's "Internet Identity health & recognition" section was built on the pre-#4052 model:
mcp_server_originfrom/.configand checked it named this MCP server.form-actiondirective listed this MCP origin as the signal that II "recognises" the server.#4052 removed
mcp_server_originentirely and made trust per-user (each identity adds its trusted MCP server in II Settings, synced on-chain). So against the live beta II today:II recognises this MCP server→ FAIL (the SPA-wideform-actionis'self' http://127.0.0.1:*and never lists the origin).II frontend config/Config mcp_server_origin matches→ FAIL/WARN (mcp_server_originno longer exists in/.config).With
overall === "fail",server.jsreturns HTTP 503 from/api/status, so the dashboard surfaced a red, failing status even though the server and II are healthy.The fix
Replace the obsolete checks with the actual post-#4052 instance-wide signal:
ii-mcp-flow(new) — probeGET {ii}/mcpand confirm it's served (200) with a CSPform-actionrelaxed to allowhttps:. That relaxed policy (vs. the tight SPA-wide'self' http://127.0.0.1:*) is exactly what lets an https MCP server's delegation callback POST back, so it's the authoritative health signal for the delegation flow. The check documents that which servers a given identity trusts is per-user and not inspectable without authenticating.ii-config(kept, simplified) — still confirms/.configis served and now surfacesbackend_canister_id; dropped the removedmcp_server_originparsing/matching.ii-recognises-mcpandii-config-mcp-origin; updatedbuildSuggestionsto the per-user-trust reality.No changes to
report.js,server.js,cli.js, orpublic/index.html— they render the report generically, and the report's section/check shape is unchanged.Verification
node --test monitoring/mcp-status/checks.test.js— 14/14 pass (tests rewritten for the new model, incl. pass/warn/fail cases forii-mcp-flow).node monitoring/mcp-status/cli.js): the II section now passes —II /mcp delegation flow enabled(form-action'self' https:) andII frontend config(200, backendfgte5-ciaaa-aaaad-aaatq-cai) both green. Overall is WARN only from the pre-existing, informational/oauth/authorizelive-discovery probe (not readable headlessly), so/api/statusreturns 200 and the dashboard renders healthy.beta.id.ai/.config(200) no longer containsmcp_server_origin;beta.id.ai/mcpCSPform-actionis'self' https:whilebeta.id.ai/is'self' http://127.0.0.1:*.🤖 Generated with Claude Code
Generated by Claude Code