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

MCP `here` takes an app URL and answers what its /__forge/ door shows: app, environment, pull, who is working, and the links home #5869

Parked opened this
Closed without merging

MCP now has a here { url } tool. Given a link to one of this forge's app hosts, it answers what that app's /forge/ door shows, as { app, repo, environment, pull: { number, title } | null, working: [names], links: { home, repo, report } }.

Notes

stopped parked by the crew deploy d394779

opened this

MCP now has a here { url } tool. Given a link to one of this forge's app hosts, it answers what that app's /__forge/ door shows, as { app, repo, environment, pull: { number, title } | null, working: [names], links: { home, repo, report } }.

The new test/mcp-here.test.ts, the pill-where and docs tests, and the rest of test/apps pass, and tsc --noEmit is clean. I did not run the full suite; the forge's check will. The new test covers production, a preview, a foreign host, a bad link, and a private app a stranger can't enter.

  • Shared reads: the tool lives in src/apps/here.ts. It reads through pillWhere and reportUrl from the proxy, which the door and pill already use. I exported reportUrl for it. Who is working comes from a new crewAll in src/apps/crew.ts, and crewNow is now its first entry.
  • Refusals: a foreign host, an unknown app, a bad or non-http(s) link, a nested host, an archived app, a private app the caller can't enter, and a sealed pull they can't see all get the same not_found answer. They use the forge's standard words, "no such resource here, or it is not visible to you". The door shows no message of its own for these, only a 404 or a sign-in redirect, so I used the forge's not-found words.
  • Docs: here has a row in docs/MCP.md and shows in tools/list. I deleted its line from the undocumented set in test/mcp-docs.test.ts, as that test requires.
  • #5828 overlap: I did not check whether the MCP preview tool from #5828 has landed, so I added here as its own tool and did not extend preview.
  • Left out: I did not add custom (verified) domains as here targets. Unlike the door, here also refuses apps whose repository is archived.

To try it, call here with { "url": "https://<app>.<apps domain>/" }, or <app>--<N> for a pull's preview.

Closes #5858

4 earlier comments
commented

MCP now has a here { url } tool. Given a link to one of this forge's app hosts, it answers what that app's /__forge/ door shows, as { app, repo, environment, pull: { number, title } | null, working: [names], links: { home, repo, report } }.

The new test/mcp-here.test.ts, the pill-where and docs tests, and the rest of test/apps pass, and tsc --noEmit is clean. I did not run the full suite; the forge's check will. The new test covers production, a preview, a foreign host, a bad link, and a private app a stranger can't enter.

  • Shared reads: the tool lives in src/apps/here.ts. It reads through pillWhere and reportUrl from the proxy, which the door and pill already use. I exported reportUrl for it. Who is working comes from a new crewAll in src/apps/crew.ts, and crewNow is now its first entry.
  • Refusals: a foreign host, an unknown app, a bad or non-http(s) link, a nested host, an archived app, a private app the caller can't enter, and a sealed pull they can't see all get the same not_found answer. They use the forge's standard words, "no such resource here, or it is not visible to you". The door shows no message of its own for these, only a 404 or a sign-in redirect, so I used the forge's not-found words.
  • Docs: here has a row in docs/MCP.md and shows in tools/list. I deleted its line from the undocumented set in test/mcp-docs.test.ts, as that test requires.
  • #5828 overlap: I did not check whether the MCP preview tool from #5828 has landed, so I added here as its own tool and did not extend preview.
  • Left out: I did not add custom (verified) domains as here targets. Unlike the door, here also refuses apps whose repository is archived.

To try it, call here with { "url": "https://<app>.<apps domain>/" }, or <app>--<N> for a pull's preview.

commented

I merged main into the branch, resolved the one conflict in src/apps/crew.ts, and pushed. The type check is clean. I ran only the crew-pill, crew-timing and MCP "here" tests, and those 30 pass. I did not finish a full bun test here; the forge's check runs it on this push.

  • Conflict: main added per-phase timing to crewNow, and this branch had split it so crewNow returns the first of a new crewAll. I kept both.
  • Result: crewAll now takes the optional request and does the timed app, pull and working reads. crewNow is crewAll(...)[0], so the pill behaves as it did on main.
commented

I merged main into the branch and pushed it. test/mcp-here.test.ts, test/mcp-docs.test.ts and tsc --noEmit pass. I did not run the rest of the suite. My first merge push went out with one test failing, and the second push (b05e90db) fixed it.

Both conflicts came from main splitting src/http/mcp.ts into one file per tool under src/http/mcp/tools/ (#5932). main also gained its own here tool, which lists what you can do on a forge page. My here would have collided with it, so I kept main's mcp.ts and docs/MCP.md and moved my change into that tool.

  • App links: here in src/http/mcp/tools/here.ts now takes the URL of an app host, production or a pull's preview. It answers what the app's /__forge/ door shows: app, repo, environment, pull, who is working, and the links home. It reads those through hereOf in src/apps/here.ts.
  • Other URLs: any other URL goes to main's page-manifest path unchanged. A private app you can't enter gets the same refusal as a missing one.
  • Docs: here has no row of its own in docs/MCP.md. Its description and the doc field live in the tool file, and its row is main's own.
  • Test change: my test now expects main's refusal wording for foreign hosts instead of the old door wording. I dropped the "not a url" case because a bare word now resolves as a path on this forge.
  • Overlap: main's preview tool already answers a similar question for app URLs. It adds the check state and first failure, and omits the links home. I kept both.

To try it, call the here tool with { "url": "https://lab--5869--forge-trevato-apps.open-platform.sh/" }.

commented

I merged main into this branch and pushed it. The only conflict was the description string in src/http/mcp/tools/here.ts. I kept this branch's wording, which covers both a forge page and an app link.

The tsc --noEmit check printed no errors. The mcp-here, here-manifest and here-timing suites pass: 23 tests, 0 failures. I did not get a result from the full bun test. It ran past the 120-second command limit and I moved on to the targeted suites. The forge's own check will run the whole thing on this push.

here still takes either a forge page link or an app link. An app link returns its app, repo, environment, pull, who is working and the links home. Any other link falls through to the page manifest as before.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs