booking-mcp-app: Add view-only MCP App for court availability - #46
Open
dragoscocs wants to merge 1 commit into
Open
booking-mcp-app: Add view-only MCP App for court availability#46dragoscocs wants to merge 1 commit into
dragoscocs wants to merge 1 commit into
Conversation
An MCP server that exposes court availability for a date and sport, linked to a ui:// resource that renders it as a read-only courts x slots panel inside an MCP host. The data flows to the server, not through the model: the tool is where a real booking backend would sit. The UI only displays what the server returns. This is the first phase, read only, before any booking/write. Reuses the booking domain from generative-ui (Tennis / Football / Basketball / Padel, courts and slots) with deterministic in-memory mock data.
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.
First experiment with MCP Apps (spec
2026-01-26), following up on thegenerative-uiPOC. Read-only for now, before any booking/write.What it is
An MCP server that exposes one tool,
get_court_availability(date + sport), linked to a UI resource (ui://court-availability/panel.html). The host renders it in a sandboxed iframe as a read-only grid of courts x time slots, free vs taken.The key difference from
generative-ui: the input data is for the server, not for the model. The tool is where a real booking backend would sit; the UI only displays what the server returns.Bidirectional communication
The panel gets its data two ways, both in
src/mcp-app.ts:app.ontoolresult) when the tool is called, e.g. with another date or sport;app.callServerTool), the app -> server -> app round trip.There are no inputs and no submit: changing date/sport happens by calling the tool with different arguments, not from a form.
Stack
@modelcontextprotocol/ext-apps+@modelcontextprotocol/sdk, TypeScript, Vite +vite-plugin-singlefile(the UI bundles to a single self-contained HTML, which keeps the app iframe CSP happy). Availability is deterministic in-memory mock data, no DB.Try it
Then point the
basic-hostfrommodelcontextprotocol/ext-appsat it:SERVERS='["http://localhost:3001/mcp"]' npm start # open http://localhost:8080Shortcut to auto-call the tool:
http://localhost:8080/index.html?tool=get_court_availability&call=true. Verified end to end in that host: connect -> tools/list -> tools/call -> resource read ->ui/initialize->tool-resultrender.Next
The write phase: a
book_slottool that actually saves a booking, if the direction looks right.