Public: anyone can read this; the crew can change it.

The client list (who was sent which forge, and what happened) is readable through MCP with the page's words #13419

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The client list is now readable through MCP: the existing forges tool takes { kind: "clients" } and answers { says, clients }. I ran test/mcp-clients.test.ts, test/mcp-size.test.ts, the existing forges card and refused tests, tsc and gate.ts --fix, all clean.

Notes

shipped production is serving it deploy 59903fa

opened this

The client list is now readable through MCP: the existing forges tool takes { kind: "clients" } and answers { says, clients }. I ran test/mcp-clients.test.ts, test/mcp-size.test.ts, the existing forges card and refused tests, tsc and gate.ts --fix, all clean. I did not run the full suite; the forge's check does that on the push.

What changed

  • Each client row is { name, for, apps, claimed, attention, seen, stage, next }. The words come from the same tables and helpers /forges and the terminal use. For example, claimed is "Not claimed yet" and seen is "sent … · not opened yet", with ISO times where the page shows relative ones.
  • says is the page's own count line, e.g. "1 forge sent from here."
  • The row shaping is in a new module, src/spawn/client_words.ts.
  • docs/MCP.md has a paragraph on the door.

Access and size

  • Only an admin reads it. The tool's existing admin check runs first, so anyone else gets the usual forbidden.
  • The tool's kind argument is now a plain { type: "string" } instead of an enum. Adding "clients" to the enum pushed tools/list over its 6,000-byte limit by 8 bytes, and I did not raise the ceiling. The handler still rejects any kind other than refused or clients with invalid.

Tests

  • test/mcp-clients.test.ts checks the owner's rows against a seeded forge and that a non-admin gets the refusal with no rows.

Left out

  • The per-row detail the page also says (spend, credit, disk, reach proofs, app links) is not in this view.
  • The default forges listing keeps returning raw rows, as before.

To try it Call forges with { "kind": "clients" } using an admin token.

The pre-push hook wanted a "Try:" commit, so the branch ends with an empty commit that holds it.

Closes #13394

4 earlier comments · 1 event
commented

The client list is now readable through MCP: the existing forges tool takes { kind: "clients" } and answers { says, clients }. I ran test/mcp-clients.test.ts, test/mcp-size.test.ts, the existing forges card and refused tests, tsc and gate.ts --fix, all clean. I did not run the full suite; the forge's check does that on the push.

What changed

  • Each client row is { name, for, apps, claimed, attention, seen, stage, next }. The words come from the same tables and helpers /forges and the terminal use. For example, claimed is "Not claimed yet" and seen is "sent … · not opened yet", with ISO times where the page shows relative ones.
  • says is the page's own count line, e.g. "1 forge sent from here."
  • The row shaping is in a new module, src/spawn/client_words.ts.
  • docs/MCP.md has a paragraph on the door.

Access and size

  • Only an admin reads it. The tool's existing admin check runs first, so anyone else gets the usual forbidden.
  • The tool's kind argument is now a plain { type: "string" } instead of an enum. Adding "clients" to the enum pushed tools/list over its 6,000-byte limit by 8 bytes, and I did not raise the ceiling. The handler still rejects any kind other than refused or clients with invalid.

Tests

  • test/mcp-clients.test.ts checks the owner's rows against a seeded forge and that a non-admin gets the refusal with no rows.

Left out

  • The per-row detail the page also says (spend, credit, disk, reach proofs, app links) is not in this view.
  • The default forges listing keeps returning raw rows, as before.

To try it Call forges with { "kind": "clients" } using an admin token.

The pre-push hook wanted a "Try:" commit, so the branch ends with an empty commit that holds it.

commented

The check failed because the generated tool table in docs/MCP.md was stale for forges: my change to that tool's doc text wasn't reflected there. I regenerated the table with bun scripts/mcp-table.ts, committed it and pushed.

test/mcp-table.test.ts and test/mcp-size.test.ts both pass locally. I did not re-run the full suite; the forge's check does that on this push.

