chadtmiller.com/group-host
atmosphere group host
Assistants act as a member in one group, over MCP
MergedThis adds an MCP server to the host. It covers OAuth discovery, registration and PKCE, a consent step on the console, 21 tools that run as the member in the group they chose, and a section for disconnecting assistants. The security design holds up. The tables are separate from oauth_token. The group is forced in call_as. Arguments must be an object. Authorization codes are single-use and stored hashed. Ejecting a member deletes their grants. I did not read the tests, e2e, docs, web or lexicon files in detail, and I did not check the CI results.
Must fix: the redirect URIs from a client ID metadata document are never checked. register filters its URIs with may_return_to. assistant_client takes redirect_uris from the fetched document as they are, and authorize only checks uris.contains(redirect_uri). Anyone who can host a document can list javascript:... or data: URIs. After the member approves, approve returns that URI as redirectUrl, and the console's BackToApp renders it as a link. That is script running on the console's origin after a click. A URI with no valid URL form also reaches with_query, whose expect panics. Apply may_return_to to the document's URIs, and drop the client if any fails or if none remain. Add a test for a document with a javascript: URI.
Minor: /mcp/register is unauthenticated and unbounded, so anyone can fill assistant_client with rows. A cap or a cleanup of unused clients would help. The client name shown on the consent page is whatever the client sent, so the page should make clear that it is unverified.
crates/group-host/src/assistants.rsline 326Outdated
These lines can no longer be read.
The document's redirect URIs are not passed through may_return_to, unlike the ones from register. A javascript: or data: URI here ends up in redirectUrl on the approval page. An unparsable one makes the expect in with_query panic. Filter them here.
Fixed in c7781d4. A client metadata document's redirect URIs now go through the same check as a registered client's (redirects_ok: 1 to 10 URIs, each at most 2048 bytes, each one may_return_to allows). If any URI fails, it is no client, so no javascript: or data: URI and no unparsable URI reaches approve or with_query. The test lists a javascript: URI beside a good one and gets a 400. As a second guard, the console's BackToApp never follows a javascript:, data:, vbscript: or file: URL. Minor points: registration caps the URIs, and a client that registered but never connected is forgotten after a day. The approval page says the name is the assistant's own word, and shows the client ID it came from. just cov is at 100%, and e2e passes.
Round 2: what I asked for last time is done. I read assistants.rs only, and not the tests, e2e, docs, web or lexicon files. I did not check CI.
- Must fix, done.
assistant_clientnow passes a metadata document'sredirect_uristhroughredirects_ok. That applies the samemay_return_tofilter and the same count and length limits that registration uses. One bad URI, such asjavascript:, makes the whole client unknown. That closes both the script-link hole and thewith_querypanic.tests/assistants.rs:655covers a document with ajavascript:URI. - Minor, partly done.
register_assistantnow deletes registered clients that never connected after a day. Row growth within that day is still unbounded, but this is acceptable. - Still open, and not a blocker. The consent page shows the client's self-chosen name. The page could mark it as unverified.
The security boundary holds up as before. The group is forced in call_as, the tables are separate from oauth_token, and codes are single-use and stored hashed.
What changes
Assistants act as a member in one group, over MCP (
assistants.rs,crates/group-host-mcp,docs/design/assistants.md). An AI app that is an MCP client connects to a group to act there as the member who connected it, with what their roles allow and nothing more./.well-known/oauth-protected-resource/mcpnames the resource,<PUBLIC_URL>/mcp, and its authorization server, whose issuer is the same URL and whose metadata is at/.well-known/oauth-authorization-server/mcp./mcp/register(RFC 7591) as a public client, to be sent back over https, to a loopback address, or to an app's own scheme./mcp/authorizetakes a code request with PKCE (S256) for that resource, and sends the browser to the console's/authorize./mcp/tokenexchanges the code once, for its client, redirect URI and verifier, for a Bearer access token (an hour) and a refresh token (thirty days, used once).getAuthorizationreads an assistant's request (new optionalassistant: true), the member picks the group, andapproveAuthorizationanddeclineAuthorizationanswer it. The page says "wants to act as you in one of your groups" and "Connect it to <group>"./mcpanswers JSON-RPC:initialize,ping,tools/listandtools/call. The tools are 21 core methods:getGroup,updateProfile, rules, roles, members, join requests, invites,createSpace,listSpaceRecords, and moderation. Each tool's input schema is made from its method's lexicon, without the group, which is always the one chosen. A call is the host asking itself as the member, as the console does, so the host's own methods decide by the member's roles as they are now. A refusal is the tool's error, in the method's words.listConnectedApps(existing) andrevokeConnectedApp(new lexicon) back a "Your assistants" section on the group's page, where each one can be disconnected. A member put out of the group has their assistants disconnected with them.Why
This is step 9's last part. Two designs were weighed:
listConnectedApps.The second is much less code, and it decides what an assistant may do in the same place the console's calls are decided. Assistants' requests, grants and tokens are kept in tables of their own, so neither kind of token is ever taken for the other: a group's tokens act as the group, and an assistant's act as a member. The protocol and the tools are in
crates/group-host-mcp, pure and with no host dependency, as AGENTS.md lays the crates out.How it was checked
tests/assistants.rshas eight tests, covering:/mcp.crates/group-host-mcp/tests/protocol.rscovers the tools' schemas and every message. A new e2e flow, "connecting an assistant, and disconnecting it", runs the whole flow in Chromium against the reference PDS: discovery, registration, consent on the console, the token exchange, a tool, and disconnecting from the group's page.just covis at 100% locally.Shortcomings
Review
The security boundary is worth a careful look:
assistants.rs'scall_asmints an in-process console session for the member;oauth_token.🤖 Generated with Claude Code