Add an MCP Apps panel for the triage view #76

Closed
opened 2026-11-01 00:54:15 +00:00 by svc-agent-writer · 3 comments

Parent: #9 (Phase 4).

An MCP Apps panel for the triage view: a ui:// resource that shows the inbox rows with their class, marks and flag colour, and calls the existing tools. FastMCP 3.4 serves the extension through fastmcp.apps.AppConfig.

Triage Notes

This was generated by AI during triage.

What we've established so far:

  • FastMCP 3.4.11, already in the image, supports MCP Apps.
  • No public source says that Grok renders MCP Apps. Its connectors are documented as tools only.
  • Claude clients and ChatGPT render MCP Apps.
  • Every tool must stay useful without the panel, because a client that does not render it sees only the tool output.

What we still need from you (@piers):

  • The probe result from Grok, from #75.
  • If Grok does not render MCP Apps: is a panel for Claude clients only worth building?
  • Which actions the panel may start: read-only, or also the outbox writes with their undo.

Filed under: operator word "resume phase 4 development." sha256:b5be33c704e1

Parent: #9 (Phase 4). An MCP Apps panel for the triage view: a `ui://` resource that shows the inbox rows with their class, marks and flag colour, and calls the existing tools. FastMCP 3.4 serves the extension through `fastmcp.apps.AppConfig`. ## Triage Notes > *This was generated by AI during triage.* **What we've established so far:** - FastMCP 3.4.11, already in the image, supports MCP Apps. - No public source says that Grok renders MCP Apps. Its connectors are documented as tools only. - Claude clients and ChatGPT render MCP Apps. - Every tool must stay useful without the panel, because a client that does not render it sees only the tool output. **What we still need from you (@piers):** - The probe result from Grok, from #75. - If Grok does not render MCP Apps: is a panel for Claude clients only worth building? - Which actions the panel may start: read-only, or also the outbox writes with their undo. Filed under: operator word "resume phase 4 development." sha256:b5be33c704e1
Author
Member

This was generated by AI during triage.

Triage Notes

