Repository navigation
feat(mcp): inline match card with Accept/Pass buttons for ChatGPT (MCP Apps) - #1877
Open
serefyarar wants to merge 1 commit into
Open
serefyarar wants to merge 1 commit into
serefyarar wants to merge 1 commit into
Conversation
…s hosts Hosts that render MCP UI components (ChatGPT, per the Apps SDK) can now show one opportunity as an interactive card. A new show_opportunity_card tool carries _meta.ui.resourceUri (and the openai/outputTemplate alias) pointing at a self-contained ui:// HTML resource; its Accept and Pass buttons call accept_opportunity and reject_opportunity over the host bridge, so a click rides the same tools, annotations, and approval gates as the model's own calls. The card allows no external connects or resources (initials avatar, CSP empty), follows the inline-card rules (two actions max, system fonts, no logo, light and dark), and hosts without UI support never fetch the resource. The submission manifest gains the new tool's annotations. Verified in a browser against a stubbed window.openai host: render, Accept -> accept_opportunity -> chat-open state -> openExternal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This branch has not been 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.
Closes IND-682's first milestone: the in-chat interactive experience.
What
ChatGPT (and any MCP Apps host) can now render one opportunity as an inline card with Accept / Pass buttons, instead of plain text.
services/api/src/lib/mcp/mcp.ui.ts(new): a self-containedui://index/match-card-v1.htmlresource (mimeTypetext/html;profile=mcp-app). The card shows the peer (initials avatar — nothing external loads), headline, summary, and cosign line; its buttons callaccept_opportunity/reject_opportunityover the host bridge (window.openai.callTool), so a click goes through the same tools, annotations, and approval gates as a model-initiated call. Light + dark, system fonts, max two actions, no logo — per the Apps SDK inline-card guidelines.show_opportunity_cardtool (inmcp.tools.ts): same fetch asget_opportunity, returnsstructuredContentvalidated by anoutputSchema, and carries_meta.ui.resourceUri+ theopenai/outputTemplatealias. Hosts without UI support never fetch the resource and can keep usingget_opportunity.connectDomains: [],resourceDomains: []— the card needs nothing external.chatgpt-app-submission.jsongains the new tool's annotations/justifications (read-only; the write tools keep their owndestructiveHint).Verified
Loaded the template in a real browser against a stubbed
window.openaihost:callTool('accept_opportunity', …)→ "You said yes — your chat with Jordan Rivera is open." + Open chat.openExternal({ href: <chat url> }).Terminal states (already committed / rejected / expired) render as notes without buttons.
tsc --noEmitand eslint pass.Before resubmission (not in this PR)
_meta.ui.domainmust be set to a unique per-plugin domain at submission time (currently defaults to OpenAI's sandbox domain).🤖 Generated with Claude Code