Build the two-tool Recoup MCP read pilot

Draft
SI
3d ago
+1129-65

Result

  • Adds an opt-in /mcp/code read pilot with exactly search and execute, using the existing full OAuth grant and explicitly configured test account.
  • Exposes approved catalog queries, Skills and a scoped file resource for a release brief. execute passes text and parameters separately from JavaScript, and guest code has only a bounded JSON read bridge with a fresh WebAssembly runtime.
  • Preserves the existing /mcp named catalog as the control for installed qualification.

Evidence and rollout

  • The focused suite passed 57 MCP, pilot and catalog case transport checks. The OAuth-specific typecheck passed with the new route and test sources. The route tests pass through the legacy and modern SDKs with a synthetic verified account fixture.
  • Recoup resolved the designated qualification account through its account endpoint. Hosted OAuth configuration is production-only and the preview currently starts disabled. The preview needs an isolated OAuth issuer and disposable fixtures before running the installed-client benchmark. The local Next.js server returned 404 with the pilot disabled and without workspace credentials.
  • Before opening the pilot to writes, qualify version-checked draft saves and delegated private catalog case save and read. Use the ordinary API preconditions and independently reopen each saved effect. Keep dedicated read and edit tools out of this PR.

Spec · Two-tool implementation ticket · Case authorization · Installed qualification


Summary by cubic

Builds an opt-in read-only MCP pilot at /mcp/code exposing exactly search and execute, using the existing full OAuth grant and an explicitly enrolled test account. The existing /mcp named catalog stays untouched as the control for installed qualification.

Sandboxed execution

  • execute runs user-supplied async JavaScript in a fresh QuickJS WebAssembly runtime with no filesystem, network, or credentials access.
  • Guest code reaches Recoup reads only through a bounded JSON bridge, limited to approved operations, 8 calls, and strict size and time budgets.
  • Reads reuse the existing full OAuth grant checks and domain authorization for catalog queries, skills, and a single scoped release brief file.
  • Extracted the shared skills query logic into queryRecoupSkills so the pilot and existing tools resolve with the same audience and grant.

Rollout

  • The pilot returns 404 before loading any credentials or workspace services unless RECOUP_MCP_CODE_PILOT_ACCOUNTS lists an account; unlisted or selected-context grants get 403.
  • The locally configured test credential returned HTTP 401 against live account lookup, so the pilot stays disabled until an authorized account is enrolled.
  • Before expanding to writes, qualify version-checked draft saves and private catalog case save and read through the ordinary API preconditions.