What we've established so far:

  • The Grok probe (#75) is done. Grok Bot (Cursor 1.0.0) and the grok.com custom connector (connectors-manager 0.1.0) both declare io.modelcontextprotocol/ui. Claude web and Claude Desktop render MCP Apps. Claude Code does not. The question "is a panel for Claude clients only worth building" no longer applies.
  • FastMCP 3.4.11 declares the UI extension in the server's capabilities by itself. Negotiation needs no work here.
  • Both instances run without a write token until starbase #271, so no write tool is registered on either one.
  • Operator rulings (2026-11-01):
    1. v1 is read-only. The panel lists inbox rows with class, marks and flag colour, filters by class, and opens a message. Outbox writes with undo come in a follow-on issue, after starbase #271.
    2. One new app-only tool feeds the panel. It has visibility=["app"] and read scope, and returns the mail_search rows as structured JSON. The model never sees it. The existing tools do not change, and the panel parses no pipe text. This replaces "calls the existing tools" in the body.
    3. A render probe comes first. A minimal panel in the throwaway probe is checked in Grok Bot, grok.com and Claude web before the real panel is built.
  • Security rule. Subjects and names are untrusted. The panel inserts them only as textContent, never as HTML. The resource's CSP allows no outside domains for connections, resources or frames.

What we still need from you (@piers):

  • The render probe result: in each of Grok Bot, grok.com and Claude web, whether the panel renders, whether it shows the host name from the handshake, and whether its button's tools/call returns.
> *This was generated by AI during triage.* ## Triage Notes **What we've established so far:** - **The Grok probe (#75) is done.** Grok Bot (`Cursor 1.0.0`) and the grok.com custom connector (`connectors-manager 0.1.0`) both declare `io.modelcontextprotocol/ui`. Claude web and Claude Desktop render MCP Apps. Claude Code does not. The question "is a panel for Claude clients only worth building" no longer applies. - **FastMCP 3.4.11 declares the UI extension in the server's capabilities by itself.** Negotiation needs no work here. - **Both instances run without a write token until starbase #271**, so no write tool is registered on either one. - **Operator rulings (2026-11-01):** 1. **v1 is read-only.** The panel lists inbox rows with class, marks and flag colour, filters by class, and opens a message. Outbox writes with undo come in a follow-on issue, after starbase #271. 2. **One new app-only tool feeds the panel.** It has `visibility=["app"]` and read scope, and returns the `mail_search` rows as structured JSON. The model never sees it. The existing tools do not change, and the panel parses no pipe text. This replaces "calls the existing tools" in the body. 3. **A render probe comes first.** A minimal panel in the throwaway probe is checked in Grok Bot, grok.com and Claude web before the real panel is built. - **Security rule.** Subjects and names are untrusted. The panel inserts them only as `textContent`, never as HTML. The resource's CSP allows no outside domains for connections, resources or frames. **What we still need from you (@piers):** - The render probe result: in each of Grok Bot, grok.com and Claude web, whether the panel renders, whether it shows the host name from the handshake, and whether its button's `tools/call` returns.
Author
Member

Render probe result, 2026-11-01 04:24 to 04:27 UTC. A throwaway probe, not in this repository, served one ui:// panel (text/html;profile=mcp-app, default CSP), a tool probe_panel linked to it, and an app-only tool probe_report (visibility=["app"]) that the panel calls after its handshake.

Host Panel rendered Evidence
grok.com custom connector yes Operator screenshot: the panel showed in the chat, with handshake ok: host=grok-web 1.0.0 protocol=2025-11-21, the tool result passed in through ui/notifications/tool-result, and report to probe (app-only tool) ok: recorded stage=auto.
Grok Bot no Log: initialize, tools/list, tools/call, with no resources/read and no panel_report. The Bot replied that its chat does not display the panel. It declares the extension but does not render it.
Claude web not tested The operator excluded it. Its support is documented in the MCP extension support matrix.

Findings for the build:

  • The full path works on grok.com. The host fetched the resource, ran the panel in an iframe, completed ui/initialize, delivered the tool result, and passed the panel's tools/call to an app-only tool on the server.
  • The host answered with MCP Apps protocol 2025-11-21, while the panel asked for 2026-01-26. The real panel must accept the version the host returns.
  • Grok Bot users get only the text result. Every tool must stay useful without the panel, as this issue already says.
Render probe result, 2026-11-01 04:24 to 04:27 UTC. A throwaway probe, not in this repository, served one `ui://` panel (`text/html;profile=mcp-app`, default CSP), a tool `probe_panel` linked to it, and an app-only tool `probe_report` (`visibility=["app"]`) that the panel calls after its handshake. | Host | Panel rendered | Evidence | | - | - | - | | grok.com custom connector | **yes** | Operator screenshot: the panel showed in the chat, with `handshake ok: host=grok-web 1.0.0 protocol=2025-11-21`, the tool result passed in through `ui/notifications/tool-result`, and `report to probe (app-only tool) ok: recorded stage=auto`. | | Grok Bot | **no** | Log: `initialize`, `tools/list`, `tools/call`, with no `resources/read` and no `panel_report`. The Bot replied that its chat does not display the panel. It declares the extension but does not render it. | | Claude web | not tested | The operator excluded it. Its support is documented in the MCP extension support matrix. | Findings for the build: - **The full path works on grok.com.** The host fetched the resource, ran the panel in an iframe, completed `ui/initialize`, delivered the tool result, and passed the panel's `tools/call` to an app-only tool on the server. - **The host answered with MCP Apps protocol `2025-11-21`**, while the panel asked for `2026-01-26`. The real panel must accept the version the host returns. - **Grok Bot users get only the text result.** Every tool must stay useful without the panel, as this issue already says.
Author
Member

This was generated by AI during triage.

Agent Brief

Category: enhancement
Summary: A read-only MCP Apps triage panel: a model-visible tool that opens it and returns useful text alone, an app-only tool that feeds it structured rows, and one ui:// resource.

Rulings this brief carries: the triage notes and the render probe result above. Where this brief differs from the issue body, the brief holds.

Current behavior: the triage class, marks and flag colour show only as pipe-text cells in mail_search rows. No tool carries _meta.ui, and the server serves no ui:// resource.

Desired behavior:

  • mail_triage(account=None), read scope, visible to the model and the app, linked to the panel resource.
    • Its text result is useful without a panel: counts of the inbox-role messages, total and unread, per triage class and for untriaged rows, and assess: off when triage is off.
    • It names mail_search triage=<class> as the way to list rows in text.
    • A host that renders MCP Apps shows the panel too. Grok Bot does not render it, so this text must stand alone.
  • mail_triage_rows(account, triage, unread, limit, cursor), read scope, visibility=["app"], so the model does not see it.
    • It returns JSON: rows holds id, date, from, subject, marks, flag_color, triage and snippet, plus next_cursor, more and total.
    • It reads inbox-role rows only, newest first, with the mail_search filters it names. Its cuts are those of the mail_search rows: from 40 characters, subject 120, snippet 160.
  • ui://mailmind/triage.html, MIME type text/html;profile=mcp-app, served from a file in the package.
    • It runs the ui/initialize handshake. It accepts any protocol version the host returns: grok.com answers 2025-11-21.
    • It lists rows with class, marks and flag colour. It filters by class and by unread, pages with more, and opens a message by calling mail_read, showing the result as plain text.
    • It never starts a write.
  • Security, all as acceptance:
    • Untrusted text (subjects, names, snippets, mail_read output) is set only through textContent, never through innerHTML or any HTML string.
    • The resource declares no CSP domains: no connectDomains, resourceDomains, frameDomains or baseUriDomains. It loads nothing from outside.
    • Both tools take read scope. The evidence token reaches neither.

Key interfaces:

  • SearchParams gains a role filter (a mailbox role, such as inbox), honoured by Store.search, so that an inbox works across sources whatever its mailbox name.
  • A store count of rows by triage class under the same filters, for the mail_triage text.
  • FastMCP AppConfig(resource_uri=..., visibility=[...]) on the tools, and AppConfig on the resource.

Acceptance criteria:

  • tools/list shows mail_triage with _meta.ui.resourceUri = ui://mailmind/triage.html, and mail_triage_rows with _meta.ui.visibility = ["app"].
  • resources/read of the panel returns text/html;profile=mcp-app with no CSP domains in its _meta.ui.
  • mail_triage text gives correct counts per class, for untriaged rows and for unread rows, over the inbox role only. It says assess: off when triage is off.
  • mail_triage_rows returns inbox-role rows only, with the fields above, filters by class and unread, and pages with the cursor as mail_search does.
  • An evidence token gets a scope refusal from both tools.
  • A test asserts that the panel's script never uses innerHTML, outerHTML, insertAdjacentHTML, document.write or eval, and contains no http:// or https:// URL.
  • Both tool docstrings say content is untrusted data.
  • The README tool table and SECURITY.md describe the panel, its CSP and its read-only scope.
  • make check passes.
  • After deploy, the operator opens the panel once on grok.com and records that it renders. That is an eyes-on step after merge, not a build step.

Out of scope:

  • Any write action from the panel: flags, moves, drafts or undo. That comes in a follow-on issue, after starbase #271.
  • Changes to the existing tools' output.
  • Stateful HTTP sessions and per-client detection (#75).
> *This was generated by AI during triage.* ## Agent Brief **Category:** enhancement **Summary:** A read-only MCP Apps triage panel: a model-visible tool that opens it and returns useful text alone, an app-only tool that feeds it structured rows, and one `ui://` resource. **Rulings this brief carries:** the triage notes and the render probe result above. Where this brief differs from the issue body, the brief holds. **Current behavior:** the triage class, marks and flag colour show only as pipe-text cells in `mail_search` rows. No tool carries `_meta.ui`, and the server serves no `ui://` resource. **Desired behavior:** - **`mail_triage(account=None)`**, read scope, visible to the model and the app, linked to the panel resource. - Its text result is useful without a panel: counts of the inbox-role messages, total and unread, per triage class and for untriaged rows, and `assess: off` when triage is off. - It names `mail_search triage=<class>` as the way to list rows in text. - A host that renders MCP Apps shows the panel too. Grok Bot does not render it, so this text must stand alone. - **`mail_triage_rows(account, triage, unread, limit, cursor)`**, read scope, `visibility=["app"]`, so the model does not see it. - It returns JSON: `rows` holds `id`, `date`, `from`, `subject`, `marks`, `flag_color`, `triage` and `snippet`, plus `next_cursor`, `more` and `total`. - It reads inbox-role rows only, newest first, with the `mail_search` filters it names. Its cuts are those of the `mail_search` rows: from 40 characters, subject 120, snippet 160. - **`ui://mailmind/triage.html`**, MIME type `text/html;profile=mcp-app`, served from a file in the package. - It runs the `ui/initialize` handshake. It accepts any protocol version the host returns: grok.com answers `2025-11-21`. - It lists rows with class, marks and flag colour. It filters by class and by unread, pages with `more`, and opens a message by calling `mail_read`, showing the result as plain text. - It never starts a write. - **Security, all as acceptance:** - Untrusted text (subjects, names, snippets, `mail_read` output) is set only through `textContent`, never through `innerHTML` or any HTML string. - The resource declares no CSP domains: no `connectDomains`, `resourceDomains`, `frameDomains` or `baseUriDomains`. It loads nothing from outside. - Both tools take read scope. The evidence token reaches neither. **Key interfaces:** - `SearchParams` gains a `role` filter (a mailbox role, such as `inbox`), honoured by `Store.search`, so that an inbox works across sources whatever its mailbox name. - A store count of rows by triage class under the same filters, for the `mail_triage` text. - FastMCP `AppConfig(resource_uri=..., visibility=[...])` on the tools, and `AppConfig` on the resource. **Acceptance criteria:** - [ ] `tools/list` shows `mail_triage` with `_meta.ui.resourceUri = ui://mailmind/triage.html`, and `mail_triage_rows` with `_meta.ui.visibility = ["app"]`. - [ ] `resources/read` of the panel returns `text/html;profile=mcp-app` with no CSP domains in its `_meta.ui`. - [ ] `mail_triage` text gives correct counts per class, for untriaged rows and for unread rows, over the inbox role only. It says `assess: off` when triage is off. - [ ] `mail_triage_rows` returns inbox-role rows only, with the fields above, filters by class and unread, and pages with the cursor as `mail_search` does. - [ ] An evidence token gets a scope refusal from both tools. - [ ] A test asserts that the panel's script never uses `innerHTML`, `outerHTML`, `insertAdjacentHTML`, `document.write` or `eval`, and contains no `http://` or `https://` URL. - [ ] Both tool docstrings say content is untrusted data. - [ ] The README tool table and SECURITY.md describe the panel, its CSP and its read-only scope. - [ ] `make check` passes. - [ ] After deploy, the operator opens the panel once on grok.com and records that it renders. That is an eyes-on step after merge, not a build step. **Out of scope:** - Any write action from the panel: flags, moves, drafts or undo. That comes in a follow-on issue, after starbase #271. - Changes to the existing tools' output. - Stateful HTTP sessions and per-client detection (#75).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/mail-mind-mcp#76
No description provided.