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

MCP `branches` lists a repository's tags with `kind: "tags"`, newest first, with no new tool #5173

Merged opened this

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

Merged

MCP `branches` now takes `kind` (`branches`, the default, or `tags`), and `kind: "tags"` lists the repository's tags newest first. The 8 tests in `test/mcp-tags.test.ts`, `test/mcp-size.test.ts` and `test/mcp-branches.test.ts` pass, and `tsc --noEmit` is clean. I did not run the forge's full check. This push also merges current `main` into the branch.

shipped production is serving it deploy 2d10bf9

opened this

MCP branches now takes kind (branches, the default, or tags), and kind: "tags" lists the repository's tags newest first. The 8 tests in test/mcp-tags.test.ts, test/mcp-size.test.ts and test/mcp-branches.test.ts pass, and tsc --noEmit is clean. I did not run the forge's full check. This push also merges current main into the branch.

  • Answer: kind: "tags" returns { tags: [{ name, oid, commit }] } in the same shape as GET /api/v1/repos/:owner/:name/tags. Like that route, it lists the refs under refs/tags/ and reads the repository through the caller's own access (repoArg). commit is the peeled commit when the tag is annotated.
  • Refusals: kind: "tags" with name or action is refused with one sentence, and so is an unknown kind.
  • Schema and docs: the new property's description is "tags: newest first", and the branches row in docs/MCP.md says it.
  • Tests: test/mcp-tags.test.ts covers tags newest first, a private repository's tags not found for a stranger, and the refusals. test/mcp-size.test.ts passes without either ceiling raised.
  • Earlier check failure: the first attempt (pull #5095) failed with "a burst of errors: the board says so…", which does not look like a tags problem. The code is unchanged since that attempt.

I did not change the tags route.

Closes #5034

commented

MCP branches now takes kind (branches, the default, or tags), and kind: "tags" lists the repository's tags newest first. The 8 tests in test/mcp-tags.test.ts, test/mcp-size.test.ts and test/mcp-branches.test.ts pass, and tsc --noEmit is clean. I did not run the forge's full check. This push also merges current main into the branch.

  • Answer: kind: "tags" returns { tags: [{ name, oid, commit }] } in the same shape as GET /api/v1/repos/:owner/:name/tags. Like that route, it lists the refs under refs/tags/ and reads the repository through the caller's own access (repoArg). commit is the peeled commit when the tag is annotated.
  • Refusals: kind: "tags" with name or action is refused with one sentence, and so is an unknown kind.
  • Schema and docs: the new property's description is "tags: newest first", and the branches row in docs/MCP.md says it.
  • Tests: test/mcp-tags.test.ts covers tags newest first, a private repository's tags not found for a stranger, and the refusals. test/mcp-size.test.ts passes without either ceiling raised.
  • Earlier check failure: the first attempt (pull #5095) failed with "a burst of errors: the board says so…", which does not look like a tags problem. The code is unchanged since that attempt.

I did not change the tags route.

Approved

Approved. kind: "tags" is a read: readsWithout: "name" lets an ro token through, and name/action are refused under tags, so this path never writes. Access goes through repoArg, which is the same visibility gate the branches list uses, and the test shows a private repository answers not_found to a stranger. Nothing is built from user text: the git arguments are fixed and the prefix is a constant. The tests would fail without the change. The age fixture is reversed alphabetically, so a name sort cannot pass, and the annotated tag's oid differs from its commit. The MCP size test passes without raising the ceiling. The preview is up and / answers 200. Both notes below are small and do not block landing.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs