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

MCP `apps` takes `archived: true` and lists the apps put away, as /apps?archived=1 does #7363

Merged opened this

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

Merged

MCP `apps` now takes `{ archived?: boolean }`. With `true` it lists only the archived apps the caller can see, and each row carries `archivedAt`. Without it, or with `false`, the answer is the same as before.

shipped production is serving it deploy d480d55

opened this

MCP apps now takes { archived?: boolean }. With true it lists only the archived apps the caller can see, and each row carries archivedAt. Without it, or with false, the answer is the same as before.

  • Tests: test/mcp-apps-archived.test.ts and test/mcp-size.test.ts pass, and tsc --noEmit is clean. I didn't run scripts/fast.ts, the design lint or the full suite; the forge runs the full check on push.
  • Refusal: any other type for archived is refused with a tool error (invalid). I only checked that path by reading the code. The two test cases I read (the archive list and the stranger case) don't send a non-boolean, and I didn't read the rest of the file.
  • Test: it archives one of two public apps and a private one. The archived public app is missing from apps and present under archived: true. A stranger sees the public one only, never the private one.
  • Code: appsOf in src/web/studio/asks.ts gets an optional archived flag that selects the archived-only listing /apps?archived=1 already uses. The tool change is in src/http/mcp/tools/apps.ts.
  • Docs: docs/MCP.md names the argument in the apps row.
  • Left out: no new tool and no change to the size ceilings. Results are capped at 200 apps, as before.

To try it, call apps with {"archived": true} over /mcp.

Closes #6083

commented

MCP apps now takes { archived?: boolean }. With true it lists only the archived apps the caller can see, and each row carries archivedAt. Without it, or with false, the answer is the same as before.

  • Tests: test/mcp-apps-archived.test.ts and test/mcp-size.test.ts pass, and tsc --noEmit is clean. I didn't run scripts/fast.ts, the design lint or the full suite; the forge runs the full check on push.
  • Refusal: any other type for archived is refused with a tool error (invalid). I only checked that path by reading the code. The two test cases I read (the archive list and the stranger case) don't send a non-boolean, and I didn't read the rest of the file.
  • Test: it archives one of two public apps and a private one. The archived public app is missing from apps and present under archived: true. A stranger sees the public one only, never the private one.
  • Code: appsOf in src/web/studio/asks.ts gets an optional archived flag that selects the archived-only listing /apps?archived=1 already uses. The tool change is in src/http/mcp/tools/apps.ts.
  • Docs: docs/MCP.md names the argument in the apps row.
  • Left out: no new tool and no change to the size ceilings. Results are capped at 200 apps, as before.

To try it, call apps with {"archived": true} over /mcp.

commented

MCP apps now takes { archived?: boolean } and, with true, lists only the archived apps the caller can see, each row carrying archivedAt. Without it the answer is the same as before.

The check failed because the apps row in docs/MCP.md had drifted from the generated tool table. I regenerated it with bun scripts/mcp-tools.ts and pushed (a4c2a538). The change touches only that row. test/mcp-tools.test.ts and test/mcp-size.test.ts pass locally; I did not re-run the full suite, so the forge's check on this push is the full run.

  • Refusal: any other type for archived (a string, a number) is refused with an invalid tool error.
  • Test: test/mcp-apps-archived.test.ts archives one of two public apps, plus a private one. The archived public app is missing from apps and present under archived: true. A stranger sees the public one only, never the private one.
  • Left out: no new tool and no change to the size ceilings. Results stay capped at 200 apps, as before.

To try it, call apps with {"archived": true} over /mcp.

Approved

Clean. apps with archived: true reads the same listReposVisibleTo(..., { archivedOnly: true }) window that /apps?archived=1 uses (src/web/pages/apps.ts:111), so it applies the same visibility in SQL. A stranger gets public archived apps only, and the test proves the private one stays hidden. The tool is read-only (writes: false), takes identity from the bearer token, checks the argument's type at the boundary (invalid for a string, number, null or object, all tested), and builds no SQL from user input. Leaving archived out returns the same answer as before, and the 200 cap is unchanged. The docs/MCP.md row was regenerated and the size test passes. On the preview, /apps?archived=1 answers 200 and /mcp refuses an unauthenticated call. I couldn't call the tool there without a preview token, so the test is what proves the tool works.

Non-blocking:

  • The test archives by writing archived_at directly with SQL. Archiving through the archive action instead would also cover the path a person uses.
  • src/web/studio/asks.ts only gains a parameter, with no markup, so the design-system rules don't apply.
  • The terminal still has no archived-apps list. That gap was there before this pull and is not part of it.
  • This is door parity rather than pipeline work. It is small and touches nothing the pipeline queue does.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs