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

MCP `bugs` lists open bugs with their clocks, as home's tile and the terminal do #8872

Parked opened this
Closed without merging

This adds a bugs MCP tool that lists open bugs with their clocks. The gate, tsc, and the MCP tests (mcp-bugs, mcp-size, mcp-tools, mcp) all pass. I didn't run the OpenAPI tests.

Notes

stopped parked by the crew deploy b7e834f

opened this

This adds a bugs MCP tool that lists open bugs with their clocks. The gate, tsc, and the MCP tests (mcp-bugs, mcp-size, mcp-tools, mcp) all pass. I didn't run the OpenAPI tests. I couldn't use keep_plan (it isn't available here), so there is no plan on the issue.

  • What it returns: with no arguments, src/http/mcp/tools/bugs.ts answers { open, overdue, says, bugs: [{ repo, number, high, createdAt, dueAt, overdue }] }. The list is ordered with the earliest due time first. It is read-only and built on openBugs in src/flow/bugs.ts, the same source as home's tile and the terminal screen.
  • Gating: the same as the terminal screen. A forge admin who isn't an agent sees every repository. Anyone else sees only public repositories.
  • Counts: for a non-admin, open and overdue count only the bugs they can see. The terminal screen hides the count from non-admins altogether, so the tool differs there on purpose. This keeps a private repository's bug from leaking through a total.
  • Index and contract test: the tool is in tools/index.ts, generated by scripts/mcp-tools.ts, and in the tool list that test/mcp.test.ts checks.
  • Not done: I made this a new tool, as the issue asked, rather than an action on an existing one. The size ceilings are unchanged.
  • Tests: test/mcp-bugs.test.ts checks that an overdue high bug is named with a 4 h due time. It also checks that a guest sees neither a private repository's bug nor its counts.

To try it, call tools/call with bugs and a token. An admin token shows all repositories. A non-admin token shows public ones only.

Closes #8859

3 earlier comments
commented

This adds a bugs MCP tool that lists open bugs with their clocks. The gate, tsc, and the MCP tests (mcp-bugs, mcp-size, mcp-tools, mcp) all pass. I didn't run the OpenAPI tests. I couldn't use keep_plan (it isn't available here), so there is no plan on the issue.

  • What it returns: with no arguments, src/http/mcp/tools/bugs.ts answers { open, overdue, says, bugs: [{ repo, number, high, createdAt, dueAt, overdue }] }. The list is ordered with the earliest due time first. It is read-only and built on openBugs in src/flow/bugs.ts, the same source as home's tile and the terminal screen.
  • Gating: the same as the terminal screen. A forge admin who isn't an agent sees every repository. Anyone else sees only public repositories.
  • Counts: for a non-admin, open and overdue count only the bugs they can see. The terminal screen hides the count from non-admins altogether, so the tool differs there on purpose. This keeps a private repository's bug from leaking through a total.
  • Index and contract test: the tool is in tools/index.ts, generated by scripts/mcp-tools.ts, and in the tool list that test/mcp.test.ts checks.
  • Not done: I made this a new tool, as the issue asked, rather than an action on an existing one. The size ceilings are unchanged.
  • Tests: test/mcp-bugs.test.ts checks that an overdue high bug is named with a 4 h due time. It also checks that a guest sees neither a private repository's bug nor its counts.

To try it, call tools/call with bugs and a token. An admin token shows all repositories. A non-admin token shows public ones only.

commented

The bugs MCP tool now lists open and overdue bugs with their clocks, gated as the terminal screen is. The check failed because no commit message carried a "Why now:" line. I've pushed an empty commit that has one.

I did not rewrite the earlier commit, since force pushes are refused. The local gate script runs clean with the new commit, but I haven't seen the forge's check run on it.

  • Tool: src/http/mcp/tools/bugs.ts returns { open, overdue, says, bugs: [{ repo, number, high, createdAt, dueAt, overdue }] }, ordered with the earliest due time first. It is read-only.
  • Gating: a forge admin who isn't an agent sees every repository. Anyone else sees only public repositories, and their counts cover only those.
  • Registration: the tool is in tools/index.ts, and test/mcp.test.ts checks that it is listed.
  • Tests: test/mcp-bugs.test.ts checks that an overdue high bug is named and that a guest cannot see a private repository's bug. mcp-size passes.
  • Not done: I made it a new tool rather than an action on an existing one, as the issue asked. The size ceilings are unchanged.

To try it, call bugs over MCP with a token. An admin token shows all repositories. A non-admin token shows public ones only.

commented

I've pushed a new commit with a "Why now:" line, but I haven't seen the forge's check pass on it. The local gate passed, and it also passed on the previous push, so I can't be sure this fixes the failure.

My guess is that the forge ignored the earlier commit because it was empty. This one also adds a short paragraph about the bugs tool to docs/MCP.md, so it changes a file. Its message says: "Why now: issue #8859 asks for the bug clock to be reachable through MCP, as home and the terminal already have it."

If the check still fails, the forge is probably reading something other than commit messages. If so, someone will need to look at how it reads them.

The tool is as before. It returns open and overdue counts and each bug's repository, number, priority and due time. A forge admin sees every repository, and anyone else sees only public ones.

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