Skip to content

0.2.0: an MCP address per agent, each signing in through its own Discord application - #2

Merged
cycle-five merged 5 commits into
masterfrom
feat/v0.2.0
Nov 18, 2026
Merged

cycle-five merged 5 commits into
masterfrom
feat/v0.2.0

Conversation

@cycle-five

Copy link
Copy Markdown
Member

Why

Mailroom serves a list of agents: two today, many more later. In 0.1.0 there was one MCP address with a mailbox picker, and every sign-in went through one Discord application. So an agent's connector signed in through another agent's application, and every connection depended on a person picking the right mailbox.

Design: docs/superpowers/specs/2026-11-18-per-agent-signin-design.md. Plan: docs/superpowers/plans/2026-11-18-per-agent-signin.md.

What changes

  • An address per agent: PUBLIC_URL/<agent>/mcp. Each is its own OAuth protected resource, so a token for one agent is refused at another agent's address. The old /mcp answers 404 with a line saying where mailboxes live.
  • Sign-in through the agent's own Discord application. Each agent's config entry names a signin broker. The core gains two internal routes (GET /signin/client?agent=, POST /signin) that forward to that broker's Feed. The door no longer has a broker binding.
  • The agent list lives only in the core's config. The door reads it from the core (cached 60 seconds), so adding an agent is one config edit and one redeploy of the core.
  • The agent is read from the OAuth resource parameter. A client that sends none gets a list of mailboxes; that is the only place a picker remains.

Breaking

  • Every agent entry in MAILROOM needs "signin": "<BROKER_BINDING>".
  • The door's SIGNIN service binding is gone.
  • Connectors use /<agent>/mcp; each agent's Discord application lists the redirect PUBLIC_URL/callback.

Verification

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (105 tests)
  • door: npm run typecheck, npm test (34 tests, the real OAuth library against an in-memory KV: per-agent metadata, cross-agent token refused, the flow with and without resource, unknown and foreign resources refused, a removed agent answering 404, sign-in failures leaving no grant)
  • crates/worker/smoke/run.sh: the wasm build under workerd, now also covering the sign-in routes

🤖 Generated with Claude Code

https://claude.ai/code/session_017zqkEBoTfRovHZ26Cjjc91

Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Each agent names the broker that signs its users in; the core forwards
GET /signin/client and POST /signin to that broker's Feed.

Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
Each agent is its own OAuth protected resource at /<agent>/mcp. The consent
page names the mailbox from the request's resource instead of asking. Discord
sign-in (client ID and code exchange) goes through mailroom-core to the
agent's own broker, so the door loses its SIGNIN binding. The agent list is
cached for 60 seconds and refetched when a request names an unknown agent.

Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
The door logged only the status, so the generic page pointed at logs that did
not hold the reason. Log the core's error text as message (never on a page),
point the page at the door's logs, and correct the README row.

Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
An authorize request naming an agent the cache has not seen refetches the list
once. /mcp/mcp reaches an agent named mcp. README: invalid_target row, exact
address, rollback to 0.1.0.

Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
@cycle-five
cycle-five merged commit cd6af42 into master Nov 18, 2026
2 checks passed
@cycle-five
cycle-five deleted the feat/v0.2.0 branch November 18, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant