Repository navigation
feat(mcp): Zernio MCP App, interactive views in Claude and ChatGPT (behind ZERNIO_MCP_APPS) - #113
Merged
Merged
Conversation
Interactive views Claude and ChatGPT render in the chat, off unless ZERNIO_MCP_APPS=1 so production is unchanged until it is turned on. A view binds to the tool the host called, and most tools are reached through call_tool, so each view gets its own always-listed show_* display tool that fetches its own data (monday.com's show-* pattern): - show_post_preview: per-platform preview with validation, Publish now / Save as draft via posts_cross_post - show_failed_posts: failed posts with a Retry per post - show_analytics: daily totals and chart, fullscreen platform breakdown - show_account_health: accounts by health, Reconnect link - show_ads_alerts: ads needing attention, Fix / Dismiss / Ask Claude - show_automation_approvals: pending automation changes, Approve / Reject - zernio_overview: the overview card, rebuilt on the runtime ui_dismiss_ads_alert and ui_decide_automation_approval are app-only, for the views' buttons. Views are self-contained HTML (no CDN) on a shared MCP Apps 2026-01-26 bridge, styled with host tokens and the zernio.com accent. Everything lives in late/mcp/apps so the trial can be removed in one go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A first cut of one app instead of separate views, following beel-mcp's structure: apps-src/ is a Vite + TypeScript project on the official ext-apps SDK, built by vite-plugin-singlefile into one self-contained src/late/mcp/apps/bundle/app.html (248 kB, 66 kB gzipped), committed so the Python image needs no Node. zernio_open_app opens it (also listed on Claude's Artifacts page through the openai/ui entry point). The app loads its own data with callServerTool: account health, and failed posts through the unlisted posts_list_posts, which tests whether Claude lets an app call a tool it never listed. Inline it is a compact card with Open Zernio for full screen; it tells Claude what it shows (updateModelContext) and hands fixes to the chat (sendMessage). zernio.com tokens, Lucide icons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuilt on the ext-apps SDK's React pattern (useApp, useHostStyles, as in its basic-server-react example) instead of beel-mcp's structure, and drawn in the dashboard's product look (data-look="v2"): the Theme, Scale and type/* values of Schedule-Posts-API's new-look.ts, Geist, Geist Mono and Geist Pixel Square, pixelarticons, platform app icons from zernio.com, square panels with a grey eyebrow bar, KPIs on one row divided by hairlines, StatusPill with its reason behind the info mark, the fix as an outline button in the row, notices as coloured text and the pixel-rain spinner. MCP Apps take fonts only from declared origins, so the server serves the three woff2 files at /apps/fonts/ (CORS *) and fills its own MCP_PUBLIC_URL into the bundle and into the resource's CSP, with zernio.com for the icons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit was pushed before these files were staged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every screen now lives in the React app and is drawn from the same
design system v2 components (Section, Kpis, Row, StatusPill,
PlatformTile, Badge, Tabs, Notice, Button, Spinner), as beel-mcp keeps
one app: Home, Failed posts, Analytics, Accounts, Ads, Post preview and
Approvals.
Every show_* tool and zernio_open_app opens that one resource
(ui://zernio/v2/app.html) and returns {view, data, args}; the app
switches tabs and refreshes by calling the same tools, so data comes
from listed tools only. If the opening tool's result never arrives (the
app loaded no data on dev), it loads the opening tool's screen itself.
Full screen adds tabs; publishing from the preview takes two clicks.
The seven hand-written HTML views, their runtime.js and base.css are
gone; zernio_overview is text while the app is on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Reconnect button asked nothing of the account and opened the
dashboard. It now gets the account's reconnect link through the app-only
ui_reconnect_account (GET /v1/connect/{platform} with reconnectAccountId
and the account's profileId), so signing in refreshes that same account,
keeping its id and history. A refusal shows on the row's state pill.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New Inbox tab, drawn with the same components as every other screen: the latest conversations and the posts with comments (show_inbox), a conversation as a thread with a reply box (show_conversation, sending through the app-only ui_send_message, since messages_send_inbox_message is not listed) and a post's comments with a reply per comment (show_post_comments, replying through the listed comments_reply_to_inbox_post). Each reply box can hand drafting to Claude. The Approvals screen, show_automation_approvals and ui_decide_automation_approval are gone for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/late/mcp/server.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
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.
Summary
Adds an MCP App: an interactive Zernio panel that Claude and ChatGPT render inside the chat (Claude calls these "interactive connectors"). It's off unless
ZERNIO_MCP_APPS=1, so production is unchanged when this merges.It's one app with several screens, drawn in the dashboard's design system v2 (
data-look="v2"in Schedule-Posts-API). It's structured like beel-mcp's app and built on the official ext-apps React pattern.The screens
zernio_open_appshow_inboxshow_conversationshow_post_commentsshow_failed_postsshow_analyticsshow_account_healthshow_ads_alertsshow_post_previewAll of them share one header (logo, breadcrumb, refresh, full screen). In full screen there are tabs for Home, Inbox, Failed posts, Analytics, Accounts and Ads. Inline, each screen shows a compact card.
How it works
apps-src/is Vite 8, React 19, TypeScript 7 and@modelcontextprotocol/ext-apps2.0.4 (theuseApp/useHostStylespattern from the SDK'sbasic-server-reactexample). It builds into one self-containedsrc/late/mcp/apps/bundle/mcp-app.html(500 kB, 142 kB gzipped). The built file is committed, so the Python image needs no Node. Rebuild withcd apps-src && npm run build.src/late/mcp/apps/tools.pyopens the same resource,ui://zernio/v2/app.html. Each returns a text summary for the model and for clients without MCP Apps, plus{view, data, args}for the app. The app switches tabs and refreshes by calling those same tools. These tools are added to the always-listed set while the switch is on, because a view only renders for a tool the host received intools/list.visibility: ["app"], hidden from the model):ui_reconnect_account:GET /v1/connect/{platform}withreconnectAccountIdui_send_message:messages_send_inbox_messageisn't listed, so the app can't call it directlyui_dismiss_ads_alerttype/*values oflibs/design-system/new-look.tszernio.com/platform-logosdesign-principles.md, cited by number in the codedata:URLs. So the server serves the three woff2 files at/apps/fonts/with CORS*, and writes its ownMCP_PUBLIC_URLinto the bundle and into the resource's CSP.updateModelContextafter each screen and each action, andsendMessagefor "Ask Claude" and "Draft with Claude".Other changes
zernio_overviewis plain text while the switch is on. With it off, it keeps its current card.server.py:_platform_errorsnow builds on a new_failed_targetshelper, which the failed-posts screen also uses. Merged with develop'smedia_item(fix(mcp): leave the media type out when the URL has no known extension #102), which the preview uses too..railway/railway.ts:ZERNIO_MCP_APPSadded to the production variables thatrailway config applykeeps. Without it, the next apply would delete the variable.Testing
Not in this PR
show_view)🤖 Generated with Claude Code