chadtmiller.com/hud
A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts
place.hud.hudkit 0.5.0 Latest 5 packages
Composers: posts, replies, quotes, galleries and comments, with photos, mentions and tags
MergedThis pull lands the composers. Views get a Compose component whose form fills a writes template, and apply_writes (hud_core::compose) checks each record against its lexicon, adds its facets and creates them all at once. It also adds place.hud.uploadBlob for pictures and two tools only the view calls, link_card and find_place. Bluesky and Grain get Reply, Quote, Comment, New post and New gallery, and a #tag opens its app's search.
The write path looks right. The template's names are checked against the fields' and given values' names in the view and again on expand. Writes are capped at 8 per template and 32 records per send. The returned blob ref is rebuilt from scratch, and the upload checks both the size and the image type from its bytes. Untrusted views must confirm before they write, on web and iOS. There are good tests for the template, facets, the reply composer, and the upload going through the router to a fake PDS. All runner checks pass on this head.
One thing to fix: find_place never checks for an account. call_tool sends it a None account, and the tool searches OpenStreetMap's Nominatim server anyway. But docs/tools.md says it needs sign-in, and tools.rs says a tool that needs an account answers Refusal::SignIn without one. As it stands, anyone who can reach /mcp on a server with sign-in on can run any search through HUD's User-Agent. Nominatim's usage policy (at most one request a second) would then blame HUD for it. Refuse with Refusal::SignIn when there is no account, as link_card does.
I did not read these line by line: ios/HUDKit/Sources/HUDKit/Parts/ComposeFields.swift (SwiftUI drawing of the fields), ios/HUDKit/Tests/HUDKitTests/ComposeTests.swift, Cargo.lock and crates/hud-core/src/testdata/nominatim.json. The iOS tests pass by the author's account, and the other two are lockfile and fixture data.
crates/hud-core/src/places.rslines 125 to 131Outdated
pub(crate) async fn find_place_tool( | |
&self, | |
arguments: Option<&Value>, | |
_account: Option<&Account>, | |
) -> Result<Output, Refusal> { | |
let args = Args::of(arguments, &["q"])?; | |
let q = args.required("q")?.trim(); |
_account is never checked, so a caller with no account gets Nominatim results too. call_tool sends None straight through to this function. docs/tools.md lists find_place as "signed in", and the module doc in tools.rs says a tool that needs an account answers Refusal::SignIn without one. As it is, an anonymous /mcp client can run any search through HUD's User-Agent, and Nominatim limits each User-Agent to one request a second. Start with let Some(_account) = account else { return Err(Refusal::SignIn); };, as link_card_tool does.
Last round I asked for one fix, and it's done. find_place_tool now returns Refusal::SignIn when there is no account, before it reads its arguments, so /mcp no longer sends searches to Nominatim for callers who aren't signed in. It now behaves the way docs/tools.md and tools.rs say it should, and the way link_card already did. The oauth tests now call both find_place and link_card with no account and expect SignIn, so this is covered.
That one commit, dc1bb4c, is the only change since 53fed83, and nothing else moved. What I approved of the write path last round still stands.
On this head, the check, web, lexicons, docs, e2e and e2e-spaces checks pass. The test check was still running when I looked, so I don't know yet whether it passes.
Composers: people write in HUD's views. A thread's posts get Reply and Quote, your own Bluesky page New post, a Grain gallery Comment and each comment Reply, your own Grain page New gallery; a #tag opens its app's search.
What changes
Compose(catalog, resolver,place.hud.ui, web renderer and HUDKit): a button opening a form offields(text with @ suggestions, its links, #tags and @mentions marked as typed; a line; photos uploaded as added with alt text and EXIF; languages; labels; a choice; a place; a link card), whose values fill awritestemplate.apply_writeswrites a template's records at once (hud_core::compose), each checked against its lexicon, facets made with each handle resolved to its DID.create_recordmakes{"$facets": key}a text's facets (richtext.rs). Templates take{"$root": path}and{"$first": [values]}.place.hud.uploadBlobsends a composer's picture to the account's PDS;link_cardandfind_place(OpenStreetMap's Nominatim) answer the form, the view's alone.Views:
bsky-thread(Reply, Quote,closeddrawing Reply as its count),bsky-appandgrain-app(New post, New gallery),grain-gallery-view(Comment, Reply), andbsky-search(app.bsky.feed.searchPosts), which a #tag opens.Docs: the composer parts of the old README go into
docs/tools.md,docs/views.mdanddocs/workspace-api.md.Why
HUD read and liked; it could not write a post, reply or comment. These three commits were made on a local
mainand deployed to hud.place from it (fd81224), never landing here; this lands them so main is what runs.How it was checked
Main merged in (
53fed83): its conflicts were each additive (the places and themes caches,uploadBlobandlistThemes, the xrpc tests' double's PDS answers) and the README's split intodocs/;ActionFacetakes aHUDColoras the themes made the action's tint.just check(fmt, clippy, tests, svelte-check, lint with docs, lex) andjust ios-testpass on the merge. The runner's checks run on this head, e2e and e2e-spaces among them.Shortcomings
just lookpictures of the composers were taken for this pull; they have been in use on hud.place sincefd81224.