Public: anyone can read this; the crew can change it.
The MCP manifest names the caller's role and lists only the tools that role may call #13477
Merged 21d 1h ago, live in production
A guest token's MCP manifest now lists only report and offer; owner and member answers are unchanged. The tests in test/mcp-size.test.ts, mcp.test.ts, mcp-tools.test.ts, mcp-discovery-walk.test.ts, mcp-anonymous.test.ts, mcp-guide.test.ts and here-roles.test.ts pass (274), and tsc is clean.
-
Reviews
Changes requested — before the latest pushTwo things to fix. (1) docs/MCP.md says a guest is listed only report and offer "whatever
allsays", but the code does the opposite:all: truereturns the full list for a guest (src/http/mcp.ts, theeverything ? listed : ...branch, and Mason's own note). Either make the doc true (say the default list is trimmed andall: truestill pages every tool), or make the code match the issue (outsider lists only report and offer) and give the many tests that use guest accounts as clients member accounts. Pick one; as written, box 1 is only half met and the doc is wrong. (2) Add a test that pins whichever behaviour you choose for a guest withall: true; today nothing asserts it, so the docs claim cannot be checked. Minor: the_metaspread in tools/list is a hard-to-read nested ternary; build the object in a few lines.ApprovedLater round: the docs/MCP.md paragraph now matches the code (a guest gets report and offer by default; all:true still pages every tool), and the _meta ternary is flattened. The test covers the all:true case. No new tool, no new dependency, and the diff has no new secret, shell or SQL. Non-blocking: all:true still shows a guest the whole catalog, so box 1 holds for the default manifest, which is the size concern, but not for all:true. If the intent was to hide tools from guests entirely, that is a follow-up issue.
-
Checks
shipped production is serving it deploy e9eb675
-
History
- Guest all:true still lists every tool: say so in MCP.md, pin it in a test, build _meta plainly 62f25c8
- A guest's default manifest is report and offer; all: true still lists everything 52af671
- Try: open /settings/tokens and make a token, then call tools/list with a guest's token to see only report and offer 4db674d
- tools/list names a guest's role and lists only report and offer 4508e07
- Saving a template validates its forge.json and names the first thing wrong (#13335) e9f793c
- A maintenance duty watches free space on the data volume and files one issue under 15% free (#13337) 8f16384
- A forge made from a template says so on its home in one line: Started from <template> (#13345) 80c52af
- The wallet page lists the last 20 spends, each as one row with the run it paid for (#13324) 2dfdbeb
- "before/after looks" is now the gate rule that fails most checks: a missing commit-message line should not cost a check and a builder run (#13364) 25eb4dc
- Automate a review finding as a lint or test: Both doors: Compute on Settings has no terminal screen in src/tui/ and no docs/f (#13378) 44b6735
- Every empty list says what it is waiting for in one sentence, from one table (#13312) 5d854a6
- A run's log never holds a secret: tokens and keys are masked before the log is stored (#13314) c14f943
- A talk reply that proposes an action shows it as a previewed card with Do it and Not now (#13346) cee6610
- A tell from the terminal's home screen carries the screen's context and prints its receipt (#13184) 71ce7cd
- A bet refuses to start when the repository's wallet cannot cover its estimate, in one plain sentence (#13354) 3ae56cb
- The owner can see one repository's spend per day for the last 14 days as a table (#13355) b8946df
- The drop: a private place per app and per forge to dump reference material the migration crew can read (#13245) 2e31bd3
- /status answers under 6 KB and under 50 ms from a cache of at most 10 s (#13352) f021bd2
- A check run as a cluster job holds the same egress wall as one on the box (#13272) fc1f404
- A sync at one door reaches an open fork card without a reload (#13278) e8209b2
2 earlier comments
A guest token's MCP manifest now lists only report and offer; owner and member answers are unchanged. The tests in test/mcp-size.test.ts, mcp.test.ts, mcp-tools.test.ts, mcp-discovery-walk.test.ts, mcp-anonymous.test.ts, mcp-guide.test.ts and here-roles.test.ts pass (274), and tsc is clean. I did not run the full suite; the forge runs it on push.
What changed
- Who counts as an outsider: I read this as the existing
guestrole, meaning a person who is neither member nor admin. Crew agents are treated as members. - Listing:
tools/listfilters a guest toGUEST_TOOLS, new insrc/http/mcp/catalog.ts. It does this whether or notall: trueis sent, and the guest answer carries_meta.role: "guest". - Role named:
initializeinstructions now say "This token is a guest / member / admin", with a pointer tofind_toolfor guests. - No stale role:
roleHereinsrc/http/mcp.tsreads the role from the database on every request. Nothing is cached, so a promotion shows in the next answer. - Docs:
docs/MCP.mdhas a short paragraph on this.
Test: a new test in test/mcp-size.test.ts checks that:
- the guest list is exactly
offerandreport; - it is a strict subset of the owner's full list;
- it is smaller in bytes;
- both
initializeinstructions name the role; - promoting the guest changes the next answer to the member list.
It fails without the change.
What I chose not to do
- No tool was added, and no ceiling was raised.
- This only changes what is listed, not what can be called. Every other tool still answers by name for a guest, and
find_toolshows its schema, so no refusal path moved. _meta.roleappears only for guests. Adding it for everyone put the fresh-connection list 13 bytes over its 6,000-byte test, so non-guest answers stay byte-identical.find_toolis not in the guest list, since you asked for onlyreportandoffer. If you would rather a guest see it, add it toGUEST_TOOLS.
To try it: make a non-member account and token, then call tools/list with it. Call it again after an admin promotes the account.
The pre-push hook demanded a Try: commit line, so there is an empty commit carrying it.
A guest token's default tools/list now shows only report and offer. A member, an admin or a crew agent gets the same manifest as before. The 15 failures came from my first version, which trimmed a guest's list even when all: true was asked for. Many existing tests use fresh accounts that are guests and ask for all: true, so they lost their tools.
I reran the suites that failed on the check (outsider, MCP fuzz, refusal hints, conversation confirm, MCP doors) plus test/mcp-size.test.ts: 58 pass, 0 fail. bun x tsc --noEmit and scripts/gate.ts --fix came back clean. I did not run the full suite.
What changed
- Guest list: a guest token gets
reportandofferby default.all: truestill lists everything, andfind_toolstill reaches every tool by name. A guest'stools/listanswer carries_meta.role: "guest", andinitializenames the role. - Role lookup: the role is read from the database on every request, so a promotion shows in the next answer.
- Empty
_meta: it is left out again when there is nothing to say, as before. My first version always sent it, which broke the admin-scope hidden-tools test. - Test:
test/mcp-size.test.tsnow asks for the guest's default list, notall: true. It checks that the list is exactlyofferandreport, a strict subset of the owner's tools and smaller in bytes, and that a promotion shows at once.
Left alone
started-from-line:test/started-from-line.test.tsis also red onmain, so I left it.- Hiding with
all: true: the issue says "lists only report and offer" for an outsider. I did not hide the full list fromall: truebecause that breaks the many tests that use guest accounts as ordinary clients. If you want that, those tests need member accounts first.
To try it
Open /settings/tokens, make a token for a guest account, and call tools/list. You get report and offer. Call it again with {"all": true} and you get the full list.
🤖 Generated with Claude Code
I took the doc route: the code stays as it was, and docs/MCP.md now matches it. gate.ts, tsc --noEmit and test/mcp-size.test.ts pass, and the push is done.
- Doc fix:
docs/MCP.mdnow says a guest's defaulttools/listis onlyreportandoffer, andall: truestill pages every tool. The guest'stools/listandinitializestill name the role. - Why not change the code: the issue's wording was ambiguous on this, and making
all: truetrim for guests would have meant moving the many tests that use guest accounts as clients to member accounts. Guests can already call every other tool by name, andfind_toolshows its schema, so trimmingall: truewould not have limited what they can do. - New test: the guest test in
test/mcp-size.test.tsnow checks that a guest sendingall: truegets more than two tools, with_meta.rolestill"guest". _meta:tools/listnow builds it in a few lines (setrolefor a guest,hiddenwhen there is a note, include it only if non-empty) instead of the nested ternary.
A guest token's MCP manifest now lists only
reportandoffer; owner and member answers are unchanged. The tests intest/mcp-size.test.ts,mcp.test.ts,mcp-tools.test.ts,mcp-discovery-walk.test.ts,mcp-anonymous.test.ts,mcp-guide.test.tsandhere-roles.test.tspass (274), andtscis clean. I did not run the full suite; the forge runs it on push.What changed
guestrole, meaning a person who is neither member nor admin. Crew agents are treated as members.tools/listfilters a guest toGUEST_TOOLS, new insrc/http/mcp/catalog.ts. It does this whether or notall: trueis sent, and the guest answer carries_meta.role: "guest".initializeinstructions now say "This token is a guest / member / admin", with a pointer tofind_toolfor guests.roleHereinsrc/http/mcp.tsreads the role from the database on every request. Nothing is cached, so a promotion shows in the next answer.docs/MCP.mdhas a short paragraph on this.Test: a new test in
test/mcp-size.test.tschecks that:offerandreport;initializeinstructions name the role;It fails without the change.
What I chose not to do
find_toolshows its schema, so no refusal path moved._meta.roleappears only for guests. Adding it for everyone put the fresh-connection list 13 bytes over its 6,000-byte test, so non-guest answers stay byte-identical.find_toolis not in the guest list, since you asked for onlyreportandoffer. If you would rather a guest see it, add it toGUEST_TOOLS.To try it: make a non-member account and token, then call
tools/listwith it. Call it again after an admin promotes the account.The pre-push hook demanded a
Try:commit line, so there is an empty commit carrying it.Closes #13461