Skip to content

fix(monitoring): update status dashboard for II #4052 per-user trust model - #21

Merged
aterga merged 1 commit into
mainfrom
claude/imcp2-status-dashboard-fix
Jun 28, 2026
Merged

aterga merged 1 commit into
mainfrom
claude/imcp2-status-dashboard-fix

Conversation

@aterga

@aterga aterga commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

What

Fixes the status dashboard (monitoring/mcp-status, served at https://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:

  • It read II's global mcp_server_origin from /.config and checked it named this MCP server.
  • It verified the II's SPA-wide CSP form-action directive listed this MCP origin as the signal that II "recognises" the server.

#4052 removed mcp_server_origin entirely 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-wide form-action is 'self' http://127.0.0.1:* and never lists the origin).
  • II frontend config / Config mcp_server_origin matches → FAIL/WARN (mcp_server_origin no longer exists in /.config).

With overall === "fail", server.js returns 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) — probe GET {ii}/mcp and confirm it's served (200) with a CSP form-action relaxed to allow https:. 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 /.config is served and now surfaces backend_canister_id; dropped the removed mcp_server_origin parsing/matching.
  • Removed ii-recognises-mcp and ii-config-mcp-origin; updated buildSuggestions to the per-user-trust reality.
  • Updated the tool README (Section 3 description + beta snapshot) to match.

No changes to report.js, server.js, cli.js, or public/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 for ii-mcp-flow).
  • Ran live against beta (node monitoring/mcp-status/cli.js): the II section now passes — II /mcp delegation flow enabled (form-action 'self' https:) and II frontend config (200, backend fgte5-ciaaa-aaaad-aaatq-cai) both green. Overall is WARN only from the pre-existing, informational /oauth/authorize live-discovery probe (not readable headlessly), so /api/status returns 200 and the dashboard renders healthy.
  • Confirmed ground truth directly: beta.id.ai/.config (200) no longer contains mcp_server_origin; beta.id.ai/mcp CSP form-action is 'self' https: while beta.id.ai/ is 'self' http://127.0.0.1:*.

Note: the live dashboard updates once this merges to main and the imcp-status.service redeploys.

🤖 Generated with Claude Code


Generated by Claude Code

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
@aterga
aterga requested a review from Copilot June 28, 2026 13:00
@aterga
aterga marked this pull request as ready for review June 28, 2026 13:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-flow check that probes GET {ii}/mcp and validates its CSP form-action allows https: callback posts.
  • Simplifies the ii-config check to stop parsing/matching mcp_server_origin and instead surface backend_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.

@aterga
aterga merged commit e00132f into main Jun 28, 2026
1 check passed
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.

3 participants