Skip to content

Commit 5706ac9

Browse files
donjor-agent[bot]rsi-pr-agent
authored andcommitted
feat(server): agents link GitHub issues to their thread over MCP (#1441)
## What Changed Agents link GitHub issues to their own thread over MCP, the way they link pull requests. | Tool | Does | | --- | --- | | `link_issue` | links by URL, or repository and number, as `agent` | | `unlink_issue` | removes a link; reports whether one existed | | `list_thread_issues` | the thread's links with last known state | - **Thread:** always the calling token's own thread - **Host default:** the project's host when only a number is given - **Repeat link:** `alreadyLinked`, no error - **Absent unlink:** `wasLinked: false`, no error - **Other rejections:** stay failures - **Deleted thread:** not found, never a no-op - **Stored URL:** canonical issue URL only - **Hosts:** github.com or the project's host - **Capability:** rides the pull request tools' gate - **Instruction:** one line beside the pull request linking line Upstream files change only by `fork-hook` lines in `McpHttpServer.ts` and `RuntimeInstructions.ts`. ## Why Agents already register the pull requests they open; the issues they work on stayed invisible to the thread. This is layer 3 of #1430, on the link model from #1440. ## Checks ```text vp fmt --check (changed files) → exit 0 vp lint (changed files) → exit 0 tsc --noEmit (apps/server) → exit 0 vp test run issues toolkit + instructions → exit 0 (13 tests) vp run fork:ci → exit 0 ``` ## Evidence A real Claude thread on this branch's dev server, told to use only its MCP tools: 1. `link_issue` the issue URL 2. `link_issue` it again 3. `list_thread_issues` 4. `unlink_issue` it 5. `unlink_issue` it again 6. `list_thread_issues` ![tools-crop.png](https://github.com/user-attachments/assets/a0e64496-99a1-4e7d-acd9-b82819cc63dc) ## Close conditions Closes #1433 - [x] link_issue: links by URL as agent - [x] unlink_issue: removes the link - [x] list_thread_issues: lists the thread's links - [x] Idempotent: a repeat link changes nothing - [x] Scope: a call reaches only its own thread - [x] Missing thread: fails, never "already linked" | Condition | Evidence | | --- | --- | | link_issue | "links by URL with source agent on the token's thread" | | unlink_issue | "unlinks a linked issue and reports a missing one as wasLinked=false" | | list_thread_issues | "lists the shell's links, with unknown state until the first read" | | Idempotent | "treats a duplicate link as alreadyLinked rather than an error" | | Scope | the thread comes from the invocation token, never the input | | Missing thread | "fails cleanly when the token's thread no longer exists"; "reports a thread deleted between lookup and dispatch as not found" | ## Checklist - [x] This PR is small and focused - [x] I explained what changed and why - [x] I included before/after screenshots for any UI changes - [x] I included a video for animation/interaction changes No UI changes; the capture above is server evidence. Opus 5.5 via Claude Code in T3 Code. ## Fork trailers Squashes: - 08f914e feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - ccc7cbd fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - 5f9c06ea466 feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - 13b58374c19 fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - 8022f708420 feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - 05e302b39db fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - dda4b199691 fixup! feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - b06df04900a feat(server): agents link GitHub issues to their thread over MCP (#1441) (#1441) - ead034c270b fix(fork): adapt fork seams to v0.0.46-nightly.20261005.2689 Fork-Domain: github-issues Fork-Tier: qol Fork-Upstreamable: no
1 parent aedf0ca commit 5706ac9

10 files changed

Lines changed: 1066 additions & 0 deletions

File tree

‎apps/server/src/mcp/McpHttpServer.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import { WorktreeToolkit } from "./toolkits/worktree/tools.ts";
6868
import * as WorktreeMcpService from "./WorktreeMcpService.ts";
6969
import * as PullRequestsHandlers from "./toolkits/pullRequests/handlers.ts";
7070
import { PullRequestsToolkit } from "./toolkits/pullRequests/tools.ts";
71+
import { IssuesToolkitRegistrationLiveFork } from "./toolkits/issues/handlers.fork.ts"; // fork-hook: github-issues/mcp-issues-toolkit-import
7172
import * as DeviceHandlers from "./toolkits/device/handlers.ts";
7273
import {
7374
DeviceScreenshotTool,
@@ -1150,6 +1151,7 @@ export const layerTools = Layer.mergeAll(
11501151
layerPreviewControlsRegistration,
11511152
layerWorktreeToolkitRegistration,
11521153
layerPullRequestsToolkit,
1154+
IssuesToolkitRegistrationLiveFork, // fork-hook: github-issues/mcp-issues-toolkit
11531155
layerDeviceToolkit,
11541156
layerHtmlToolkit,
11551157
);

0 commit comments

Comments
 (0)