@@ -209,12 +209,16 @@ restarts), so switch it off when you're done.
|
||||
|
||||
`ui/` is a [re-frame](https://github.com/day8/re-frame) app (ClojureScript, React 19 via
|
||||
[Reagent](https://reagent-project.github.io/)) built with [shadow-cljs](https://github.com/thheller/shadow-cljs).
|
||||
It's a small calculator form that calls `GET /api/add` and shows the sum (or the server's
|
||||
validation error). Below it, once you're logged in, is a todo list (add, tick off, delete) backed by
|
||||
`/api/todos`; it stays hidden when you're not. At the bottom is a section with the
|
||||
`claude mcp add ...` command to copy (with this page's own address in it) and the steps to sign in, for
|
||||
adding the [MCP server](#mcp-server) to Claude Code. A "Log in" / "Log out" link sits in the footer row
|
||||
next to the API docs links.
|
||||
It has three pages, as tabs across the top. Each has its own address in the URL's fragment (`/#/games`,
|
||||
`/#/todos`, `/#/ai-setup`), so the server only ever serves `/`, and a page can be bookmarked or reloaded.
|
||||
|
||||
| Tab | What's on it |
|
||||
|-----|--------------|
|
||||
| Games | Tic-tac-toe (two players on one board, all client side), and a small calculator form that calls `GET /api/add` and shows the sum (or the server's validation error) |
|
||||
| Todos | Your todo list (add, tick off, delete), backed by `/api/todos`. The tab only shows once you're logged in; its address shows a "Log in" prompt otherwise |
|
||||
| AI setup | The `claude mcp add ...` command to copy (with this page's own address in it) and the steps to sign in, for adding the [MCP server](#mcp-server) to Claude Code; and how to connect an MCP client to the page's own [browser tools](#browser-mcp-tools-webmcp) |
|
||||
|
||||
A "Log in" / "Log out" link sits in the footer row next to the API docs links.
|
||||
|
||||
shadow-cljs compiles it into `resources/public/js/` (git-ignored). The server serves that
|
||||
directory at `/js`, and serves `resources/public/index.html`, the shell that mounts the app, at `/`.
|
||||
@@ -232,7 +236,7 @@ in another stage of the same Dockerfile (`--target ui-test`), which the server i
|
||||
The page also offers tools of its own to your MCP client (Claude), through [WebMCP](https://webmcp.dev):
|
||||
a small library that adds a widget to the page and lets the page register tools with it. They are the browser-side twin of the
|
||||
[server's MCP tools](#mcp-server): those work on your data on the server, these work *the page*, doing
|
||||
what you could do with the mouse and keyboard, so you see it happen. They are in `ui/src/tbd/ui/webmcp.cljs`,
|
||||
what you could do with the mouse and keyboard, so you see it happen. A tool that changes something opens the tab it acts on first (the todo tools open Todos, the game and calculator tools open Games). They are in `ui/src/tbd/ui/webmcp.cljs`,
|
||||
registered with `registerTool` on a `WebMCP` instance (the `@jason.today/webmcp` npm package):
|
||||
|
||||
| Tool | What it does |
|
||||
|
||||
Reference in New Issue
Block a user