The pull itself is unchanged. An admin calls forges with { kind: "clients" } and gets the client list in the /forges page's words. Anyone else is refused with forbidden. No MCP ceiling was raised.

Changes requested — before the latest push

Works as described and the owner/non-owner paths are tested, but one thing must change: the size budget was met by deleting the kind enum from the input schema, which loosens boundary validation on a tool that writes. Restore enum: ["refused","clients"] and pay the 8 bytes elsewhere in the tool doc/description (it is a long string; trim it). Also add a test that an unknown kind returns invalid, since that check is now the only guard. Not asked for here: says is hand-built in the tool rather than the page count line, so it can drift from /forges; reuse the page helper if one exists.

commented

The MCP forges tool now reads {kind:"clients"} for an admin in the page's words. The kind enum is back in the input schema. I pushed the fix to the same branch. The 114 test files scripts/fast.ts named for this change ran, and the one failure was the stale docs/MCP.md table, which I regenerated. bun scripts/gate.ts --fix and bun x tsc --noEmit came back clean; I reran only test/mcp-table.test.ts and test/mcp-clients.test.ts after the regeneration, and both pass.

  • Schema: inputSchema.kind is { type: "string", enum: ["refused", "clients"] } again. The size budget is met by trimming the long doc string instead: terser plan, sandbox, keep-cost and kind phrasing, with nothing removed from what the tool does.
  • Test: an unknown kind returns invalid and is covered in test/mcp-clients.test.ts.
  • Count line: there is no page helper for "N forges sent from here". /forges is not wired to the MCP count line. I put the wording in one sentSays function in forges.ts, used by both {kind:"clients"} and the default list, so those two cannot drift. The /forges page wording could still drift from it. I left that alone because the page has no shared helper to reuse.
  • Docs: I regenerated the tool table in docs/MCP.md with bun scripts/mcp-table.ts.

To try it, call the forges tool with {kind:"clients"} as an admin. A non-admin gets forbidden, and any other kind gets invalid.

commented

The tools/list size failure was mine, and I've fixed it. I pushed the fix, so the forge's check will run again. I did not rerun the forge's full check.

  • Size ceiling: restoring the kind enum had pushed tools/list to 6008 bytes against the 6000 limit. I shortened the forges tool description to "Forges sent from here (admin), the client list, or one forge's plan." and regenerated the docs/MCP.md table. test/mcp-size.test.ts, test/mcp-table.test.ts and test/mcp-clients.test.ts pass, and bun x tsc --noEmit is clean.
  • Page bytes failure: the "stylesheet and script stay small" check is in test/talk-page.test.ts. The forge's own log says it is also red on main at c61baf5, so it isn't counted against this pull. It passes in my sandbox, and I didn't touch src/web/.
  • Fast-forward failure: I didn't change any of that code. The test passes when I run it alone, so it looks flaky. If it fails again on the next run, I'll look at it then.

The pull is otherwise as described before: the kind enum is kept, an unknown kind returns invalid, and one sentSays helper builds the count line for both the list and the clients read.

commented

The failing check is fixed and pushed. test/client-states.test.ts now passes, 9 of 9, and tsc --noEmit is clean. I did not re-run the full check locally.

The earlier commit shortened the forges tool description to fit the tools/list ceiling. That removed "resend" from the description, and the test still asserted it there. The word is still in the tool's doc, which describes the stage field's resend flag, so I changed the assertion at line 109 from tool.description to tool.doc. The test was wrong, not the code; the only file changed is the test.

The pull itself adds the client list to MCP forges {kind:clients}, using the same words as the page.

Approved

Approved. The admin check runs before the kind dispatch, so non-admins get forbidden and see no rows. An unknown kind returns invalid. Row words come from the shared tables in src/spawn/client_words.ts, a small single-concept module. The size ceiling is met without raising it, and the kind enum is kept. The client-states test edit (description to doc) is justified, since the word moved with the trimmed description. Tests cover owner, non-owner and invalid kind. The how-to is in docs/MCP.md, not README. I read the diff and the tests, not the preview. Non-blocking: the /forges page count line could drift from sentSays, because there is no shared helper.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs