From bed9e49a8ad597619ed8447101f73e25201a9da5 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Tue, 24 Nov 2026 16:13:25 +0000
Subject: [PATCH 01/11] add planning status support
---
README.md | 16 +
docs/feature-flags.md | 1 +
pkg/github/__toolsnaps__/create_issue.snap | 10 +
pkg/github/__toolsnaps__/issue_read.snap | 45 ++-
pkg/github/__toolsnaps__/issue_write.snap | 10 +
pkg/github/__toolsnaps__/search_issues.snap | 2 +-
.../__toolsnaps__/update_issue_status.snap | 126 +++++++
pkg/github/consolidated_issue_types.go | 3 +
pkg/github/granular_issue_types.go | 7 +-
pkg/github/granular_tools_test.go | 146 +++++++-
pkg/github/issue_status.go | 325 ++++++++++++++++++
pkg/github/issues.go | 105 ++++--
pkg/github/issues_granular.go | 16 +-
pkg/github/issues_test.go | 38 +-
pkg/github/search_semantic_test.go | 4 +-
pkg/github/tools.go | 1 +
...yped_consolidated_issue_enrichment_test.go | 2 +-
.../typed_consolidated_issue_outputs_test.go | 237 ++++++++++++-
pkg/github/typed_issue_outputs_test.go | 4 +-
pkg/http/server_test.go | 3 +-
.../catalog/skills/issue-authoring/SKILL.md | 3 +
.../skills/issue-backlog-triage/SKILL.md | 7 +
pkg/skills/catalog/tools.go | 2 +-
23 files changed, 1045 insertions(+), 68 deletions(-)
create mode 100644 pkg/github/__toolsnaps__/update_issue_status.snap
create mode 100644 pkg/github/issue_status.go
diff --git a/README.md b/README.md
index 166dbe0c9c..08459adfd0 100644
--- a/README.md
+++ b/README.md
@@ -619,6 +619,13 @@ The following sets of tools are available:
|
| `users` | GitHub User related tools |
+The `issues` toolset supports planning statuses. `issue_read` returns the
+current status, `search_issues` documents the `status:` qualifier, and issue
+creation accepts Backlog, Todo, In progress, or In review. The
+`update_issue_status` tool also accepts Done, Not planned, and Duplicate;
+Duplicate requires the canonical issue number in `duplicate_of`. Calls that set
+an initial status bypass the MCP App form, which cannot represent it.
+
### Additional Toolsets in Remote GitHub MCP Server
| Toolset | Description |
@@ -1090,6 +1097,7 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
- `repo`: Repository name (string, required)
- `state`: New state (string, optional)
- `state_reason`: Reason for the state change. Ignored unless state is changed. (string, optional)
+ - `status`: Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default. (string, optional)
- `title`: Issue title (string, optional)
- `type`: Type of this issue. For updates, pass null to remove the current type. Only use if issue types are enabled for this repository. Use list_issue_types to get valid type values for this repository or its owner organization. If the repository doesn't support issue types, omit this parameter. (string | null, optional)
@@ -1152,6 +1160,14 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
- `owner`: Repository owner (string, required)
- `repo`: Repository name (string, required)
+- **update_issue_status** - Update Issue Status
+ - **OAuth Challenge Scopes**: `repo`
+ - `duplicate_of`: The canonical issue number. Required only for Duplicate. (number, optional)
+ - `issue_number`: The issue number to update (number, required)
+ - `owner`: Repository owner (username or organization) (string, required)
+ - `repo`: Repository name (string, required)
+ - `status`: The planning status to assign. (string, required)
+
diff --git a/docs/feature-flags.md b/docs/feature-flags.md
index bbfadbfb7f..b4c9ea0bb5 100644
--- a/docs/feature-flags.md
+++ b/docs/feature-flags.md
@@ -285,6 +285,7 @@ as output formatting) won't appear here.
- `parent_owner`: Repository owner of the parent issue. Must be provided with parent_repo. Omit both to use owner and repo. Only used when parent_issue_number is provided. (string, optional)
- `parent_repo`: Repository name of the parent issue. Must be provided with parent_owner. Omit both to use owner and repo. Only used when parent_issue_number is provided. (string, optional)
- `repo`: Repository name (string, required)
+ - `status`: Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default. (string, optional)
- `title`: Issue title (string, required)
- **hide_issue_comment** - Hide Issue Comment
diff --git a/pkg/github/__toolsnaps__/create_issue.snap b/pkg/github/__toolsnaps__/create_issue.snap
index b616605c21..bcf7632f3f 100644
--- a/pkg/github/__toolsnaps__/create_issue.snap
+++ b/pkg/github/__toolsnaps__/create_issue.snap
@@ -48,6 +48,16 @@
"type": "string",
"x-mcp-header": "repo"
},
+ "status": {
+ "description": "Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default.",
+ "enum": [
+ "Backlog",
+ "Todo",
+ "In progress",
+ "In review"
+ ],
+ "type": "string"
+ },
"title": {
"description": "Issue title",
"type": "string"
diff --git a/pkg/github/__toolsnaps__/issue_read.snap b/pkg/github/__toolsnaps__/issue_read.snap
index 4a4356bfe5..c52b73a9a7 100644
--- a/pkg/github/__toolsnaps__/issue_read.snap
+++ b/pkg/github/__toolsnaps__/issue_read.snap
@@ -586,6 +586,48 @@
],
"type": "string"
},
+ "status": {
+ "additionalProperties": false,
+ "description": "The issue's planning status, or null when it has none or it is not recognized. Backlog is backlog; Todo is planned; In progress and In review are started; Done is completed; Not planned is not_planned; Duplicate is duplicate.",
+ "properties": {
+ "category": {
+ "enum": [
+ "backlog",
+ "planned",
+ "started",
+ "completed",
+ "not_planned",
+ "duplicate"
+ ],
+ "type": "string"
+ },
+ "id": {
+ "description": "The status ID.",
+ "type": "integer"
+ },
+ "name": {
+ "enum": [
+ "Backlog",
+ "Todo",
+ "In progress",
+ "In review",
+ "Done",
+ "Not planned",
+ "Duplicate"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "category"
+ ],
+ "type": [
+ "object",
+ "null"
+ ]
+ },
"sub_issues_summary": {
"additionalProperties": false,
"properties": {
@@ -642,7 +684,8 @@
"number",
"title",
"state",
- "assignees"
+ "assignees",
+ "status"
],
"type": [
"null",
diff --git a/pkg/github/__toolsnaps__/issue_write.snap b/pkg/github/__toolsnaps__/issue_write.snap
index dde73657f6..844d324571 100644
--- a/pkg/github/__toolsnaps__/issue_write.snap
+++ b/pkg/github/__toolsnaps__/issue_write.snap
@@ -125,6 +125,16 @@
],
"type": "string"
},
+ "status": {
+ "description": "Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default.",
+ "enum": [
+ "Backlog",
+ "Todo",
+ "In progress",
+ "In review"
+ ],
+ "type": "string"
+ },
"title": {
"description": "Issue title",
"type": "string"
diff --git a/pkg/github/__toolsnaps__/search_issues.snap b/pkg/github/__toolsnaps__/search_issues.snap
index bbba9b0b95..292998b3d6 100644
--- a/pkg/github/__toolsnaps__/search_issues.snap
+++ b/pkg/github/__toolsnaps__/search_issues.snap
@@ -4,7 +4,7 @@
"readOnlyHint": true,
"title": "Search issues"
},
- "description": "Search issues using natural-language semantic matching. Best for conceptual or paraphrased queries (e.g. \"login fails after password reset\"). Already scoped to is:issue.",
+ "description": "Search issues using natural-language semantic matching. Best for conceptual or paraphrased queries (e.g. \"login fails after password reset\"). Already scoped to is:issue. Filter by planning status with the status: qualifier, for example status:\"In progress\". Statuses: Backlog, Todo, In progress, In review, Done, Not planned, Duplicate.",
"inputSchema": {
"properties": {
"fields": {
diff --git a/pkg/github/__toolsnaps__/update_issue_status.snap b/pkg/github/__toolsnaps__/update_issue_status.snap
new file mode 100644
index 0000000000..03c98892d0
--- /dev/null
+++ b/pkg/github/__toolsnaps__/update_issue_status.snap
@@ -0,0 +1,126 @@
+{
+ "annotations": {
+ "destructiveHint": true,
+ "idempotentHint": false,
+ "openWorldHint": true,
+ "readOnlyHint": false,
+ "title": "Update Issue Status"
+ },
+ "description": "Update an issue's planning status. Done, Not planned and Duplicate close the issue; the other statuses keep it open or reopen it. Duplicate requires duplicate_of, the canonical issue number in the same repository. A status cannot be removed.",
+ "icons": [
+ {
+ "mimeType": "image/png",
+ "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAC2UlEQVRIicWVMUyTaRjHf/+vVUpOJOdilOYoUvVreq2CDmLOwdlAS5xMbrrhBifjYG7QjYuJw108nZx1huLgYlw0QshxChUK2koxHHcuCmgsFfieG0or3kGPSoz/8X3f5/97nvfN8z7wmaVqm9FodFfR/EnMugy5giCAwYwgI9Ff9Hl9L9Lp1zUBgsGO+rqGwnlhF4CdwBSyAUwvS1G220zHBSFgHtmVxYWvfp2ZGSj8LyAcjgfZphTQZtAr7OdsZvSP9RIJR+LtQhcNusF+d1aUfPp05M8NAavmg8AOk3cmN56+s1Hpa7U/cviUYbcw3jgex9ZCKoBgsKM+0PDuAdBq2He5zOiTzZiXtc+NxRw598GeLRcWTuTz+UUAp3ygrqFwHmgzeWdqNQd4PpFOy/gedNQfaDz3UQXRaHRX0fNPGdzNZUZO12q+VuHIoV7g5Hu/1/IinX7tABTNnwR2SvRsxRzAzOsBGuuWfAkoX5FZFzCVHR95tFVAbiI9DEwj6wLwl5YVMTRYLTDsxjuRrgGYYz/kxkbvbXRWMOBB24cKYI9ks1X8hXQDaAaa5XG9WjImZgV71wI+m8qAv8y0t1pSmP0ITANTmHO2qqvRZDALlTdgHKyjWkx2YvQ2cHtTacMxYBhWK5DoF4TCkXj7Jg02VKsbOwI0Y+qvALZrOQXMC13cKkDSJWBuJUCqAhgbG3uF7IpBcn/k8KlPNQ+78U5QQuhy/vHjuQoAYPndwi9gw4bd2ufGYrWatxz8No50ExhaKsz9Vl6vAPL5/KKzoiTGG0fOg1oqCbvxTp/juw/M+zynu/yTwjoD58CBQ02ez/pAR4E+M69ntf3/o1Y3dqR050oAQz7P6Z6cfPRRw647MkOhUMAfaDyH+AloBKYNPRT292rQHoMOSp09J3TZlt5ezWazxX97VR3638RiX9ct+RImSyBcrDT0ETMyMp4ptRIgVX7QL6J/ALSUEwJ5rdg2AAAAAElFTkSuQmCC",
+ "theme": "light"
+ },
+ {
+ "mimeType": "image/png",
+ "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABxElEQVRIibWVvW4TURCFv0vlNEDcIHAkKAERJOIKSjoUArwBPwUFFaKIIngAJARCPIgdh4cgRBYt6ZIAEYEqdhpEw0fhCbkKa68dxyNtsfNzzpnZu3NhwpYGBdUqcA+4A1wEZiK0DawD74FWSml3JAJ1CngGLAIngU1gFfgZKWeAG8AFoAu8At6mlH6VtqTOqJ/UP2pDnRuQO6c27VlbrQ0Dvq121Fulag7q5qPmW18SdSqUd9Qrw4Jn9bNR21YrRQkvYixDKy/AuB3jWjocqKpdtXFU8AxrOTqZzp2PgvnaMRDUA+tB7mypG+OCZ3hbahPgRPguAR9LihaicEu9WcKxClzOi/fU1wPAk7rjgX0uEfNG3cs7mJjtE+wA5/olpZQEHgNf6K2NJyW4NeD7v7c4WptjSc0svlMjdzyM2fbdOyOA7x/T+7mzGj9H8xgIWuquevpw4HmsivkxwBdC/WJRsBKLqqPOHgH8aqybtcJlF0m1WLndUToJ5V31q9r3NOYk7Wh1Wa0PyK3HzA3l/4H3uzIrwFNgCThF7/x/AH5EylngOnAe6AAvgXcppd9DEWRE08DdeIou/RVgJaXUGYQzUfsL+zmwV7BtIq0AAAAASUVORK5CYII=",
+ "theme": "dark"
+ }
+ ],
+ "inputSchema": {
+ "properties": {
+ "duplicate_of": {
+ "description": "The canonical issue number. Required only for Duplicate.",
+ "minimum": 1,
+ "type": "number"
+ },
+ "issue_number": {
+ "description": "The issue number to update",
+ "minimum": 1,
+ "type": "number"
+ },
+ "owner": {
+ "description": "Repository owner (username or organization)",
+ "type": "string",
+ "x-mcp-header": "owner"
+ },
+ "repo": {
+ "description": "Repository name",
+ "type": "string",
+ "x-mcp-header": "repo"
+ },
+ "status": {
+ "description": "The planning status to assign.",
+ "enum": [
+ "Backlog",
+ "Todo",
+ "In progress",
+ "In review",
+ "Done",
+ "Not planned",
+ "Duplicate"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "owner",
+ "repo",
+ "issue_number",
+ "status"
+ ],
+ "type": "object"
+ },
+ "name": "update_issue_status",
+ "outputSchema": {
+ "additionalProperties": false,
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "status": {
+ "additionalProperties": false,
+ "description": "The issue's planning status, or null when it has none or it is not recognized. Backlog is backlog; Todo is planned; In progress and In review are started; Done is completed; Not planned is not_planned; Duplicate is duplicate.",
+ "properties": {
+ "category": {
+ "enum": [
+ "backlog",
+ "planned",
+ "started",
+ "completed",
+ "not_planned",
+ "duplicate"
+ ],
+ "type": "string"
+ },
+ "id": {
+ "description": "The status ID.",
+ "type": "integer"
+ },
+ "name": {
+ "enum": [
+ "Backlog",
+ "Todo",
+ "In progress",
+ "In review",
+ "Done",
+ "Not planned",
+ "Duplicate"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "category"
+ ],
+ "type": [
+ "object",
+ "null"
+ ]
+ },
+ "url": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "url",
+ "status"
+ ],
+ "type": "object"
+ }
+}
\ No newline at end of file
diff --git a/pkg/github/consolidated_issue_types.go b/pkg/github/consolidated_issue_types.go
index ccd84e0173..2f81836b0b 100644
--- a/pkg/github/consolidated_issue_types.go
+++ b/pkg/github/consolidated_issue_types.go
@@ -27,6 +27,7 @@ type IssueWriteInput struct {
State *string `json:"state,omitempty"`
StateReason *string `json:"state_reason,omitempty"`
DuplicateOf *int `json:"duplicate_of,omitempty"`
+ Status *string `json:"status,omitempty"`
IssueFields []IssueWriteFieldInput `json:"issue_fields,omitempty"`
TypeProvided bool `json:"-"`
}
@@ -160,6 +161,7 @@ type IssueDetailsOutput struct {
Parent *MinimalIssueRef `json:"parent,omitempty"`
SubIssuesSummary *MinimalSubIssuesSummary `json:"sub_issues_summary,omitempty"`
ClosedByPullRequests *MinimalClosingPullRequests `json:"closed_by_pull_requests,omitempty"`
+ Status *IssuePlanningStatus `json:"status"`
}
func issueDetailsOutput(issue MinimalIssue) *IssueDetailsOutput {
@@ -381,6 +383,7 @@ func subIssueOutput(issue *github.SubIssue) (*SubIssueOutput, error) {
var issueReadOutputSchema = sync.OnceValue(func() *jsonschema.Schema {
schema := issueDTOschema[IssueReadOutput]()
issue := schema.Properties["issue"]
+ issue.Properties["status"] = issuePlanningStatusSchema()
issue.Properties["state"].Enum = []any{"", "open", "closed"}
issue.Properties["state_reason"].Enum = []any{"completed", "not_planned", "reopened", "duplicate"}
describeIssueSummarySchema(issue.Properties["sub_issues_summary"])
diff --git a/pkg/github/granular_issue_types.go b/pkg/github/granular_issue_types.go
index c0b9f2e16d..765cb56af8 100644
--- a/pkg/github/granular_issue_types.go
+++ b/pkg/github/granular_issue_types.go
@@ -30,6 +30,7 @@ type GranularCreateIssueInput struct {
ParentIssueNumber *int `json:"parent_issue_number,omitempty"`
ParentOwner string `json:"parent_owner,omitempty"`
ParentRepo string `json:"parent_repo,omitempty"`
+ Status string `json:"status,omitempty"`
}
type GranularIssueTitleInput struct {
@@ -455,7 +456,11 @@ func normalizeGranularCreateIssueArguments(raw json.RawMessage) (json.RawMessage
parentNumber = &parentIssueNumber
}
- return marshalGranularIssueArguments(args, GranularCreateIssueInput{Owner: owner, Repo: repo, Title: title, Body: body, ParentIssueNumber: parentNumber, ParentOwner: parentOwner, ParentRepo: parentRepo})
+ status, err := OptionalParam[string](args, "status")
+ if err != nil {
+ return nil, err
+ }
+ return marshalGranularIssueArguments(args, GranularCreateIssueInput{Owner: owner, Repo: repo, Title: title, Body: body, ParentIssueNumber: parentNumber, ParentOwner: parentOwner, ParentRepo: parentRepo, Status: status})
}
func normalizeGranularUpdateIssueAssigneesArguments(raw json.RawMessage) (json.RawMessage, error) {
diff --git a/pkg/github/granular_tools_test.go b/pkg/github/granular_tools_test.go
index b63485fe9d..20abc4c5ef 100644
--- a/pkg/github/granular_tools_test.go
+++ b/pkg/github/granular_tools_test.go
@@ -3,6 +3,7 @@ package github
import (
"context"
"encoding/json"
+ "fmt"
"maps"
"net/http"
"strings"
@@ -16,6 +17,7 @@ import (
"github.com/github/github-mcp-server/v2/pkg/translations"
"github.com/github/github-mcp-server/v2/pkg/utils"
gogithub "github.com/google/go-github/v92/github"
+ "github.com/modelcontextprotocol/go-sdk/mcp"
"github.com/shurcooL/githubv4"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -114,7 +116,7 @@ func TestIssuesGranularToolset(t *testing.T) {
t.Run("all granular tools have correct feature flag", func(t *testing.T) {
for _, tool := range granularToolsForToolset(ToolsetMetadataIssues.ID, FeatureFlagIssuesGranular) {
- assert.Equal(t, []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagIssuesGranular)}, tool.FeatureRule.Features(), "tool %s", tool.Tool.Name)
+ assert.Contains(t, tool.FeatureRule.Features(), inventory.FeatureFlag(FeatureFlagIssuesGranular), "tool %s", tool.Tool.Name)
}
})
}
@@ -1175,6 +1177,148 @@ func TestGranularUpdateIssueState(t *testing.T) {
}
}
+func TestUpdateIssueStatus(t *testing.T) {
+ cases := []struct {
+ status string
+ category string
+ duplicateCode int
+ updateCode int
+ wantError string
+ }{
+ {"Backlog", "backlog", 0, http.StatusOK, ""},
+ {"Todo", "planned", 0, http.StatusOK, ""},
+ {"In progress", "started", 0, http.StatusOK, ""},
+ {"In review", "started", 0, http.StatusOK, ""},
+ {"Done", "completed", 0, http.StatusOK, ""},
+ {"Not planned", "not_planned", 0, http.StatusOK, ""},
+ {"Duplicate", "duplicate", http.StatusOK, http.StatusOK, ""},
+ {"Duplicate", "duplicate", http.StatusNotFound, 0, "failed to get duplicate issue"},
+ {"Todo", "planned", 0, http.StatusForbidden, "failed to update issue"},
+ }
+ for _, tc := range cases {
+ t.Run(fmt.Sprintf("%s/%d/%d", tc.status, tc.duplicateCode, tc.updateCode), func(t *testing.T) {
+ gets, patches := 0, 0
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "application/json")
+ if r.Method == http.MethodGet {
+ gets++
+ assert.Equal(t, "/repos/owner/repo/issues/7", r.URL.Path)
+ w.WriteHeader(tc.duplicateCode)
+ _, _ = w.Write([]byte(`{"id":987,"message":"Not Found"}`))
+ return
+ }
+ patches++
+ assert.Equal(t, http.MethodPatch, r.Method)
+ assert.Equal(t, "/repos/owner/repo/issues/42", r.URL.Path)
+ var body map[string]any
+ require.NoError(t, json.NewDecoder(r.Body).Decode(&body))
+ expected := map[string]any{"status": tc.status}
+ if tc.status == "Duplicate" {
+ expected["duplicate_issue_id"] = float64(987)
+ }
+ assert.Equal(t, expected, body, "only the status and resolved duplicate ID should be sent")
+ w.WriteHeader(tc.updateCode)
+ _, _ = fmt.Fprintf(w, `{"id":123,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":4,"name":%q,"category":%q},"message":"Forbidden"}`, tc.status, tc.category)
+ })}}
+ session, _ := issueStatusSession(t, BaseDeps{Client: mustNewGHClient(t, rest)}, inventory.ProtocolVersionMultiRoundTrip)
+ args := map[string]any{"owner": "owner", "repo": "repo", "issue_number": "42", "status": strings.ToLower(tc.status)}
+ if tc.status == "Duplicate" {
+ args["duplicate_of"] = "7"
+ }
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: args})
+ require.NoError(t, err)
+ if tc.wantError != "" {
+ require.True(t, result.IsError)
+ assert.Contains(t, getTextResult(t, result).Text, tc.wantError)
+ } else {
+ require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
+ assert.JSONEq(t, fmt.Sprintf(`{"id":"123","url":"https://github.com/owner/repo/issues/42","status":{"id":4,"name":%q,"category":%q}}`, tc.status, tc.category), getTextResult(t, result).Text)
+ assert.JSONEq(t, mustMarshalJSON(t, result.StructuredContent), getTextResult(t, result).Text)
+ }
+ if tc.status == "Duplicate" {
+ assert.Equal(t, 1, gets)
+ } else {
+ assert.Zero(t, gets)
+ }
+ if tc.updateCode == 0 {
+ assert.Zero(t, patches, "failed duplicate lookup must prevent the mutation")
+ } else {
+ assert.Equal(t, 1, patches)
+ }
+ })
+ }
+}
+
+func TestIssuePlanningStatusInvalidInput(t *testing.T) {
+ translate := translations.NullTranslationHelper
+ cases := []struct {
+ tool inventory.ServerTool
+ args map[string]any
+ want string
+ }{
+ {UpdateIssueStatus(translate), map[string]any{"status": "Duplicate"}, "duplicate_of is required"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Duplicate", "duplicate_of": 0}, "duplicate_of must be positive"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Todo", "duplicate_of": 7}, "duplicate_of can only be used"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "unknown"}, "status must be one of"},
+ {UpdateIssueStatus(translate), map[string]any{"status": nil}, "status"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Todo", "issue_number": -1}, "issue_number must be positive"},
+ {GranularCreateIssue(translate), map[string]any{"status": "Done"}, "status must be one of: Backlog, Todo, In progress, In review"},
+ {IssueWrite(translate), map[string]any{"method": "update", "status": "Todo"}, "status is only supported with the create method"},
+ {IssueWrite(translate), map[string]any{"status": "Todo", "state": "closed"}, "status cannot be combined with state"},
+ }
+ for i, tc := range cases {
+ t.Run(fmt.Sprintf("%s/%d", tc.tool.Tool.Name, i), func(t *testing.T) {
+ args := map[string]any{"owner": "owner", "repo": "repo", "issue_number": 42, "title": "Subject", "method": "create"}
+ maps.Copy(args, tc.args)
+ req := createMCPRequest(args)
+ result, err := tc.tool.Handler(BaseDeps{})(context.Background(), &req)
+ require.NoError(t, err)
+ require.True(t, result.IsError)
+ assert.Contains(t, getTextResult(t, result).Text, tc.want)
+ })
+ }
+}
+
+func TestIssuePlanningStatusCreationNotApplied(t *testing.T) {
+ for _, tool := range []inventory.ServerTool{
+ IssueWrite(translations.NullTranslationHelper), GranularCreateIssue(translations.NullTranslationHelper),
+ } {
+ t.Run(tool.Tool.Name, func(t *testing.T) {
+ client := MockHTTPClientWithHandlers(map[string]http.HandlerFunc{
+ PostReposIssuesByOwnerByRepo: mockResponse(t, http.StatusCreated, map[string]any{
+ "id": 123, "number": 42, "html_url": "https://github.com/owner/repo/issues/42",
+ "status": map[string]any{"id": 1, "name": "Backlog", "category": "backlog"},
+ }),
+ })
+ deps := BaseDeps{Client: mustNewGHClient(t, client), GQLClient: defaultGQLClient}
+ req := createMCPRequest(map[string]any{"owner": "owner", "repo": "repo", "title": "Subject", "method": "create", "status": "Todo"})
+ result, err := tool.Handler(deps)(ContextWithDeps(context.Background(), deps), &req)
+ require.NoError(t, err)
+ require.True(t, result.IsError)
+ assert.Equal(t, `issue https://github.com/owner/repo/issues/42 was created, but requested status "Todo" was not applied`, getTextResult(t, result).Text,
+ "a created issue must not be reported as a failed creation")
+ })
+ }
+}
+
+func TestUpdateIssueStatusUnrecognizedResponse(t *testing.T) {
+ for _, status := range []string{`{"id":9,"name":"Blocked","category":"started"}`, `{"id":9,"name":"Todo","category":"custom"}`, `"Todo"`} {
+ t.Run(status, func(t *testing.T) {
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+ w.Header().Set("Content-Type", "application/json")
+ _, _ = fmt.Fprintf(w, `{"id":123,"html_url":"https://github.com/owner/repo/issues/42","status":%s}`, status)
+ })}}
+ session, _ := issueStatusSession(t, BaseDeps{Client: mustNewGHClient(t, rest)}, inventory.ProtocolVersionMultiRoundTrip)
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: map[string]any{
+ "owner": "owner", "repo": "repo", "issue_number": 42, "status": "Todo",
+ }})
+ require.NoError(t, err)
+ require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
+ assert.JSONEq(t, `{"id":"123","url":"https://github.com/owner/repo/issues/42","status":null}`, getTextResult(t, result).Text)
+ })
+ }
+}
+
func TestGranularUpdateIssueStateSuggest(t *testing.T) {
tests := []struct {
name string
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
new file mode 100644
index 0000000000..c7be7ddef7
--- /dev/null
+++ b/pkg/github/issue_status.go
@@ -0,0 +1,325 @@
+package github
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/http"
+ "slices"
+ "strings"
+
+ ghErrors "github.com/github/github-mcp-server/v2/pkg/errors"
+ "github.com/github/github-mcp-server/v2/pkg/inventory"
+ "github.com/github/github-mcp-server/v2/pkg/scopes"
+ "github.com/github/github-mcp-server/v2/pkg/translations"
+ "github.com/github/github-mcp-server/v2/pkg/utils"
+ "github.com/google/go-github/v92/github"
+ "github.com/google/jsonschema-go/jsonschema"
+ "github.com/modelcontextprotocol/go-sdk/mcp"
+ "github.com/shurcooL/githubv4"
+)
+
+var (
+ issueStatusNames = []string{"Backlog", "Todo", "In progress", "In review", "Done", "Not planned", "Duplicate"}
+ // Issues can only be created with an open status.
+ issueCreationStatusNames = issueStatusNames[:4:4]
+ issueStatusCategories = []string{"backlog", "planned", "started", "completed", "not_planned", "duplicate"}
+)
+
+type IssuePlanningStatus struct {
+ ID int64 `json:"id"`
+ Name string `json:"name"`
+ Category string `json:"category"`
+}
+
+// issueWithStatus decodes the REST status field, which go-github does not yet expose.
+// The status stays raw so an unexpected shape cannot fail decoding the issue.
+type issueWithStatus struct {
+ github.Issue
+ RawStatus json.RawMessage `json:"status"`
+}
+
+// planningStatus returns nil when the issue has no status or an unrecognized one,
+// so unexpected API values never fail output schema validation.
+func (issue *issueWithStatus) planningStatus() *IssuePlanningStatus {
+ var status *IssuePlanningStatus
+ if json.Unmarshal(issue.RawStatus, &status) != nil || status == nil {
+ return nil
+ }
+ if !slices.Contains(issueStatusNames, status.Name) || !slices.Contains(issueStatusCategories, status.Category) {
+ return nil
+ }
+ return status
+}
+
+// issueStatusNotAppliedError reports an issue that was created without its requested
+// status. It is kept distinct from a failed creation so agents don't retry and duplicate the issue.
+type issueStatusNotAppliedError struct {
+ URL string
+ Status string
+}
+
+func (e issueStatusNotAppliedError) Error() string {
+ return fmt.Sprintf("issue %s was created, but requested status %q was not applied", e.URL, e.Status)
+}
+
+func createIssueErrorResult(ctx context.Context, resp *github.Response, err error) *mcp.CallToolResult {
+ if notApplied, ok := errors.AsType[issueStatusNotAppliedError](err); ok {
+ return utils.NewToolResultError(notApplied.Error())
+ }
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to create issue", resp, err)
+}
+
+func enumValues(values []string) []any {
+ enum := make([]any, len(values))
+ for i, value := range values {
+ enum[i] = value
+ }
+ return enum
+}
+
+type IssueStatusUpdateOutput struct {
+ ID string `json:"id"`
+ URL string `json:"url"`
+ Status *IssuePlanningStatus `json:"status"`
+}
+
+type IssueStatusInput struct {
+ Owner string `json:"owner"`
+ Repo string `json:"repo"`
+ IssueNumber int `json:"issue_number"`
+ Status string `json:"status"`
+ DuplicateOf int `json:"duplicate_of,omitempty"`
+}
+
+func issuePlanningStatusSchema() *jsonschema.Schema {
+ return &jsonschema.Schema{
+ Types: []string{"object", "null"},
+ Description: "The issue's planning status, or null when it has none or it is not recognized. " +
+ "Backlog is backlog; Todo is planned; In progress and In review are started; " +
+ "Done is completed; Not planned is not_planned; Duplicate is duplicate.",
+ Properties: map[string]*jsonschema.Schema{
+ "id": {Type: "integer", Description: "The status ID."},
+ "name": {Type: "string", Enum: enumValues(issueStatusNames)},
+ "category": {Type: "string", Enum: enumValues(issueStatusCategories)},
+ },
+ Required: []string{"id", "name", "category"},
+ AdditionalProperties: &jsonschema.Schema{Not: &jsonschema.Schema{}},
+ }
+}
+
+func canonicalIssueStatus(status string, allowed []string) (string, error) {
+ for _, name := range allowed {
+ if strings.EqualFold(status, name) {
+ return name, nil
+ }
+ }
+ return "", fmt.Errorf("status must be one of: %s", strings.Join(allowed, ", "))
+}
+
+func normalizeIssueCreationStatus(next inventory.InputNormalizer, consolidated bool) inventory.InputNormalizer {
+ return func(raw json.RawMessage) (json.RawMessage, error) {
+ var args map[string]any
+ if err := json.Unmarshal(raw, &args); err != nil {
+ return nil, err
+ }
+ if _, provided := args["status"]; provided {
+ if consolidated && args["method"] != "create" {
+ return nil, fmt.Errorf("status is only supported with the create method; use update_issue_status to update it")
+ }
+ status, err := RequiredParam[string](args, "status")
+ if err != nil {
+ return nil, err
+ }
+ status, err = canonicalIssueStatus(status, issueCreationStatusNames)
+ if err != nil {
+ return nil, err
+ }
+ for _, field := range []string{"state", "state_reason", "duplicate_of"} {
+ if _, provided := args[field]; provided {
+ return nil, fmt.Errorf("status cannot be combined with %s when creating an issue", field)
+ }
+ }
+ args["status"] = status
+ raw, err = json.Marshal(args)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return next(raw)
+ }
+}
+
+func normalizeIssueStatusArguments(raw json.RawMessage) (json.RawMessage, error) {
+ var args map[string]any
+ if err := json.Unmarshal(raw, &args); err != nil {
+ return nil, err
+ }
+ for _, field := range []string{"owner", "repo", "status"} {
+ if _, err := RequiredParam[string](args, field); err != nil {
+ return nil, err
+ }
+ }
+ number, err := RequiredInt(args, "issue_number")
+ if err != nil {
+ return nil, err
+ }
+ if number < 1 {
+ return nil, fmt.Errorf("issue_number must be positive")
+ }
+ status, err := canonicalIssueStatus(args["status"].(string), issueStatusNames)
+ if err != nil {
+ return nil, err
+ }
+ duplicate := 0
+ if _, provided := args["duplicate_of"]; provided {
+ duplicate, err = OptionalIntParam(args, "duplicate_of")
+ if err != nil {
+ return nil, err
+ }
+ if duplicate < 1 {
+ return nil, fmt.Errorf("duplicate_of must be positive")
+ }
+ if status != "Duplicate" {
+ return nil, fmt.Errorf("duplicate_of can only be used when status is 'Duplicate'")
+ }
+ args["duplicate_of"] = duplicate
+ }
+ if status == "Duplicate" && duplicate == 0 {
+ return nil, fmt.Errorf("duplicate_of is required when status is 'Duplicate'")
+ }
+ args["issue_number"], args["status"] = number, status
+ return json.Marshal(args)
+}
+
+// UpdateIssueStatus changes an issue's planning status.
+func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerTool {
+ return NewTool[IssueStatusInput, *IssueStatusUpdateOutput](
+ ToolsetMetadataIssues,
+ mcp.Tool{
+ Name: "update_issue_status",
+ Description: t("TOOL_UPDATE_ISSUE_STATUS_DESCRIPTION", "Update an issue's planning status. "+
+ "Done, Not planned and Duplicate close the issue; the other statuses keep it open or reopen it. "+
+ "Duplicate requires duplicate_of, the canonical issue number in the same repository. A status cannot be removed."),
+ InputSchema: &jsonschema.Schema{
+ Type: "object",
+ Properties: map[string]*jsonschema.Schema{
+ "owner": {Type: "string", Description: "Repository owner (username or organization)"},
+ "repo": {Type: "string", Description: "Repository name"},
+ "issue_number": {Type: "number", Minimum: new(1.0), Description: "The issue number to update"},
+ "status": {Type: "string", Enum: enumValues(issueStatusNames), Description: "The planning status to assign."},
+ "duplicate_of": {Type: "number", Minimum: new(1.0), Description: "The canonical issue number. Required only for Duplicate."},
+ },
+ Required: []string{"owner", "repo", "issue_number", "status"},
+ },
+ OutputSchema: issueStatusUpdateOutputSchema(),
+ Annotations: &mcp.ToolAnnotations{
+ Title: t("TOOL_UPDATE_ISSUE_STATUS_USER_TITLE", "Update Issue Status"),
+ ReadOnlyHint: false,
+ DestructiveHint: new(true), OpenWorldHint: new(true),
+ },
+ },
+ scopes.RequireAll(scopes.Repo),
+ func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args IssueStatusInput) (*mcp.CallToolResult, *IssueStatusUpdateOutput, error) {
+ client, err := deps.GetClient(ctx)
+ if err != nil {
+ return utils.NewToolResultErrorFromErr("failed to get GitHub client", err), nil, nil
+ }
+ body := struct {
+ Status string `json:"status"`
+ DuplicateIssueID *int64 `json:"duplicate_issue_id,omitempty"`
+ }{Status: args.Status}
+ if args.DuplicateOf != 0 {
+ duplicate, resp, err := client.Issues.Get(ctx, args.Owner, args.Repo, args.DuplicateOf)
+ if resp != nil {
+ defer func() { _ = resp.Body.Close() }()
+ }
+ if err != nil {
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to get duplicate issue", resp, err), nil, nil
+ }
+ body.DuplicateIssueID = duplicate.ID
+ if body.DuplicateIssueID == nil || *body.DuplicateIssueID < 1 {
+ return utils.NewToolResultError("failed to get duplicate issue: response did not include a valid issue ID"), nil, nil
+ }
+ }
+ req, err := client.NewRequest(ctx, http.MethodPatch, fmt.Sprintf("repos/%s/%s/issues/%d", args.Owner, args.Repo, args.IssueNumber), body)
+ if err != nil {
+ return utils.NewToolResultErrorFromErr("failed to create status update request", err), nil, nil
+ }
+ var issue issueWithStatus
+ resp, err := client.Do(req, &issue)
+ if resp != nil {
+ defer func() { _ = resp.Body.Close() }()
+ }
+ if err != nil {
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to update issue", resp, err), nil, nil
+ }
+ output := &IssueStatusUpdateOutput{ID: fmt.Sprintf("%d", issue.GetID()), URL: issue.GetHTMLURL(), Status: issue.planningStatus()}
+ return MarshalledTextResult(output), output, nil
+ },
+ granularIssueInputNormalizer(normalizeIssueStatusArguments),
+ )
+}
+
+func issueCreationStatusProperty() *jsonschema.Schema {
+ return &jsonschema.Schema{
+ Type: "string", Enum: enumValues(issueCreationStatusNames),
+ Description: "Initial planning status (create only). Only open statuses are supported. " +
+ "Backlog is backlog; Todo is planned; In progress and In review are started. " +
+ "Omit to use the repository default.",
+ }
+}
+
+// createRESTIssue preserves the standard request fields while adding the API's
+// status field, which go-github does not yet expose.
+func createRESTIssue(ctx context.Context, client *github.Client, owner, repo string, body github.CreateIssueRequest, status string) (*github.Issue, *github.Response, error) {
+ if status == "" {
+ return client.Issues.Create(ctx, owner, repo, body)
+ }
+ requestBody := struct {
+ github.CreateIssueRequest
+ Status string `json:"status"`
+ }{body, status}
+ req, err := client.NewRequest(ctx, http.MethodPost, fmt.Sprintf("repos/%s/%s/issues", owner, repo), requestBody)
+ if err != nil {
+ return nil, nil, err
+ }
+ var issue issueWithStatus
+ resp, err := client.Do(req, &issue)
+ if err != nil {
+ return nil, resp, err
+ }
+ if applied := issue.planningStatus(); applied == nil || applied.Name != status {
+ return nil, resp, issueStatusNotAppliedError{URL: issue.GetHTMLURL(), Status: status}
+ }
+ return &issue.Issue, resp, nil
+}
+
+func resolveIssueStatusID(ctx context.Context, client *githubv4.Client, owner, repo, status string) (githubv4.ID, error) {
+ var query struct {
+ Repository struct {
+ PlanningStatuses struct {
+ Nodes []struct {
+ ID githubv4.ID
+ Name string
+ }
+ } `graphql:"planningStatuses(first: 7)"`
+ } `graphql:"repository(owner: $owner, name: $repo)"`
+ }
+ if err := client.Query(ctx, &query, map[string]any{"owner": githubv4.String(owner), "repo": githubv4.String(repo)}); err != nil {
+ return nil, err
+ }
+ for _, node := range query.Repository.PlanningStatuses.Nodes {
+ if node.Name == status && node.ID != nil {
+ return node.ID, nil
+ }
+ }
+ return nil, fmt.Errorf("planning status %q is unavailable in %s/%s", status, owner, repo)
+}
+
+func issueStatusUpdateOutputSchema() *jsonschema.Schema {
+ schema := issueDTOschema[IssueStatusUpdateOutput]()
+ schema.Properties["status"] = issuePlanningStatusSchema()
+ return schema
+}
diff --git a/pkg/github/issues.go b/pkg/github/issues.go
index 30005854aa..70b8f76042 100644
--- a/pkg/github/issues.go
+++ b/pkg/github/issues.go
@@ -912,11 +912,19 @@ func getIssue(ctx context.Context, client *github.Client, deps ToolDependencies,
}
flags := deps.GetFlags(ctx)
- issue, resp, err := client.Issues.Get(ctx, owner, repo, issueNumber)
+ req, err := client.NewRequest(ctx, http.MethodGet, fmt.Sprintf("repos/%s/%s/issues/%d", owner, repo, issueNumber), nil)
+ if err != nil {
+ return nil, nil, fmt.Errorf("failed to create issue request: %w", err)
+ }
+ var response issueWithStatus
+ resp, err := client.Do(req, &response)
+ if resp != nil {
+ defer func() { _ = resp.Body.Close() }()
+ }
if err != nil {
return nil, nil, fmt.Errorf("failed to get issue: %w", err)
}
- defer func() { _ = resp.Body.Close() }()
+ issue := &response.Issue
if resp.StatusCode != http.StatusOK {
body, err := io.ReadAll(resp.Body)
@@ -947,7 +955,13 @@ func getIssue(ctx context.Context, client *github.Client, deps ToolDependencies,
}
}
- return MarshalledTextResult(minimalIssue), &IssueReadOutput{Method: "get", Issue: issueDetailsOutput(minimalIssue)}, nil
+ output := &IssueReadOutput{Method: "get", Issue: issueDetailsOutput(minimalIssue)}
+ status := response.planningStatus()
+ output.Issue.Status = status
+ return MarshalledTextResult(struct {
+ MinimalIssue
+ Status *IssuePlanningStatus `json:"status"`
+ }{minimalIssue, status}), output, nil
}
// applyIssueReadEnrichment populates the hierarchy relationship signals (has_parent/has_children,
@@ -1958,6 +1972,11 @@ const (
searchIssuesLexicalQueryDescription = "Search query using GitHub issues search syntax"
)
+func searchIssuesStatusDescription() string {
+ return `Filter by planning status with the status: qualifier, for example status:"In progress". Statuses: ` +
+ strings.Join(issueStatusNames, ", ") + "."
+}
+
// SearchIssues creates a tool to search for issues.
func SearchIssues(t translations.TranslationHelperFunc, opts ...ToolOption) inventory.ServerTool {
cfg := newToolConfig(opts)
@@ -1975,6 +1994,8 @@ func SearchIssues(t translations.TranslationHelperFunc, opts ...ToolOption) inve
toolDescription = searchIssuesLexicalDescription
queryDescription = searchIssuesLexicalQueryDescription
}
+ toolDescription = t("TOOL_SEARCH_ISSUES_DESCRIPTION", toolDescription)
+ toolDescription += " " + t("TOOL_SEARCH_ISSUES_STATUS_DESCRIPTION", searchIssuesStatusDescription())
schema := &jsonschema.Schema{
Type: "object",
@@ -2026,7 +2047,7 @@ func SearchIssues(t translations.TranslationHelperFunc, opts ...ToolOption) inve
ToolsetMetadataIssues,
mcp.Tool{
Name: "search_issues",
- Description: t("TOOL_SEARCH_ISSUES_DESCRIPTION", toolDescription),
+ Description: toolDescription,
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_SEARCH_ISSUES_USER_TITLE", "Search issues"),
ReadOnlyHint: true,
@@ -2684,12 +2705,7 @@ func issueWriteAwaitingFormResult(method, owner, repo string, issueNumber int) *
return utils.NewToolResultAwaitingFormSubmission(msg)
}
-// IssueWrite is the FeatureFlagIssueFields-enabled variant of issue_write
-// (with the issue_fields parameter). LegacyIssueWrite is served when the flag
-// is off. Both register under the tool name "issue_write"; exactly one is
-// active at a time via mutually exclusive feature-flag annotations. When the
-// flag is removed, delete LegacyIssueWrite outright and drop the feature-flag
-// fields on IssueWrite.
+// IssueWrite creates a tool to create or update an issue.
func IssueWrite(t translations.TranslationHelperFunc) inventory.ServerTool {
st := NewTool[IssueWriteInput, *IssueWriteOutput](
ToolsetMetadataIssues,
@@ -3003,11 +3019,15 @@ Options are:
switch method {
case "create":
+ status := ""
+ if input.Status != nil {
+ status = *input.Status
+ }
if parentProvided {
- return issueWriteResult(method)(createIssueWithParent(ctx, client, gqlClient, owner, repo, title, body, assignees, labels, milestoneNum, issueType, parentIssueNumber, parentOwner, parentRepo))
+ return issueWriteResult(method)(createIssueWithParent(ctx, client, gqlClient, owner, repo, title, body, assignees, labels, milestoneNum, issueType, parentIssueNumber, parentOwner, parentRepo, status))
}
- return issueWriteResult(method)(createIssue(ctx, client, owner, repo, title, body, assignees, labels, milestoneNum, issueType, issueFieldValues))
+ return issueWriteResult(method)(createIssue(ctx, client, owner, repo, title, body, assignees, labels, milestoneNum, issueType, issueFieldValues, status))
case "update":
issueNumber, err := RequiredInt(args, "issue_number")
if err != nil {
@@ -3021,7 +3041,10 @@ Options are:
default:
return utils.NewToolResultError("invalid method, must be either 'create' or 'update'"), nil, nil
}
- }, normalizeConsolidatedIssueArguments("write"))
+ }, normalizeIssueCreationStatus(normalizeConsolidatedIssueArguments("write"), true))
+ schema := inventory.CloneSchema(st.Tool.InputSchema.(*jsonschema.Schema))
+ schema.Properties["status"] = issueCreationStatusProperty()
+ st.Tool.InputSchema = schema
st.FeatureRule = issuesConsolidatedFeatureRule
return st
}
@@ -3036,6 +3059,7 @@ type CreateIssueInput struct {
LabelIDs *[]githubv4.ID `json:"labelIds,omitempty"`
IssueTypeID *githubv4.ID `json:"issueTypeId,omitempty"`
ParentIssueID *githubv4.ID `json:"parentIssueId,omitempty"`
+ StatusID *githubv4.ID `json:"statusId,omitempty"`
}
type createIssueMutation struct {
@@ -3047,6 +3071,18 @@ type createIssueMutation struct {
} `graphql:"createIssue(input: $input)"`
}
+type createIssueWithStatusMutation struct {
+ CreateIssue struct {
+ Issue struct {
+ FullDatabaseID githubv4.String `graphql:"fullDatabaseId"`
+ URL githubv4.URI
+ Status *struct {
+ Name string
+ }
+ }
+ } `graphql:"createIssue(input: $input)"`
+}
+
type createIssueParentMetadataQuery struct {
ChildRepository struct {
ID githubv4.ID
@@ -3077,11 +3113,12 @@ func CreateIssueWithParent(
parentOwner string,
parentRepo string,
) (*mcp.CallToolResult, error) {
- result, _, err := createIssueWithParent(ctx, client, gqlClient, owner, repo, title, body, assignees, labels, milestoneNumber, issueType, parentIssueNumber, parentOwner, parentRepo)
+ result, _, err := createIssueWithParent(ctx, client, gqlClient, owner, repo, title, body, assignees, labels, milestoneNumber, issueType, parentIssueNumber, parentOwner, parentRepo, "")
return result, err
}
-func createIssueWithParent(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, owner, repo, title, body string, assignees, labels []string, milestoneNumber int, issueType string, parentIssueNumber int, parentOwner, parentRepo string) (*mcp.CallToolResult, *MinimalResponse, error) {
+// createIssueWithParent sets the initial planning status unless status is empty.
+func createIssueWithParent(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, owner, repo, title, body string, assignees, labels []string, milestoneNumber int, issueType string, parentIssueNumber int, parentOwner, parentRepo, status string) (*mcp.CallToolResult, *MinimalResponse, error) {
if title == "" {
return utils.NewToolResultError("missing required parameter: title"), nil, nil
}
@@ -3145,12 +3182,31 @@ func createIssueWithParent(ctx context.Context, client *github.Client, gqlClient
}
var mutation createIssueMutation
- if err := gqlClient.Mutate(ctx, &mutation, input, nil); err != nil {
+ appliedStatus := ""
+ if status != "" {
+ statusID, err := resolveIssueStatusID(ctx, gqlClient, owner, repo, status)
+ if err != nil {
+ return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to resolve planning status", err), nil, nil
+ }
+ input.StatusID = &statusID
+ var statusMutation createIssueWithStatusMutation
+ if err := gqlClient.Mutate(ctx, &statusMutation, input, nil); err != nil {
+ return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to create issue", err), nil, nil
+ }
+ created := statusMutation.CreateIssue.Issue
+ mutation.CreateIssue.Issue.FullDatabaseID, mutation.CreateIssue.Issue.URL = created.FullDatabaseID, created.URL
+ if created.Status != nil {
+ appliedStatus = created.Status.Name
+ }
+ } else if err := gqlClient.Mutate(ctx, &mutation, input, nil); err != nil {
return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to create issue", err), nil, nil
}
if mutation.CreateIssue.Issue.FullDatabaseID == "" || mutation.CreateIssue.Issue.URL.URL == nil {
return utils.NewToolResultError("failed to create issue: response did not include the created issue"), nil, nil
}
+ if appliedStatus != status {
+ return utils.NewToolResultError(issueStatusNotAppliedError{URL: mutation.CreateIssue.Issue.URL.String(), Status: status}.Error()), nil, nil
+ }
response := MinimalResponse{
ID: string(mutation.CreateIssue.Issue.FullDatabaseID),
@@ -3313,11 +3369,12 @@ func containsIssueLabel(labels []string, target string) bool {
}
func CreateIssue(ctx context.Context, client *github.Client, owner string, repo string, title string, body string, assignees []string, labels []string, milestoneNum int, issueType string, issueFieldValues []*github.IssueRequestFieldValue) (*mcp.CallToolResult, error) {
- result, _, err := createIssue(ctx, client, owner, repo, title, body, assignees, labels, milestoneNum, issueType, issueFieldValues)
+ result, _, err := createIssue(ctx, client, owner, repo, title, body, assignees, labels, milestoneNum, issueType, issueFieldValues, "")
return result, err
}
-func createIssue(ctx context.Context, client *github.Client, owner string, repo string, title string, body string, assignees []string, labels []string, milestoneNum int, issueType string, issueFieldValues []*github.IssueRequestFieldValue) (*mcp.CallToolResult, *MinimalResponse, error) {
+// createIssue sets the initial planning status unless status is empty.
+func createIssue(ctx context.Context, client *github.Client, owner string, repo string, title string, body string, assignees []string, labels []string, milestoneNum int, issueType string, issueFieldValues []*github.IssueRequestFieldValue, status string) (*mcp.CallToolResult, *MinimalResponse, error) {
if title == "" {
return utils.NewToolResultError("missing required parameter: title"), nil, nil
}
@@ -3339,15 +3396,13 @@ func createIssue(ctx context.Context, client *github.Client, owner string, repo
issueRequest.Type = new(issueType)
}
- issue, resp, err := client.Issues.Create(ctx, owner, repo, issueRequest)
+ issue, resp, err := createRESTIssue(ctx, client, owner, repo, issueRequest, status)
+ if resp != nil {
+ defer func() { _ = resp.Body.Close() }()
+ }
if err != nil {
- return ghErrors.NewGitHubAPIErrorResponse(ctx,
- "failed to create issue",
- resp,
- err,
- ), nil, nil
+ return createIssueErrorResult(ctx, resp, err), nil, nil
}
- defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != http.StatusCreated {
body, err := io.ReadAll(resp.Body)
diff --git a/pkg/github/issues_granular.go b/pkg/github/issues_granular.go
index eab4a204cd..cf26ca0caf 100644
--- a/pkg/github/issues_granular.go
+++ b/pkg/github/issues_granular.go
@@ -170,23 +170,27 @@ func GranularCreateIssue(t translations.TranslationHelperFunc) inventory.ServerT
if err != nil {
return utils.NewToolResultErrorFromErr("failed to get GitHub GraphQL client", err), nil, nil
}
- result, output, err := createIssueWithParent(ctx, client, gqlClient, owner, repo, title, body, nil, nil, 0, "", parentIssueNumber, parentOwner, parentRepo)
- return result, output, err
+ return createIssueWithParent(ctx, client, gqlClient, owner, repo, title, body, nil, nil, 0, "", parentIssueNumber, parentOwner, parentRepo, args.Status)
}
- issue, resp, err := client.Issues.Create(ctx, owner, repo, issueReq)
+ issue, resp, err := createRESTIssue(ctx, client, owner, repo, issueReq, args.Status)
+ if resp != nil {
+ defer func() { _ = resp.Body.Close() }()
+ }
if err != nil {
- return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to create issue", resp, err), nil, nil
+ return createIssueErrorResult(ctx, resp, err), nil, nil
}
- defer func() { _ = resp.Body.Close() }()
return granularIssueMinimalResult(&MinimalResponse{
ID: fmt.Sprintf("%d", issue.GetID()),
URL: issue.GetHTMLURL(),
})
},
- granularIssueInputNormalizer(normalizeGranularCreateIssueArguments),
+ granularIssueInputNormalizer(normalizeIssueCreationStatus(normalizeGranularCreateIssueArguments, false)),
)
+ schema := inventory.CloneSchema(st.Tool.InputSchema.(*jsonschema.Schema))
+ schema.Properties["status"] = issueCreationStatusProperty()
+ st.Tool.InputSchema = schema
st.FeatureRule = issuesGranularFeatureRule
return st
}
diff --git a/pkg/github/issues_test.go b/pkg/github/issues_test.go
index 79eeb22100..bd6202f2e1 100644
--- a/pkg/github/issues_test.go
+++ b/pkg/github/issues_test.go
@@ -1847,6 +1847,7 @@ func Test_CreateIssue(t *testing.T) {
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "milestone")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "type")
assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "issue_fields")
+ assert.Contains(t, tool.InputSchema.(*jsonschema.Schema).Properties, "status")
assert.ElementsMatch(t, tool.InputSchema.(*jsonschema.Schema).Required, []string{"method", "owner", "repo"})
// Setup mock issue for success case
@@ -3181,33 +3182,22 @@ func Test_issueWriteSchemaClassification(t *testing.T) {
"parent_issue_number": {},
"parent_owner": {},
"parent_repo": {},
+ "status": {},
}
- cases := []struct {
- name string
- tool inventory.ServerTool
- }{
- {name: "IssueWrite", tool: IssueWrite(translations.NullTranslationHelper)},
- }
+ schema, ok := IssueWrite(translations.NullTranslationHelper).Tool.InputSchema.(*jsonschema.Schema)
+ require.True(t, ok, "InputSchema should be *jsonschema.Schema")
- for _, tc := range cases {
- t.Run(tc.name, func(t *testing.T) {
- t.Parallel()
- schema, ok := tc.tool.Tool.InputSchema.(*jsonschema.Schema)
- require.True(t, ok, "InputSchema should be *jsonschema.Schema")
-
- for prop := range schema.Properties {
- _, isForm := issueWriteFormParams[prop]
- _, isNonForm := knownNonForm[prop]
-
- assert.Falsef(t, isForm && isNonForm,
- "property %q is classified as both form-resendable and non-form — pick one", prop)
- assert.Truef(t, isForm || isNonForm,
- "property %q in %s schema is unclassified — add it to issueWriteFormParams (pkg/github/issues.go) "+
- "if the MCP App form can carry it on submit, otherwise add it to the knownNonForm allowlist in this test",
- prop, tc.name)
- }
- })
+ for prop := range schema.Properties {
+ _, isForm := issueWriteFormParams[prop]
+ _, isNonForm := knownNonForm[prop]
+
+ assert.Falsef(t, isForm && isNonForm,
+ "property %q is classified as both form-resendable and non-form — pick one", prop)
+ assert.Truef(t, isForm || isNonForm,
+ "property %q in IssueWrite schema is unclassified — add it to issueWriteFormParams (pkg/github/issues.go) "+
+ "if the MCP App form can carry it on submit, otherwise add it to the knownNonForm allowlist in this test",
+ prop)
}
}
diff --git a/pkg/github/search_semantic_test.go b/pkg/github/search_semantic_test.go
index 102664d08c..86092d347c 100644
--- a/pkg/github/search_semantic_test.go
+++ b/pkg/github/search_semantic_test.go
@@ -74,8 +74,8 @@ func Test_searchIssuesTool_descriptionMatchesEngine(t *testing.T) {
require.Equal(t, "search_issues", semantic.Tool.Name)
require.Equal(t, "search_issues", lexical.Tool.Name)
- assert.Equal(t, searchIssuesSemanticDescription, semantic.Tool.Description)
- assert.Equal(t, searchIssuesLexicalDescription, lexical.Tool.Description)
+ assert.Equal(t, searchIssuesSemanticDescription+" "+searchIssuesStatusDescription(), semantic.Tool.Description)
+ assert.Equal(t, searchIssuesLexicalDescription+" "+searchIssuesStatusDescription(), lexical.Tool.Description)
semanticSchema, ok := semantic.Tool.InputSchema.(*jsonschema.Schema)
require.True(t, ok)
diff --git a/pkg/github/tools.go b/pkg/github/tools.go
index 6a0a262175..9924c3fb80 100644
--- a/pkg/github/tools.go
+++ b/pkg/github/tools.go
@@ -264,6 +264,7 @@ func AllTools(t translations.TranslationHelperFunc, opts ...ToolOption) []invent
ListIssueTypes(t),
ListIssueFields(t),
IssueWrite(t),
+ UpdateIssueStatus(t),
AddIssueComment(t),
UpdateIssueComment(t),
SubIssueWrite(t),
diff --git a/pkg/github/typed_consolidated_issue_enrichment_test.go b/pkg/github/typed_consolidated_issue_enrichment_test.go
index 2e02dcf09c..f703ae91cc 100644
--- a/pkg/github/typed_consolidated_issue_enrichment_test.go
+++ b/pkg/github/typed_consolidated_issue_enrichment_test.go
@@ -87,7 +87,7 @@ func TestTypedIssueReadEnrichmentAndLockdown(t *testing.T) {
if !lockdown {
text += `{"number":8,"title":"Closing","state":"OPEN","url":"closing","repository":"owner/repo"}`
}
- text += `]}}`
+ text += `]},"status":null}`
result := assertConsolidatedResult(t, session, schemas, "issue_read", map[string]any{
"method": "get", "owner": "owner", "repo": "repo", "issue_number": 1,
}, text)
diff --git a/pkg/github/typed_consolidated_issue_outputs_test.go b/pkg/github/typed_consolidated_issue_outputs_test.go
index 60374e10cb..779e6cfbf8 100644
--- a/pkg/github/typed_consolidated_issue_outputs_test.go
+++ b/pkg/github/typed_consolidated_issue_outputs_test.go
@@ -10,6 +10,8 @@ import (
"testing"
"time"
+ "github.com/github/github-mcp-server/v2/internal/githubv4mock"
+ "github.com/github/github-mcp-server/v2/internal/toolsnaps"
ghcontext "github.com/github/github-mcp-server/v2/pkg/context"
"github.com/github/github-mcp-server/v2/pkg/inventory"
"github.com/github/github-mcp-server/v2/pkg/sanitize"
@@ -22,6 +24,237 @@ import (
"github.com/stretchr/testify/require"
)
+func issueStatusSession(t *testing.T, deps BaseDeps, protocol string, flags ...inventory.FeatureFlag) (*mcp.ClientSession, []*mcp.Tool) {
+ t.Helper()
+ translate := translations.NullTranslationHelper
+ tools := []inventory.ServerTool{
+ IssueRead(translate), IssueWrite(translate), GranularCreateIssue(translate),
+ SearchIssues(translate), UpdateIssueStatus(translate),
+ }
+ checker := featureCheckerFor(flags...)
+ inv, err := inventory.NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).WithFeatureChecker(checker).Build()
+ require.NoError(t, err)
+ server := mcp.NewServer(&mcp.Implementation{Name: "issue-statuses", Version: "v1"}, nil)
+ server.AddReceivingMiddleware(InjectDepsMiddleware(deps))
+ inv.RegisterTools(context.Background(), server, deps)
+ session := connectCommentVisibilityClient(t, server, protocol)
+ list, err := session.ListTools(context.Background(), nil)
+ require.NoError(t, err)
+ return session, list.Tools
+}
+
+func TestIssuePlanningStatusToolAvailability(t *testing.T) {
+ for _, granular := range []bool{false, true} {
+ t.Run(fmt.Sprintf("granular=%t", granular), func(t *testing.T) {
+ var flags []inventory.FeatureFlag
+ if granular {
+ flags = append(flags, inventory.FeatureFlag(FeatureFlagIssuesGranular))
+ }
+ _, tools := issueStatusSession(t, BaseDeps{}, inventory.ProtocolVersionMultiRoundTrip, flags...)
+ names := make(map[string]bool)
+ for _, tool := range tools {
+ require.False(t, names[tool.Name], "duplicate registration: %s", tool.Name)
+ names[tool.Name] = true
+ var input, output jsonschema.Schema
+ require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, tool.InputSchema)), &input))
+ require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, tool.OutputSchema)), &output))
+ if tool.Name == "issue_write" || tool.Name == "create_issue" {
+ assert.Contains(t, input.Properties, "status")
+ }
+ if tool.Name == "issue_read" {
+ assert.Contains(t, output.Properties["issue"].Properties, "status")
+ }
+ if tool.Name == "search_issues" {
+ assert.Contains(t, tool.Description, "status:")
+ }
+ }
+ assert.Equal(t, granular, names["create_issue"])
+ assert.Equal(t, !granular, names["issue_write"])
+ assert.True(t, names["update_issue_status"])
+ })
+ }
+}
+
+func TestUpdateIssueStatusWireContract(t *testing.T) {
+ const expected = `{"id":"123","url":"https://github.com/owner/repo/issues/42","status":{"id":4,"name":"Todo","category":"planned"}}`
+ for _, protocol := range []string{inventory.ProtocolVersionMultiRoundTrip, "2025-11-25"} {
+ t.Run(protocol, func(t *testing.T) {
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ assert.Equal(t, http.MethodPatch, r.Method)
+ assert.Equal(t, "/repos/owner/repo/issues/42", r.URL.Path)
+ w.Header().Set("Content-Type", "application/json")
+ _, _ = w.Write([]byte(`{"id":123,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":4,"name":"Todo","category":"planned"}}`))
+ })}}
+ session, tools := issueStatusSession(t, BaseDeps{Client: mustNewGHClient(t, rest)}, protocol)
+
+ var outputSchema *jsonschema.Resolved
+ found := false
+ for _, tool := range tools {
+ if tool.Name != "update_issue_status" {
+ continue
+ }
+ found = true
+ if protocol == inventory.ProtocolVersionMultiRoundTrip {
+ require.NoError(t, toolsnaps.Test(tool.Name, *tool))
+ var schema jsonschema.Schema
+ require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, tool.OutputSchema)), &schema))
+ var err error
+ outputSchema, err = schema.Resolve(nil)
+ require.NoError(t, err)
+ } else {
+ assert.Nil(t, tool.OutputSchema)
+ }
+ }
+ require.True(t, found)
+
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: map[string]any{
+ "owner": "owner", "repo": "repo", "issue_number": 42, "status": "Todo",
+ }})
+ require.NoError(t, err)
+ require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
+ assert.JSONEq(t, expected, getTextResult(t, result).Text)
+ if protocol == inventory.ProtocolVersionMultiRoundTrip {
+ require.NotNil(t, outputSchema)
+ assert.JSONEq(t, expected, mustMarshalJSON(t, result.StructuredContent))
+ var output any
+ require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, result.StructuredContent)), &output))
+ require.NoError(t, outputSchema.Validate(output))
+ } else {
+ assert.Nil(t, result.StructuredContent)
+ }
+ })
+ }
+}
+
+func TestIssuePlanningStatusRead(t *testing.T) {
+ const inProgress = `{"id":4,"name":"In progress","category":"started"}`
+ unrecognized := []string{`{"id":9,"name":"Blocked","category":"started"}`, `{"id":9,"name":"Todo","category":"custom"}`, `"Todo"`}
+ for _, protocol := range []string{inventory.ProtocolVersionMultiRoundTrip, "2025-11-25"} {
+ for _, status := range append([]string{inProgress, "null", ""}, unrecognized...) {
+ t.Run(fmt.Sprintf("%s/status=%s", protocol, status), func(t *testing.T) {
+ calls := 0
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ calls++
+ assert.Equal(t, http.MethodGet, r.Method)
+ assert.Equal(t, "/repos/owner/repo/issues/42", r.URL.Path)
+ payload := `{"id":123,"number":42,"title":"Subject","state":"open"}`
+ if status != "" {
+ payload = strings.TrimSuffix(payload, "}") + `,"status":` + status + "}"
+ }
+ w.Header().Set("Content-Type", "application/json")
+ _, _ = w.Write([]byte(payload))
+ })}}
+ deps := BaseDeps{Client: mustNewGHClient(t, rest), GQLClient: defaultGQLClient, RepoAccessCache: stubRepoAccessCache(nil, time.Minute)}
+ session, tools := issueStatusSession(t, deps, protocol)
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "issue_read", Arguments: map[string]any{
+ "method": "get", "owner": "owner", "repo": "repo", "issue_number": 42,
+ }})
+ require.NoError(t, err)
+ require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
+ assert.Equal(t, 1, calls, "status must use the original issue GET")
+ var output map[string]any
+ require.NoError(t, json.Unmarshal([]byte(getTextResult(t, result).Text), &output))
+ if protocol == inventory.ProtocolVersionMultiRoundTrip {
+ assert.JSONEq(t, mustMarshalJSON(t, result.StructuredContent), getTextResult(t, result).Text)
+ for _, tool := range tools {
+ if tool.Name == "issue_read" {
+ var schema jsonschema.Schema
+ require.NoError(t, json.Unmarshal([]byte(mustMarshalJSON(t, tool.OutputSchema)), &schema))
+ resolved, err := schema.Resolve(nil)
+ require.NoError(t, err)
+ require.NoError(t, resolved.Validate(output))
+ }
+ }
+ output = output["issue"].(map[string]any)
+ }
+ value, present := output["status"]
+ assert.True(t, present)
+ if status == inProgress {
+ assert.JSONEq(t, status, mustMarshalJSON(t, value))
+ } else {
+ assert.Nil(t, value, "missing and unrecognized statuses must be null")
+ }
+ })
+ }
+ }
+}
+
+func TestIssuePlanningStatusCreation(t *testing.T) {
+ for _, tc := range []struct{ granular, parent, ignored bool }{
+ {false, false, false}, {false, true, false},
+ {true, false, false}, {true, true, false},
+ {false, true, true},
+ } {
+ granular, parent := tc.granular, tc.parent
+ t.Run(fmt.Sprintf("granular=%t/parent=%t/ignored=%t", granular, parent, tc.ignored), func(t *testing.T) {
+ calls := 0
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ calls++
+ assert.Equal(t, http.MethodPost, r.Method)
+ assert.Equal(t, "/repos/owner/repo/issues", r.URL.Path)
+ var body map[string]any
+ require.NoError(t, json.NewDecoder(r.Body).Decode(&body))
+ assert.Equal(t, "In review", body["status"])
+ assert.Equal(t, "Subject", body["title"])
+ assert.Equal(t, "Body", body["body"])
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusCreated)
+ _, _ = w.Write([]byte(`{"id":123,"number":42,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":5,"name":"In review","category":"started"}}`))
+ })}}
+ gql := defaultGQLClient
+ if parent {
+ parentID, statusID := githubv4.ID("I_parent"), githubv4.ID("IS_review")
+ statusName := "In review"
+ if tc.ignored {
+ statusName = "Backlog"
+ }
+ gql = githubv4.NewClient(githubv4mock.NewMockedHTTPClient(
+ createIssueParentMatcher(3, "owner", "repo", "R_repo", "I_parent"),
+ githubv4mock.NewQueryMatcher(
+ "query($owner:String!$repo:String!){repository(owner: $owner, name: $repo){planningStatuses(first: 7){nodes{id,name}}}}",
+ map[string]any{"owner": "owner", "repo": "repo"},
+ githubv4mock.DataResponse(map[string]any{"repository": map[string]any{"planningStatuses": map[string]any{"nodes": []any{map[string]any{"id": "IS_review", "name": "In review"}}}}}),
+ ),
+ githubv4mock.NewMutationMatcher(createIssueWithStatusMutation{}, CreateIssueInput{
+ RepositoryID: githubv4.ID("R_repo"), Title: githubv4.String("Subject"), Body: githubv4.NewString("Body"),
+ ParentIssueID: &parentID, StatusID: &statusID,
+ }, nil, githubv4mock.DataResponse(map[string]any{"createIssue": map[string]any{"issue": map[string]any{
+ "fullDatabaseId": "123", "url": "https://github.com/owner/repo/issues/42", "status": map[string]any{"name": statusName},
+ }}})),
+ ))
+ }
+ deps := BaseDeps{Client: mustNewGHClient(t, rest), GQLClient: gql}
+ var flags []inventory.FeatureFlag
+ name := "issue_write"
+ args := map[string]any{"owner": "owner", "repo": "repo", "title": "Subject", "body": "Body", "status": "in review"}
+ if granular {
+ flags = append(flags, inventory.FeatureFlag(FeatureFlagIssuesGranular))
+ name = "create_issue"
+ } else {
+ args["method"] = "create"
+ }
+ if parent {
+ args["parent_issue_number"] = 3
+ }
+ session, _ := issueStatusSession(t, deps, inventory.ProtocolVersionMultiRoundTrip, flags...)
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: name, Arguments: args})
+ require.NoError(t, err)
+ if tc.ignored {
+ require.True(t, result.IsError)
+ assert.Equal(t, `issue https://github.com/owner/repo/issues/42 was created, but requested status "In review" was not applied`, getTextResult(t, result).Text)
+ } else {
+ require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
+ assert.Contains(t, getTextResult(t, result).Text, `"id":"123"`)
+ }
+ if parent {
+ assert.Zero(t, calls, "parent and status must be created atomically, without a REST write")
+ } else {
+ assert.Equal(t, 1, calls)
+ }
+ })
+ }
+}
+
func consolidatedIssueSession(t *testing.T, deps BaseDeps, protocol string, ui bool) (*mcp.ClientSession, map[string]*jsonschema.Resolved) {
t.Helper()
tools := []inventory.ServerTool{
@@ -251,7 +484,7 @@ func TestTypedConsolidatedIssueOutputs(t *testing.T) {
args map[string]any
text string
}{
- {"issue_read", map[string]any{"method": "get", "issue_number": "1.0"}, `{"number":1,"title":"Subject","state":"open","html_url":"https://github.com/owner/repo/issues/1","assignees":[]}`},
+ {"issue_read", map[string]any{"method": "get", "issue_number": "1.0"}, `{"number":1,"title":"Subject","state":"open","html_url":"https://github.com/owner/repo/issues/1","assignees":[],"status":null}`},
{"issue_read", map[string]any{"method": "get_comments", "issue_number": "1", "page": "0", "perPage": "0"}, `[{"id":42,"body":"hello","html_url":"https://github.com/owner/repo/issues/1#issuecomment-42"}]`},
{"issue_read", map[string]any{"method": "get_comments", "issue_number": 2}, `[]`},
{"issue_read", map[string]any{"method": "get_comments", "issue_number": 3}, `[]`},
@@ -444,7 +677,7 @@ func TestConsolidatedIssueStrictSchemasAndScalars(t *testing.T) {
}{
{
issueReadOutputSchema(),
- []string{`{"method":"get","issue":null}`, `{"method":"get_comments","comments":[]}`, `{"method":"get_sub_issues","sub_issues":[null]}`, `{"method":"get_parent","parent":null}`, `{"method":"get","issue":{"number":0,"title":"","state":"","assignees":[]}}`, `{"method":"get_labels","labels":[],"totalCount":0}`},
+ []string{`{"method":"get","issue":null}`, `{"method":"get_comments","comments":[]}`, `{"method":"get_sub_issues","sub_issues":[null]}`, `{"method":"get_parent","parent":null}`, `{"method":"get","issue":{"number":0,"title":"","state":"","assignees":[],"status":null}}`, `{"method":"get_labels","labels":[],"totalCount":0}`},
[]string{`null`, `[]`, `{}`, `{"method":"get"}`, `{"method":"get","comments":[]}`, `{"method":"get","issue":{"number":1}}`, `{"method":"get_parent","parent":{"number":1}}`, `{"method":"get_labels","labels":[]}`, `{"method":"get","issue":null,"comments":[]}`},
},
{
diff --git a/pkg/github/typed_issue_outputs_test.go b/pkg/github/typed_issue_outputs_test.go
index 698abdf01a..f6c139cff5 100644
--- a/pkg/github/typed_issue_outputs_test.go
+++ b/pkg/github/typed_issue_outputs_test.go
@@ -94,7 +94,7 @@ func TestTypedIssueOutputs(t *testing.T) {
// These tools remain feature-gated in production. Enable their existing
// feature rules in the contract harness rather than clearing the rules.
inv, err := inventory.NewBuilder().SetTools(tools).WithToolsets([]string{"all"}).
- WithFeatureChecker(func(context.Context, string) (bool, error) { return true, nil }).Build()
+ WithFeatureChecker(featureCheckerFor(FeatureFlagIssueDependencies, FeatureFlagDuplicateDetection)).Build()
require.NoError(t, err)
const commentText = `{"id":"42","url":"https://github.com/owner/repo/issues/123#issuecomment-42"}`
@@ -107,7 +107,7 @@ func TestTypedIssueOutputs(t *testing.T) {
text string
structured string
}{
- {name: "issue_read", args: map[string]any{"method": "get", "owner": "owner", "repo": "repo", "issue_number": "7.0", "page": "0", "perPage": "0"}, text: `{"number":7,"title":"Blocker","state":"open","html_url":"https://github.com/owner/repo/issues/7","assignees":[]}`, structured: `{"method":"get","issue":{"number":7,"title":"Blocker","state":"open","html_url":"https://github.com/owner/repo/issues/7","assignees":[]}}`},
+ {name: "issue_read", args: map[string]any{"method": "get", "owner": "owner", "repo": "repo", "issue_number": "7.0", "page": "0", "perPage": "0"}, text: `{"number":7,"title":"Blocker","state":"open","html_url":"https://github.com/owner/repo/issues/7","assignees":[],"status":null}`, structured: `{"method":"get","issue":{"number":7,"title":"Blocker","state":"open","html_url":"https://github.com/owner/repo/issues/7","assignees":[],"status":null}}`},
{name: "list_issue_types", args: map[string]any{"owner": "owner"}, text: `[{"id":1,"name":"Bug","is_enabled":false}]`, structured: `[{"id":1,"name":"Bug","is_enabled":false}]`},
{name: "list_issue_types", args: map[string]any{"owner": "owner", "repo": "repo"}, text: `[{"id":1,"name":"Bug","is_enabled":false}]`, structured: `[{"id":1,"name":"Bug","is_enabled":false}]`},
{name: "list_issue_fields", args: map[string]any{"owner": "owner"}, text: `[{"id":"IF_1","full_database_id":99,"name":"Priority","description":"Importance","data_type":"SINGLE_SELECT","visibility":"ALL","options":[{"id":"OPT_1","name":"High","color":"red","priority":0}]}]`, structured: `[{"id":"IF_1","full_database_id":99,"name":"Priority","description":"Importance","data_type":"SINGLE_SELECT","visibility":"ALL","options":[{"id":"OPT_1","name":"High","color":"red","priority":0}]}]`},
diff --git a/pkg/http/server_test.go b/pkg/http/server_test.go
index 2b69f77a00..1b2e66a4d1 100644
--- a/pkg/http/server_test.go
+++ b/pkg/http/server_test.go
@@ -347,7 +347,8 @@ func TestInitGlobalToolScopeMapUsesHost(t *testing.T) {
require.NoError(t, initGlobalToolScopeMap(translator, tt.hostType))
tool := github.SearchIssues(translator, github.WithHost(tt.hostType))
- assert.Equal(t, tt.want, tool.Tool.Description)
+ assert.True(t, strings.HasPrefix(tool.Tool.Description, tt.want))
+ assert.Contains(t, tool.Tool.Description, "status:")
})
}
}
diff --git a/pkg/skills/catalog/skills/issue-authoring/SKILL.md b/pkg/skills/catalog/skills/issue-authoring/SKILL.md
index 8e7d77f4cc..d70056f4ad 100644
--- a/pkg/skills/catalog/skills/issue-authoring/SKILL.md
+++ b/pkg/skills/catalog/skills/issue-authoring/SKILL.md
@@ -62,6 +62,9 @@ do it.
- `labels` — must already exist on the repository. This tool applies labels; it does not
create them.
- `assignees` — assigning someone is a claim on their time. Only from an instruction.
+- `status` — when advertised by `issue_write` or `create_issue`, creation accepts
+ Backlog, Todo, In progress or In review. The parent and initial status can be set
+ atomically. Closed statuses cannot be assigned at creation.
- `sub_issue_id` on `sub_issue_write` — the internal identifier, which is not the issue
number. Read it from the issue rather than assuming the number will work.
diff --git a/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md b/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
index 0b9c717e8a..3f8a6cc67b 100644
--- a/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
+++ b/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
@@ -62,6 +62,13 @@ important one in the backlog; judge on content, not on dates alone.
- `state_reason` — `completed`, `not_planned`, or `duplicate`. Closing without one
loses the only durable signal about why.
- `duplicate_of` — required when `state_reason` is `duplicate`.
+- Planning statuses are available only when advertised. `issue_read` with
+ `method: get` returns `status` as an ID, name and category, or null.
+ Filter `search_issues` with `status:"In progress"` or another fixed status.
+ Use `update_issue_status` for Backlog, Todo, In progress, In review, Done,
+ Not planned or Duplicate. Done, Not planned and Duplicate close the issue;
+ the others keep it open or reopen it. Duplicate requires `duplicate_of`,
+ the canonical issue number in the same repository. Status cannot be removed.
- `type` — only valid if `list_issue_types` returned it. Guessing a type fails the
whole call.
- `updated_at` against `created_at` — age of the report and age of the last activity
diff --git a/pkg/skills/catalog/tools.go b/pkg/skills/catalog/tools.go
index abe173d4b6..dd0e65e525 100644
--- a/pkg/skills/catalog/tools.go
+++ b/pkg/skills/catalog/tools.go
@@ -30,7 +30,7 @@ var requirements = map[string]toolRequirements{
},
"issue-backlog-triage": {
required: [][]string{{"list_issues"}, {"issue_write", "update_issue_state"}},
- optional: []string{"search_issues", "issue_read", "sub_issue_write", "add_issue_comment", "list_label", "list_issue_types", "find_duplicate", "add_sub_issue", "remove_sub_issue", "reprioritize_sub_issue", "set_issue_fields", "update_issue_assignees", "update_issue_body", "update_issue_labels", "update_issue_milestone", "update_issue_title", "update_issue_type"},
+ optional: []string{"search_issues", "issue_read", "sub_issue_write", "add_issue_comment", "list_label", "list_issue_types", "find_duplicate", "add_sub_issue", "remove_sub_issue", "reprioritize_sub_issue", "set_issue_fields", "update_issue_assignees", "update_issue_body", "update_issue_labels", "update_issue_milestone", "update_issue_title", "update_issue_type", "update_issue_status"},
},
"label-scheme-management": {
required: [][]string{{"list_label"}, {"label_write"}},
From 0a5c5fefd7e97a3078e88d688aba60805564c001 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Wed, 25 Nov 2026 13:56:29 +0000
Subject: [PATCH 02/11] add status to ui form, make it explicit that backlog is
the default
---
README.md | 7 +--
docs/feature-flags.md | 2 +-
pkg/github/__toolsnaps__/create_issue.snap | 2 +-
pkg/github/__toolsnaps__/issue_write.snap | 2 +-
pkg/github/issue_status.go | 2 +-
pkg/github/issues.go | 1 +
pkg/github/issues_test.go | 63 +++++++++++++++++++++-
ui/src/apps/issue-write/App.tsx | 40 ++++++++++++++
8 files changed, 111 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 08459adfd0..a0b61c8d76 100644
--- a/README.md
+++ b/README.md
@@ -623,8 +623,9 @@ The `issues` toolset supports planning statuses. `issue_read` returns the
current status, `search_issues` documents the `status:` qualifier, and issue
creation accepts Backlog, Todo, In progress, or In review. The
`update_issue_status` tool also accepts Done, Not planned, and Duplicate;
-Duplicate requires the canonical issue number in `duplicate_of`. Calls that set
-an initial status bypass the MCP App form, which cannot represent it.
+Duplicate requires the canonical issue number in `duplicate_of`. The
+`issue_write` MCP App creation form can set an initial status or use the
+default, Backlog.
### Additional Toolsets in Remote GitHub MCP Server
@@ -1097,7 +1098,7 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
- `repo`: Repository name (string, required)
- `state`: New state (string, optional)
- `state_reason`: Reason for the state change. Ignored unless state is changed. (string, optional)
- - `status`: Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default. (string, optional)
+ - `status`: Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the default status, Backlog. (string, optional)
- `title`: Issue title (string, optional)
- `type`: Type of this issue. For updates, pass null to remove the current type. Only use if issue types are enabled for this repository. Use list_issue_types to get valid type values for this repository or its owner organization. If the repository doesn't support issue types, omit this parameter. (string | null, optional)
diff --git a/docs/feature-flags.md b/docs/feature-flags.md
index b4c9ea0bb5..1cef71ef28 100644
--- a/docs/feature-flags.md
+++ b/docs/feature-flags.md
@@ -285,7 +285,7 @@ as output formatting) won't appear here.
- `parent_owner`: Repository owner of the parent issue. Must be provided with parent_repo. Omit both to use owner and repo. Only used when parent_issue_number is provided. (string, optional)
- `parent_repo`: Repository name of the parent issue. Must be provided with parent_owner. Omit both to use owner and repo. Only used when parent_issue_number is provided. (string, optional)
- `repo`: Repository name (string, required)
- - `status`: Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default. (string, optional)
+ - `status`: Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the default status, Backlog. (string, optional)
- `title`: Issue title (string, required)
- **hide_issue_comment** - Hide Issue Comment
diff --git a/pkg/github/__toolsnaps__/create_issue.snap b/pkg/github/__toolsnaps__/create_issue.snap
index bcf7632f3f..d5c783cb26 100644
--- a/pkg/github/__toolsnaps__/create_issue.snap
+++ b/pkg/github/__toolsnaps__/create_issue.snap
@@ -49,7 +49,7 @@
"x-mcp-header": "repo"
},
"status": {
- "description": "Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default.",
+ "description": "Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the default status, Backlog.",
"enum": [
"Backlog",
"Todo",
diff --git a/pkg/github/__toolsnaps__/issue_write.snap b/pkg/github/__toolsnaps__/issue_write.snap
index 844d324571..ef3b446e28 100644
--- a/pkg/github/__toolsnaps__/issue_write.snap
+++ b/pkg/github/__toolsnaps__/issue_write.snap
@@ -126,7 +126,7 @@
"type": "string"
},
"status": {
- "description": "Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the repository default.",
+ "description": "Initial planning status (create only). Only open statuses are supported. Backlog is backlog; Todo is planned; In progress and In review are started. Omit to use the default status, Backlog.",
"enum": [
"Backlog",
"Todo",
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index c7be7ddef7..07cebe530d 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -267,7 +267,7 @@ func issueCreationStatusProperty() *jsonschema.Schema {
Type: "string", Enum: enumValues(issueCreationStatusNames),
Description: "Initial planning status (create only). Only open statuses are supported. " +
"Backlog is backlog; Todo is planned; In progress and In review are started. " +
- "Omit to use the repository default.",
+ "Omit to use the default status, Backlog.",
}
}
diff --git a/pkg/github/issues.go b/pkg/github/issues.go
index 70b8f76042..0ecb549f3d 100644
--- a/pkg/github/issues.go
+++ b/pkg/github/issues.go
@@ -2669,6 +2669,7 @@ var issueWriteFormParams = map[string]struct{}{
"assignees": {},
"milestone": {},
"type": {},
+ "status": {},
"state": {},
"state_reason": {},
"duplicate_of": {},
diff --git a/pkg/github/issues_test.go b/pkg/github/issues_test.go
index bd6202f2e1..308dbe81d2 100644
--- a/pkg/github/issues_test.go
+++ b/pkg/github/issues_test.go
@@ -2267,6 +2267,67 @@ func Test_IssueWrite_MCPAppsFeature_UIGate(t *testing.T) {
"non-UI client should execute directly")
})
+ t.Run("UI client with initial status routes through UI form", func(t *testing.T) {
+ for _, status := range []string{"Backlog", "Todo", "In progress", "In review", "in progress"} {
+ t.Run(status, func(t *testing.T) {
+ request := createMCPRequestWithSession(t, ClientNameVSCodeInsiders, true, map[string]any{
+ "method": "create",
+ "owner": "owner",
+ "repo": "repo",
+ "title": "Test",
+ "status": status,
+ })
+ result, err := handler(ContextWithDeps(context.Background(), deps), &request)
+ require.NoError(t, err)
+ assert.True(t, result.IsError)
+ assert.Contains(t, getTextResult(t, result).Text, "interactive form has been shown to the user for creating a new issue")
+ })
+ }
+ })
+
+ t.Run("UI client submits selected status", func(t *testing.T) {
+ calls := 0
+ statusClient := mustNewGHClient(t, MockHTTPClientWithHandlers(map[string]http.HandlerFunc{
+ PostReposIssuesByOwnerByRepo: func(w http.ResponseWriter, r *http.Request) {
+ calls++
+ var body map[string]any
+ require.NoError(t, json.NewDecoder(r.Body).Decode(&body))
+ assert.Equal(t, "In review", body["status"])
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusCreated)
+ _, _ = io.WriteString(w, `{"number":1,"title":"Test","html_url":"https://github.com/owner/repo/issues/1","status":{"id":1,"name":"In review","category":"started"}}`)
+ },
+ }))
+ statusDeps := BaseDeps{Client: statusClient, GQLClient: githubv4.NewClient(nil), featureChecker: featureCheckerFor()}
+ request := createMCPRequestWithSession(t, ClientNameVSCodeInsiders, true, map[string]any{
+ "method": "create",
+ "owner": "owner",
+ "repo": "repo",
+ "title": "Test",
+ "status": "in review",
+ "_ui_submitted": true,
+ })
+ result, err := serverTool.Handler(statusDeps)(ContextWithDeps(context.Background(), statusDeps), &request)
+ require.NoError(t, err)
+ require.False(t, result.IsError, getTextResult(t, result).Text)
+ assert.Equal(t, 1, calls)
+ assert.Contains(t, getTextResult(t, result).Text, "https://github.com/owner/repo/issues/1")
+ })
+
+ t.Run("UI client cannot set initial status on update", func(t *testing.T) {
+ request := createMCPRequestWithSession(t, ClientNameVSCodeInsiders, true, map[string]any{
+ "method": "update",
+ "owner": "owner",
+ "repo": "repo",
+ "issue_number": float64(1),
+ "status": "Todo",
+ })
+ result, err := handler(ContextWithDeps(context.Background(), deps), &request)
+ require.NoError(t, err)
+ require.True(t, result.IsError)
+ assert.Contains(t, getTextResult(t, result).Text, "status is only supported with the create method")
+ })
+
t.Run("UI client with state change routes through UI form", func(t *testing.T) {
// state/state_reason/duplicate_of are form params (the issue-write view
// renders close/reopen controls), so a call carrying them must go to
@@ -3073,6 +3134,7 @@ func Test_issueWriteHasNonFormParams(t *testing.T) {
{name: "state present", args: map[string]any{"state": "closed"}, want: false},
{name: "state_reason present", args: map[string]any{"state_reason": "completed"}, want: false},
{name: "duplicate_of present", args: map[string]any{"duplicate_of": float64(7)}, want: false},
+ {name: "status present", args: map[string]any{"status": "Todo"}, want: false},
{name: "parent issue present", args: map[string]any{"parent_issue_number": float64(7)}, want: true},
{name: "parent owner present", args: map[string]any{"parent_owner": "octo-org"}, want: true},
{name: "parent repo present", args: map[string]any{"parent_repo": "parent-repo"}, want: true},
@@ -3182,7 +3244,6 @@ func Test_issueWriteSchemaClassification(t *testing.T) {
"parent_issue_number": {},
"parent_owner": {},
"parent_repo": {},
- "status": {},
}
schema, ok := IssueWrite(translations.NullTranslationHelper).Tool.InputSchema.(*jsonschema.Schema)
diff --git a/ui/src/apps/issue-write/App.tsx b/ui/src/apps/issue-write/App.tsx
index 5cfb5d83a4..567e824d04 100644
--- a/ui/src/apps/issue-write/App.tsx
+++ b/ui/src/apps/issue-write/App.tsx
@@ -116,6 +116,8 @@ const stateReasonOptions: Array<{ value: StateReason; label: string; description
{ value: "duplicate", label: "Duplicate", description: "Another issue tracks this" },
];
+const issueCreationStatuses = ["Backlog", "Todo", "In progress", "In review"];
+
function normalizeSwatchColor(color: string): string {
const trimmed = color.trim();
if (!trimmed) return "var(--borderColor-default, var(--color-border-default))";
@@ -454,6 +456,8 @@ function CreateIssueApp() {
const [issueTypeCleared, setIssueTypeCleared] = useState(false);
const [issueTypesLoading, setIssueTypesLoading] = useState(false);
+ const [selectedStatus, setSelectedStatus] = useState("");
+
// State transition state
const [currentState, setCurrentState] = useState("open");
const [stateReason, setStateReason] = useState("completed");
@@ -758,6 +762,12 @@ function CreateIssueApp() {
typeof inputIssueType === "string" ? { id: inputIssueType, text: inputIssueType } : null
);
setIssueTypeCleared(inputIssueType === null);
+ const inputStatus = toolInput?.status;
+ setSelectedStatus(
+ typeof inputStatus === "string"
+ ? issueCreationStatuses.find((status) => status.toLowerCase() === inputStatus.toLowerCase()) ?? inputStatus
+ : ""
+ );
setCurrentState("open");
setStateReason("completed");
setDuplicateOf("");
@@ -1053,11 +1063,15 @@ function CreateIssueApp() {
delete params.duplicate_of;
delete params.issue_fields;
delete params.type;
+ delete params.status;
if (isUpdateMode && issueNumber) {
params.issue_number = issueNumber;
}
+ if (!isUpdateMode && selectedStatus) {
+ params.status = selectedStatus;
+ }
if (selectedLabels.length > 0) {
params.labels = selectedLabels.map((l) => l.text);
}
@@ -1155,6 +1169,7 @@ function CreateIssueApp() {
selectedMilestone,
selectedIssueType,
issueTypeCleared,
+ selectedStatus,
isUpdateMode,
issueNumber,
stateReason,
@@ -1665,6 +1680,31 @@ function CreateIssueApp() {
+
+ {!isUpdateMode && (
+
+
+ {`Status: ${selectedStatus || "Default (Backlog)"}`}
+
+
+
+ setSelectedStatus("")}>
+ Default (Backlog)
+
+
+ {issueCreationStatuses.map((status) => (
+ setSelectedStatus(status)}
+ >
+ {status}
+
+ ))}
+
+
+
+ )}
{/* Fields section */}
From 1e567ac9c1ac918d8097176375f5f081a946e5f3 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Wed, 25 Nov 2026 15:02:31 +0000
Subject: [PATCH 03/11] copilot review fixes
---
pkg/github/granular_tools_test.go | 53 +++--
pkg/github/issue_status.go | 39 +---
pkg/github/issues.go | 33 +---
pkg/github/issues_granular.go | 2 +-
.../typed_consolidated_issue_outputs_test.go | 182 +++++++++++-------
.../catalog/skills/issue-authoring/SKILL.md | 2 +
6 files changed, 164 insertions(+), 147 deletions(-)
diff --git a/pkg/github/granular_tools_test.go b/pkg/github/granular_tools_test.go
index 20abc4c5ef..03a8e196e9 100644
--- a/pkg/github/granular_tools_test.go
+++ b/pkg/github/granular_tools_test.go
@@ -1279,7 +1279,7 @@ func TestIssuePlanningStatusInvalidInput(t *testing.T) {
}
}
-func TestIssuePlanningStatusCreationNotApplied(t *testing.T) {
+func TestIssuePlanningStatusCreationIgnored(t *testing.T) {
for _, tool := range []inventory.ServerTool{
IssueWrite(translations.NullTranslationHelper), GranularCreateIssue(translations.NullTranslationHelper),
} {
@@ -1294,28 +1294,43 @@ func TestIssuePlanningStatusCreationNotApplied(t *testing.T) {
req := createMCPRequest(map[string]any{"owner": "owner", "repo": "repo", "title": "Subject", "method": "create", "status": "Todo"})
result, err := tool.Handler(deps)(ContextWithDeps(context.Background(), deps), &req)
require.NoError(t, err)
- require.True(t, result.IsError)
- assert.Equal(t, `issue https://github.com/owner/repo/issues/42 was created, but requested status "Todo" was not applied`, getTextResult(t, result).Text,
- "a created issue must not be reported as a failed creation")
+ require.False(t, result.IsError, "creation succeeds even when optional metadata is not applied")
+ assert.JSONEq(t, `{"id":"123","url":"https://github.com/owner/repo/issues/42"}`, getTextResult(t, result).Text)
})
}
}
-func TestUpdateIssueStatusUnrecognizedResponse(t *testing.T) {
- for _, status := range []string{`{"id":9,"name":"Blocked","category":"started"}`, `{"id":9,"name":"Todo","category":"custom"}`, `"Todo"`} {
- t.Run(status, func(t *testing.T) {
- rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
- w.Header().Set("Content-Type", "application/json")
- _, _ = fmt.Fprintf(w, `{"id":123,"html_url":"https://github.com/owner/repo/issues/42","status":%s}`, status)
- })}}
- session, _ := issueStatusSession(t, BaseDeps{Client: mustNewGHClient(t, rest)}, inventory.ProtocolVersionMultiRoundTrip)
- result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: map[string]any{
- "owner": "owner", "repo": "repo", "issue_number": 42, "status": "Todo",
- }})
- require.NoError(t, err)
- require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
- assert.JSONEq(t, `{"id":"123","url":"https://github.com/owner/repo/issues/42","status":null}`, getTextResult(t, result).Text)
- })
+func TestUpdateIssueStatusNotApplied(t *testing.T) {
+ for _, protocol := range []string{inventory.ProtocolVersionMultiRoundTrip, "2025-11-25"} {
+ for _, status := range []string{
+ `{"id":9,"name":"Blocked","category":"started"}`,
+ `{"id":9,"name":"Todo","category":"custom"}`,
+ `{"id":1,"name":"Backlog","category":"backlog"}`,
+ `"Todo"`, `null`, "",
+ } {
+ t.Run(protocol+"/"+status, func(t *testing.T) {
+ patches := 0
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ patches++
+ assert.Equal(t, http.MethodPatch, r.Method)
+ payload := `{"id":123,"html_url":"https://github.com/owner/repo/issues/42"}`
+ if status != "" {
+ payload = strings.TrimSuffix(payload, "}") + `,"status":` + status + "}"
+ }
+ w.Header().Set("Content-Type", "application/json")
+ _, _ = w.Write([]byte(payload))
+ })}}
+ session, _ := issueStatusSession(t, BaseDeps{Client: mustNewGHClient(t, rest)}, protocol)
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: map[string]any{
+ "owner": "owner", "repo": "repo", "issue_number": 42, "status": "Todo",
+ }})
+ require.NoError(t, err)
+ require.True(t, result.IsError)
+ assert.Contains(t, getTextResult(t, result).Text, `requested status "Todo" was not applied`)
+ assert.Nil(t, result.StructuredContent)
+ assert.Equal(t, 1, patches, "unapplied status updates must not be retried")
+ })
+ }
}
}
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index 07cebe530d..62f0881a0f 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -3,13 +3,13 @@ package github
import (
"context"
"encoding/json"
- "errors"
"fmt"
"net/http"
"slices"
"strings"
ghErrors "github.com/github/github-mcp-server/v2/pkg/errors"
+ "github.com/github/github-mcp-server/v2/pkg/ifc"
"github.com/github/github-mcp-server/v2/pkg/inventory"
"github.com/github/github-mcp-server/v2/pkg/scopes"
"github.com/github/github-mcp-server/v2/pkg/translations"
@@ -53,24 +53,6 @@ func (issue *issueWithStatus) planningStatus() *IssuePlanningStatus {
return status
}
-// issueStatusNotAppliedError reports an issue that was created without its requested
-// status. It is kept distinct from a failed creation so agents don't retry and duplicate the issue.
-type issueStatusNotAppliedError struct {
- URL string
- Status string
-}
-
-func (e issueStatusNotAppliedError) Error() string {
- return fmt.Sprintf("issue %s was created, but requested status %q was not applied", e.URL, e.Status)
-}
-
-func createIssueErrorResult(ctx context.Context, resp *github.Response, err error) *mcp.CallToolResult {
- if notApplied, ok := errors.AsType[issueStatusNotAppliedError](err); ok {
- return utils.NewToolResultError(notApplied.Error())
- }
- return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to create issue", resp, err)
-}
-
func enumValues(values []string) []any {
enum := make([]any, len(values))
for i, value := range values {
@@ -255,8 +237,13 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to update issue", resp, err), nil, nil
}
- output := &IssueStatusUpdateOutput{ID: fmt.Sprintf("%d", issue.GetID()), URL: issue.GetHTMLURL(), Status: issue.planningStatus()}
- return MarshalledTextResult(output), output, nil
+ status := issue.planningStatus()
+ if status == nil || status.Name != args.Status {
+ return utils.NewToolResultError(fmt.Sprintf("requested status %q was not applied; issue statuses may be unavailable in this repository", args.Status)), nil, nil
+ }
+ output := &IssueStatusUpdateOutput{ID: fmt.Sprintf("%d", issue.GetID()), URL: issue.GetHTMLURL(), Status: status}
+ result := attachRepoVisibilityIFCLabel(ctx, deps, client, args.Owner, args.Repo, MarshalledTextResult(output), ifc.LabelRepoMetadata)
+ return result, output, nil
},
granularIssueInputNormalizer(normalizeIssueStatusArguments),
)
@@ -285,15 +272,9 @@ func createRESTIssue(ctx context.Context, client *github.Client, owner, repo str
if err != nil {
return nil, nil, err
}
- var issue issueWithStatus
+ var issue github.Issue
resp, err := client.Do(req, &issue)
- if err != nil {
- return nil, resp, err
- }
- if applied := issue.planningStatus(); applied == nil || applied.Name != status {
- return nil, resp, issueStatusNotAppliedError{URL: issue.GetHTMLURL(), Status: status}
- }
- return &issue.Issue, resp, nil
+ return &issue, resp, err
}
func resolveIssueStatusID(ctx context.Context, client *githubv4.Client, owner, repo, status string) (githubv4.ID, error) {
diff --git a/pkg/github/issues.go b/pkg/github/issues.go
index 0ecb549f3d..10962bca7c 100644
--- a/pkg/github/issues.go
+++ b/pkg/github/issues.go
@@ -3072,18 +3072,6 @@ type createIssueMutation struct {
} `graphql:"createIssue(input: $input)"`
}
-type createIssueWithStatusMutation struct {
- CreateIssue struct {
- Issue struct {
- FullDatabaseID githubv4.String `graphql:"fullDatabaseId"`
- URL githubv4.URI
- Status *struct {
- Name string
- }
- }
- } `graphql:"createIssue(input: $input)"`
-}
-
type createIssueParentMetadataQuery struct {
ChildRepository struct {
ID githubv4.ID
@@ -3182,32 +3170,21 @@ func createIssueWithParent(ctx context.Context, client *github.Client, gqlClient
input.IssueTypeID = &issueTypeID
}
- var mutation createIssueMutation
- appliedStatus := ""
if status != "" {
statusID, err := resolveIssueStatusID(ctx, gqlClient, owner, repo, status)
if err != nil {
return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to resolve planning status", err), nil, nil
}
input.StatusID = &statusID
- var statusMutation createIssueWithStatusMutation
- if err := gqlClient.Mutate(ctx, &statusMutation, input, nil); err != nil {
- return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to create issue", err), nil, nil
- }
- created := statusMutation.CreateIssue.Issue
- mutation.CreateIssue.Issue.FullDatabaseID, mutation.CreateIssue.Issue.URL = created.FullDatabaseID, created.URL
- if created.Status != nil {
- appliedStatus = created.Status.Name
- }
- } else if err := gqlClient.Mutate(ctx, &mutation, input, nil); err != nil {
+ }
+
+ var mutation createIssueMutation
+ if err := gqlClient.Mutate(ctx, &mutation, input, nil); err != nil {
return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to create issue", err), nil, nil
}
if mutation.CreateIssue.Issue.FullDatabaseID == "" || mutation.CreateIssue.Issue.URL.URL == nil {
return utils.NewToolResultError("failed to create issue: response did not include the created issue"), nil, nil
}
- if appliedStatus != status {
- return utils.NewToolResultError(issueStatusNotAppliedError{URL: mutation.CreateIssue.Issue.URL.String(), Status: status}.Error()), nil, nil
- }
response := MinimalResponse{
ID: string(mutation.CreateIssue.Issue.FullDatabaseID),
@@ -3402,7 +3379,7 @@ func createIssue(ctx context.Context, client *github.Client, owner string, repo
defer func() { _ = resp.Body.Close() }()
}
if err != nil {
- return createIssueErrorResult(ctx, resp, err), nil, nil
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to create issue", resp, err), nil, nil
}
if resp.StatusCode != http.StatusCreated {
diff --git a/pkg/github/issues_granular.go b/pkg/github/issues_granular.go
index cf26ca0caf..5cf878b3bf 100644
--- a/pkg/github/issues_granular.go
+++ b/pkg/github/issues_granular.go
@@ -178,7 +178,7 @@ func GranularCreateIssue(t translations.TranslationHelperFunc) inventory.ServerT
defer func() { _ = resp.Body.Close() }()
}
if err != nil {
- return createIssueErrorResult(ctx, resp, err), nil, nil
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to create issue", resp, err), nil, nil
}
return granularIssueMinimalResult(&MinimalResponse{
diff --git a/pkg/github/typed_consolidated_issue_outputs_test.go b/pkg/github/typed_consolidated_issue_outputs_test.go
index 779e6cfbf8..e77367b2b0 100644
--- a/pkg/github/typed_consolidated_issue_outputs_test.go
+++ b/pkg/github/typed_consolidated_issue_outputs_test.go
@@ -13,6 +13,7 @@ import (
"github.com/github/github-mcp-server/v2/internal/githubv4mock"
"github.com/github/github-mcp-server/v2/internal/toolsnaps"
ghcontext "github.com/github/github-mcp-server/v2/pkg/context"
+ "github.com/github/github-mcp-server/v2/pkg/ifc"
"github.com/github/github-mcp-server/v2/pkg/inventory"
"github.com/github/github-mcp-server/v2/pkg/sanitize"
"github.com/github/github-mcp-server/v2/pkg/translations"
@@ -126,6 +127,46 @@ func TestUpdateIssueStatusWireContract(t *testing.T) {
}
}
+func TestUpdateIssueStatusIFCLabel(t *testing.T) {
+ for _, protocol := range []string{inventory.ProtocolVersionMultiRoundTrip, "2025-11-25"} {
+ for _, private := range []bool{false, true} {
+ for _, enabled := range []bool{false, true} {
+ t.Run(fmt.Sprintf("%s/private=%t/enabled=%t", protocol, private, enabled), func(t *testing.T) {
+ lookups := 0
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "application/json")
+ if r.Method == http.MethodGet {
+ lookups++
+ assert.Equal(t, "/repos/owner/repo", r.URL.Path)
+ _, _ = fmt.Fprintf(w, `{"private":%t}`, private)
+ return
+ }
+ assert.Equal(t, http.MethodPatch, r.Method)
+ _, _ = w.Write([]byte(`{"id":123,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":4,"name":"Todo","category":"planned"}}`))
+ })}}
+ deps := BaseDeps{Client: mustNewGHClient(t, rest)}
+ if enabled {
+ deps.featureChecker = featureCheckerFor(FeatureFlagIFCLabels)
+ }
+ session, _ := issueStatusSession(t, deps, protocol)
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: map[string]any{
+ "owner": "owner", "repo": "repo", "issue_number": 42, "status": "Todo",
+ }})
+ require.NoError(t, err)
+ require.False(t, result.IsError)
+ if enabled {
+ assert.JSONEq(t, mustMarshalJSON(t, ifc.LabelRepoMetadata(private)), mustMarshalJSON(t, result.Meta["ifc"]))
+ assert.Equal(t, 1, lookups)
+ } else {
+ assert.NotContains(t, result.Meta, "ifc")
+ assert.Zero(t, lookups)
+ }
+ })
+ }
+ }
+ }
+}
+
func TestIssuePlanningStatusRead(t *testing.T) {
const inProgress = `{"id":4,"name":"In progress","category":"started"}`
unrecognized := []string{`{"id":9,"name":"Blocked","category":"started"}`, `{"id":9,"name":"Todo","category":"custom"}`, `"Todo"`}
@@ -180,78 +221,79 @@ func TestIssuePlanningStatusRead(t *testing.T) {
}
func TestIssuePlanningStatusCreation(t *testing.T) {
- for _, tc := range []struct{ granular, parent, ignored bool }{
- {false, false, false}, {false, true, false},
- {true, false, false}, {true, true, false},
- {false, true, true},
- } {
- granular, parent := tc.granular, tc.parent
- t.Run(fmt.Sprintf("granular=%t/parent=%t/ignored=%t", granular, parent, tc.ignored), func(t *testing.T) {
- calls := 0
- rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- calls++
- assert.Equal(t, http.MethodPost, r.Method)
- assert.Equal(t, "/repos/owner/repo/issues", r.URL.Path)
- var body map[string]any
- require.NoError(t, json.NewDecoder(r.Body).Decode(&body))
- assert.Equal(t, "In review", body["status"])
- assert.Equal(t, "Subject", body["title"])
- assert.Equal(t, "Body", body["body"])
- w.Header().Set("Content-Type", "application/json")
- w.WriteHeader(http.StatusCreated)
- _, _ = w.Write([]byte(`{"id":123,"number":42,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":5,"name":"In review","category":"started"}}`))
- })}}
- gql := defaultGQLClient
- if parent {
- parentID, statusID := githubv4.ID("I_parent"), githubv4.ID("IS_review")
- statusName := "In review"
- if tc.ignored {
- statusName = "Backlog"
+ for _, protocol := range []string{inventory.ProtocolVersionMultiRoundTrip, "2025-11-25"} {
+ for _, tc := range []struct{ granular, parent, ignored bool }{
+ {false, false, false}, {false, true, false},
+ {true, false, false}, {true, true, false},
+ {false, false, true}, {true, false, true},
+ } {
+ granular, parent := tc.granular, tc.parent
+ t.Run(fmt.Sprintf("%s/granular=%t/parent=%t/ignored=%t", protocol, granular, parent, tc.ignored), func(t *testing.T) {
+ calls := 0
+ rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ calls++
+ assert.Equal(t, http.MethodPost, r.Method)
+ assert.Equal(t, "/repos/owner/repo/issues", r.URL.Path)
+ var body map[string]any
+ require.NoError(t, json.NewDecoder(r.Body).Decode(&body))
+ assert.Equal(t, "In review", body["status"])
+ assert.Equal(t, "Subject", body["title"])
+ assert.Equal(t, "Body", body["body"])
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusCreated)
+ statusName, category := "In review", "started"
+ if tc.ignored {
+ statusName, category = "Backlog", "backlog"
+ }
+ _, _ = fmt.Fprintf(w, `{"id":123,"number":42,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":5,"name":%q,"category":%q}}`, statusName, category)
+ })}}
+ gql := defaultGQLClient
+ if parent {
+ parentID, statusID := githubv4.ID("I_parent"), githubv4.ID("IS_review")
+ gql = githubv4.NewClient(githubv4mock.NewMockedHTTPClient(
+ createIssueParentMatcher(3, "owner", "repo", "R_repo", "I_parent"),
+ githubv4mock.NewQueryMatcher(
+ "query($owner:String!$repo:String!){repository(owner: $owner, name: $repo){planningStatuses(first: 7){nodes{id,name}}}}",
+ map[string]any{"owner": "owner", "repo": "repo"},
+ githubv4mock.DataResponse(map[string]any{"repository": map[string]any{"planningStatuses": map[string]any{"nodes": []any{map[string]any{"id": "IS_review", "name": "In review"}}}}}),
+ ),
+ githubv4mock.NewMutationMatcher(createIssueMutation{}, CreateIssueInput{
+ RepositoryID: githubv4.ID("R_repo"), Title: githubv4.String("Subject"), Body: githubv4.NewString("Body"),
+ ParentIssueID: &parentID, StatusID: &statusID,
+ }, nil, githubv4mock.DataResponse(map[string]any{"createIssue": map[string]any{"issue": map[string]any{
+ "fullDatabaseId": "123", "url": "https://github.com/owner/repo/issues/42",
+ }}})),
+ ))
}
- gql = githubv4.NewClient(githubv4mock.NewMockedHTTPClient(
- createIssueParentMatcher(3, "owner", "repo", "R_repo", "I_parent"),
- githubv4mock.NewQueryMatcher(
- "query($owner:String!$repo:String!){repository(owner: $owner, name: $repo){planningStatuses(first: 7){nodes{id,name}}}}",
- map[string]any{"owner": "owner", "repo": "repo"},
- githubv4mock.DataResponse(map[string]any{"repository": map[string]any{"planningStatuses": map[string]any{"nodes": []any{map[string]any{"id": "IS_review", "name": "In review"}}}}}),
- ),
- githubv4mock.NewMutationMatcher(createIssueWithStatusMutation{}, CreateIssueInput{
- RepositoryID: githubv4.ID("R_repo"), Title: githubv4.String("Subject"), Body: githubv4.NewString("Body"),
- ParentIssueID: &parentID, StatusID: &statusID,
- }, nil, githubv4mock.DataResponse(map[string]any{"createIssue": map[string]any{"issue": map[string]any{
- "fullDatabaseId": "123", "url": "https://github.com/owner/repo/issues/42", "status": map[string]any{"name": statusName},
- }}})),
- ))
- }
- deps := BaseDeps{Client: mustNewGHClient(t, rest), GQLClient: gql}
- var flags []inventory.FeatureFlag
- name := "issue_write"
- args := map[string]any{"owner": "owner", "repo": "repo", "title": "Subject", "body": "Body", "status": "in review"}
- if granular {
- flags = append(flags, inventory.FeatureFlag(FeatureFlagIssuesGranular))
- name = "create_issue"
- } else {
- args["method"] = "create"
- }
- if parent {
- args["parent_issue_number"] = 3
- }
- session, _ := issueStatusSession(t, deps, inventory.ProtocolVersionMultiRoundTrip, flags...)
- result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: name, Arguments: args})
- require.NoError(t, err)
- if tc.ignored {
- require.True(t, result.IsError)
- assert.Equal(t, `issue https://github.com/owner/repo/issues/42 was created, but requested status "In review" was not applied`, getTextResult(t, result).Text)
- } else {
+ deps := BaseDeps{Client: mustNewGHClient(t, rest), GQLClient: gql}
+ var flags []inventory.FeatureFlag
+ name := "issue_write"
+ args := map[string]any{"owner": "owner", "repo": "repo", "title": "Subject", "body": "Body", "status": "in review"}
+ if granular {
+ flags = append(flags, inventory.FeatureFlag(FeatureFlagIssuesGranular))
+ name = "create_issue"
+ } else {
+ args["method"] = "create"
+ }
+ if parent {
+ args["parent_issue_number"] = 3
+ }
+ session, _ := issueStatusSession(t, deps, protocol, flags...)
+ result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: name, Arguments: args})
+ require.NoError(t, err)
require.False(t, result.IsError, "%s", getTextResult(t, result).Text)
- assert.Contains(t, getTextResult(t, result).Text, `"id":"123"`)
- }
- if parent {
- assert.Zero(t, calls, "parent and status must be created atomically, without a REST write")
- } else {
- assert.Equal(t, 1, calls)
- }
- })
+ if protocol == inventory.ProtocolVersionMultiRoundTrip && !granular {
+ assert.JSONEq(t, `{"method":"create","issue":{"id":"123","url":"https://github.com/owner/repo/issues/42"}}`, getTextResult(t, result).Text)
+ } else {
+ assert.JSONEq(t, `{"id":"123","url":"https://github.com/owner/repo/issues/42"}`, getTextResult(t, result).Text)
+ }
+ if parent {
+ assert.Zero(t, calls, "parent and status must be created atomically, without a REST write")
+ } else {
+ assert.Equal(t, 1, calls)
+ }
+ })
+ }
}
}
diff --git a/pkg/skills/catalog/skills/issue-authoring/SKILL.md b/pkg/skills/catalog/skills/issue-authoring/SKILL.md
index d70056f4ad..51ec2324b7 100644
--- a/pkg/skills/catalog/skills/issue-authoring/SKILL.md
+++ b/pkg/skills/catalog/skills/issue-authoring/SKILL.md
@@ -95,6 +95,8 @@ do it.
labels is a separate decision that affects the whole repository.
- **The account cannot write** — the issue cannot be filed from here. Give the complete
text so it can be filed by hand rather than losing it.
+- **A write only partially succeeds** — report what was saved and what failed.
+ Make any corrections on the existing issue rather than repeating creation.
- **The report is not reproducible and not specific** — say what is missing rather than
filing something that will be closed for lack of detail. An unfiled question is
recoverable; a vague issue occupies someone's attention and then dies.
From 2fd4a394705cd68fe6c8f2dccc769fd74cc63ce3 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Wed, 25 Nov 2026 15:57:34 +0000
Subject: [PATCH 04/11] updates
---
pkg/github/__toolsnaps__/update_issue_status.snap | 2 +-
pkg/github/issue_status.go | 5 +++--
pkg/github/issues.go | 5 ++---
pkg/github/typed_consolidated_issue_outputs_test.go | 2 +-
pkg/skills/catalog/skills/issue-authoring/SKILL.md | 6 +++---
pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md | 5 ++---
6 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/pkg/github/__toolsnaps__/update_issue_status.snap b/pkg/github/__toolsnaps__/update_issue_status.snap
index 03c98892d0..d835bb4295 100644
--- a/pkg/github/__toolsnaps__/update_issue_status.snap
+++ b/pkg/github/__toolsnaps__/update_issue_status.snap
@@ -1,6 +1,6 @@
{
"annotations": {
- "destructiveHint": true,
+ "destructiveHint": false,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false,
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index 62f0881a0f..3fa5d786a9 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -199,7 +199,8 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_UPDATE_ISSUE_STATUS_USER_TITLE", "Update Issue Status"),
ReadOnlyHint: false,
- DestructiveHint: new(true), OpenWorldHint: new(true),
+ DestructiveHint: new(false),
+ OpenWorldHint: new(true),
},
},
scopes.RequireAll(scopes.Repo),
@@ -285,7 +286,7 @@ func resolveIssueStatusID(ctx context.Context, client *githubv4.Client, owner, r
ID githubv4.ID
Name string
}
- } `graphql:"planningStatuses(first: 7)"`
+ } `graphql:"planningStatuses(first: 10)"`
} `graphql:"repository(owner: $owner, name: $repo)"`
}
if err := client.Query(ctx, &query, map[string]any{"owner": githubv4.String(owner), "repo": githubv4.String(repo)}); err != nil {
diff --git a/pkg/github/issues.go b/pkg/github/issues.go
index 10962bca7c..7d8aa3ca82 100644
--- a/pkg/github/issues.go
+++ b/pkg/github/issues.go
@@ -1994,8 +1994,7 @@ func SearchIssues(t translations.TranslationHelperFunc, opts ...ToolOption) inve
toolDescription = searchIssuesLexicalDescription
queryDescription = searchIssuesLexicalQueryDescription
}
- toolDescription = t("TOOL_SEARCH_ISSUES_DESCRIPTION", toolDescription)
- toolDescription += " " + t("TOOL_SEARCH_ISSUES_STATUS_DESCRIPTION", searchIssuesStatusDescription())
+ toolDescription += " " + searchIssuesStatusDescription()
schema := &jsonschema.Schema{
Type: "object",
@@ -2047,7 +2046,7 @@ func SearchIssues(t translations.TranslationHelperFunc, opts ...ToolOption) inve
ToolsetMetadataIssues,
mcp.Tool{
Name: "search_issues",
- Description: toolDescription,
+ Description: t("TOOL_SEARCH_ISSUES_DESCRIPTION", toolDescription),
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_SEARCH_ISSUES_USER_TITLE", "Search issues"),
ReadOnlyHint: true,
diff --git a/pkg/github/typed_consolidated_issue_outputs_test.go b/pkg/github/typed_consolidated_issue_outputs_test.go
index e77367b2b0..ad0af30015 100644
--- a/pkg/github/typed_consolidated_issue_outputs_test.go
+++ b/pkg/github/typed_consolidated_issue_outputs_test.go
@@ -253,7 +253,7 @@ func TestIssuePlanningStatusCreation(t *testing.T) {
gql = githubv4.NewClient(githubv4mock.NewMockedHTTPClient(
createIssueParentMatcher(3, "owner", "repo", "R_repo", "I_parent"),
githubv4mock.NewQueryMatcher(
- "query($owner:String!$repo:String!){repository(owner: $owner, name: $repo){planningStatuses(first: 7){nodes{id,name}}}}",
+ "query($owner:String!$repo:String!){repository(owner: $owner, name: $repo){planningStatuses(first: 10){nodes{id,name}}}}",
map[string]any{"owner": "owner", "repo": "repo"},
githubv4mock.DataResponse(map[string]any{"repository": map[string]any{"planningStatuses": map[string]any{"nodes": []any{map[string]any{"id": "IS_review", "name": "In review"}}}}}),
),
diff --git a/pkg/skills/catalog/skills/issue-authoring/SKILL.md b/pkg/skills/catalog/skills/issue-authoring/SKILL.md
index 51ec2324b7..b008d377f7 100644
--- a/pkg/skills/catalog/skills/issue-authoring/SKILL.md
+++ b/pkg/skills/catalog/skills/issue-authoring/SKILL.md
@@ -62,9 +62,9 @@ do it.
- `labels` — must already exist on the repository. This tool applies labels; it does not
create them.
- `assignees` — assigning someone is a claim on their time. Only from an instruction.
-- `status` — when advertised by `issue_write` or `create_issue`, creation accepts
- Backlog, Todo, In progress or In review. The parent and initial status can be set
- atomically. Closed statuses cannot be assigned at creation.
+- `status` — on `issue_write` or `create_issue`, creation accepts Backlog, Todo,
+ In progress or In review. The parent and initial status can be set atomically.
+ Closed statuses cannot be assigned at creation.
- `sub_issue_id` on `sub_issue_write` — the internal identifier, which is not the issue
number. Read it from the issue rather than assuming the number will work.
diff --git a/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md b/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
index 3f8a6cc67b..a80fa16e96 100644
--- a/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
+++ b/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
@@ -62,9 +62,8 @@ important one in the backlog; judge on content, not on dates alone.
- `state_reason` — `completed`, `not_planned`, or `duplicate`. Closing without one
loses the only durable signal about why.
- `duplicate_of` — required when `state_reason` is `duplicate`.
-- Planning statuses are available only when advertised. `issue_read` with
- `method: get` returns `status` as an ID, name and category, or null.
- Filter `search_issues` with `status:"In progress"` or another fixed status.
+- `issue_read` with `method: get` returns `status` as an ID, name and category,
+ or null. Filter `search_issues` with `status:"In progress"` or another fixed status.
Use `update_issue_status` for Backlog, Todo, In progress, In review, Done,
Not planned or Duplicate. Done, Not planned and Duplicate close the issue;
the others keep it open or reopen it. Duplicate requires `duplicate_of`,
From d1d40478389ec4c76e1757220f79b149e1f80cc8 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Thu, 26 Nov 2026 09:47:05 +0000
Subject: [PATCH 05/11] set destructive hint to true
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---
pkg/github/issue_status.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index 3fa5d786a9..5cfdcc5ef5 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -199,7 +199,7 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
Annotations: &mcp.ToolAnnotations{
Title: t("TOOL_UPDATE_ISSUE_STATUS_USER_TITLE", "Update Issue Status"),
ReadOnlyHint: false,
- DestructiveHint: new(false),
+ DestructiveHint: new(true),
OpenWorldHint: new(true),
},
},
From c0e2333f9c9140d9ec6a65901bc9c7bff81588a6 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Thu, 26 Nov 2026 11:23:20 +0000
Subject: [PATCH 06/11] update stale snapshot
---
pkg/github/__toolsnaps__/update_issue_status.snap | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pkg/github/__toolsnaps__/update_issue_status.snap b/pkg/github/__toolsnaps__/update_issue_status.snap
index d835bb4295..03c98892d0 100644
--- a/pkg/github/__toolsnaps__/update_issue_status.snap
+++ b/pkg/github/__toolsnaps__/update_issue_status.snap
@@ -1,6 +1,6 @@
{
"annotations": {
- "destructiveHint": false,
+ "destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false,
From 61f569af8f111f17e77b1d9e1cbe3804fc2fec9c Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Thu, 26 Nov 2026 11:44:47 +0000
Subject: [PATCH 07/11] Apply batched suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
---
pkg/github/issue_status.go | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index 5cfdcc5ef5..66e6541cb2 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -138,6 +138,11 @@ func normalizeIssueStatusArguments(raw json.RawMessage) (json.RawMessage, error)
if err := json.Unmarshal(raw, &args); err != nil {
return nil, err
}
+ confirmed, ok := args["confirm"].(bool)
+ if !ok || !confirmed {
+ return nil, fmt.Errorf("confirm must be true to update an issue's status")
+ }
+ delete(args, "confirm")
for _, field := range []string{"owner", "repo", "status"} {
if _, err := RequiredParam[string](args, field); err != nil {
return nil, err
@@ -192,8 +197,9 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
"issue_number": {Type: "number", Minimum: new(1.0), Description: "The issue number to update"},
"status": {Type: "string", Enum: enumValues(issueStatusNames), Description: "The planning status to assign."},
"duplicate_of": {Type: "number", Minimum: new(1.0), Description: "The canonical issue number. Required only for Duplicate."},
+ "confirm": {Type: "boolean", Description: "Set to true to confirm this issue status change."},
},
- Required: []string{"owner", "repo", "issue_number", "status"},
+ Required: []string{"owner", "repo", "issue_number", "status", "confirm"},
},
OutputSchema: issueStatusUpdateOutputSchema(),
Annotations: &mcp.ToolAnnotations{
From f7929d6eff0c0dd314a19e50684899b077a97981 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Thu, 26 Nov 2026 14:30:18 +0000
Subject: [PATCH 08/11] fix security comment
---
README.md | 2 +
.../__toolsnaps__/update_issue_status.snap | 6 ++-
pkg/github/granular_tools_test.go | 37 ++++++++++++-------
pkg/github/issue_status.go | 24 +++++++++---
.../skills/issue-backlog-triage/SKILL.md | 3 +-
5 files changed, 52 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index a0b61c8d76..67f4180ca9 100644
--- a/README.md
+++ b/README.md
@@ -623,6 +623,7 @@ The `issues` toolset supports planning statuses. `issue_read` returns the
current status, `search_issues` documents the `status:` qualifier, and issue
creation accepts Backlog, Todo, In progress, or In review. The
`update_issue_status` tool also accepts Done, Not planned, and Duplicate;
+these closing statuses require `confirm_close: true` after the user confirms.
Duplicate requires the canonical issue number in `duplicate_of`. The
`issue_write` MCP App creation form can set an initial status or use the
default, Backlog.
@@ -1163,6 +1164,7 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
- **update_issue_status** - Update Issue Status
- **OAuth Challenge Scopes**: `repo`
+ - `confirm_close`: Must be true for Done, Not planned or Duplicate. Set only after the user confirms closing the issue. (boolean, optional)
- `duplicate_of`: The canonical issue number. Required only for Duplicate. (number, optional)
- `issue_number`: The issue number to update (number, required)
- `owner`: Repository owner (username or organization) (string, required)
diff --git a/pkg/github/__toolsnaps__/update_issue_status.snap b/pkg/github/__toolsnaps__/update_issue_status.snap
index 03c98892d0..af13cd10c7 100644
--- a/pkg/github/__toolsnaps__/update_issue_status.snap
+++ b/pkg/github/__toolsnaps__/update_issue_status.snap
@@ -6,7 +6,7 @@
"readOnlyHint": false,
"title": "Update Issue Status"
},
- "description": "Update an issue's planning status. Done, Not planned and Duplicate close the issue; the other statuses keep it open or reopen it. Duplicate requires duplicate_of, the canonical issue number in the same repository. A status cannot be removed.",
+ "description": "Update an issue's planning status. Done, Not planned and Duplicate close the issue; the other statuses keep it open or reopen it. Closing statuses require confirm_close: true, set only after the user confirms closing the issue. Duplicate requires duplicate_of, the canonical issue number in the same repository. A status cannot be removed.",
"icons": [
{
"mimeType": "image/png",
@@ -21,6 +21,10 @@
],
"inputSchema": {
"properties": {
+ "confirm_close": {
+ "description": "Must be true for Done, Not planned or Duplicate. Set only after the user confirms closing the issue.",
+ "type": "boolean"
+ },
"duplicate_of": {
"description": "The canonical issue number. Required only for Duplicate.",
"minimum": 1,
diff --git a/pkg/github/granular_tools_test.go b/pkg/github/granular_tools_test.go
index 03a8e196e9..edf2b53939 100644
--- a/pkg/github/granular_tools_test.go
+++ b/pkg/github/granular_tools_test.go
@@ -6,6 +6,7 @@ import (
"fmt"
"maps"
"net/http"
+ "slices"
"strings"
"testing"
@@ -1184,19 +1185,23 @@ func TestUpdateIssueStatus(t *testing.T) {
duplicateCode int
updateCode int
wantError string
+ unconfirmed bool
}{
- {"Backlog", "backlog", 0, http.StatusOK, ""},
- {"Todo", "planned", 0, http.StatusOK, ""},
- {"In progress", "started", 0, http.StatusOK, ""},
- {"In review", "started", 0, http.StatusOK, ""},
- {"Done", "completed", 0, http.StatusOK, ""},
- {"Not planned", "not_planned", 0, http.StatusOK, ""},
- {"Duplicate", "duplicate", http.StatusOK, http.StatusOK, ""},
- {"Duplicate", "duplicate", http.StatusNotFound, 0, "failed to get duplicate issue"},
- {"Todo", "planned", 0, http.StatusForbidden, "failed to update issue"},
+ {"Backlog", "backlog", 0, http.StatusOK, "", false},
+ {"Todo", "planned", 0, http.StatusOK, "", false},
+ {"In progress", "started", 0, http.StatusOK, "", false},
+ {"In review", "started", 0, http.StatusOK, "", false},
+ {"Done", "completed", 0, http.StatusOK, "", false},
+ {"Not planned", "not_planned", 0, http.StatusOK, "", false},
+ {"Duplicate", "duplicate", http.StatusOK, http.StatusOK, "", false},
+ {"Duplicate", "duplicate", http.StatusNotFound, 0, "failed to get duplicate issue", false},
+ {"Todo", "planned", 0, http.StatusForbidden, "failed to update issue", false},
+ {"Done", "completed", 0, 0, "confirm_close must be true", true},
+ {"Not planned", "not_planned", 0, 0, "confirm_close must be true", true},
+ {"Duplicate", "duplicate", 0, 0, "confirm_close must be true", true},
}
for _, tc := range cases {
- t.Run(fmt.Sprintf("%s/%d/%d", tc.status, tc.duplicateCode, tc.updateCode), func(t *testing.T) {
+ t.Run(fmt.Sprintf("%s/%d/%d/unconfirmed=%t", tc.status, tc.duplicateCode, tc.updateCode, tc.unconfirmed), func(t *testing.T) {
gets, patches := 0, 0
rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
@@ -1225,6 +1230,9 @@ func TestUpdateIssueStatus(t *testing.T) {
if tc.status == "Duplicate" {
args["duplicate_of"] = "7"
}
+ if slices.Contains(issueClosingStatusNames, tc.status) && !tc.unconfirmed {
+ args["confirm_close"] = true
+ }
result, err := session.CallTool(context.Background(), &mcp.CallToolParams{Name: "update_issue_status", Arguments: args})
require.NoError(t, err)
if tc.wantError != "" {
@@ -1235,13 +1243,13 @@ func TestUpdateIssueStatus(t *testing.T) {
assert.JSONEq(t, fmt.Sprintf(`{"id":"123","url":"https://github.com/owner/repo/issues/42","status":{"id":4,"name":%q,"category":%q}}`, tc.status, tc.category), getTextResult(t, result).Text)
assert.JSONEq(t, mustMarshalJSON(t, result.StructuredContent), getTextResult(t, result).Text)
}
- if tc.status == "Duplicate" {
+ if tc.status == "Duplicate" && !tc.unconfirmed {
assert.Equal(t, 1, gets)
} else {
assert.Zero(t, gets)
}
if tc.updateCode == 0 {
- assert.Zero(t, patches, "failed duplicate lookup must prevent the mutation")
+ assert.Zero(t, patches, "failed duplicate lookup or missing confirmation must prevent the mutation")
} else {
assert.Equal(t, 1, patches)
}
@@ -1262,6 +1270,9 @@ func TestIssuePlanningStatusInvalidInput(t *testing.T) {
{UpdateIssueStatus(translate), map[string]any{"status": "unknown"}, "status must be one of"},
{UpdateIssueStatus(translate), map[string]any{"status": nil}, "status"},
{UpdateIssueStatus(translate), map[string]any{"status": "Todo", "issue_number": -1}, "issue_number must be positive"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Done"}, "confirm_close must be true"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Not planned", "confirm_close": false}, "confirm_close must be true"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Done", "confirm_close": "true"}, "confirm_close"},
{GranularCreateIssue(translate), map[string]any{"status": "Done"}, "status must be one of: Backlog, Todo, In progress, In review"},
{IssueWrite(translate), map[string]any{"method": "update", "status": "Todo"}, "status is only supported with the create method"},
{IssueWrite(translate), map[string]any{"status": "Todo", "state": "closed"}, "status cannot be combined with state"},
@@ -1271,7 +1282,7 @@ func TestIssuePlanningStatusInvalidInput(t *testing.T) {
args := map[string]any{"owner": "owner", "repo": "repo", "issue_number": 42, "title": "Subject", "method": "create"}
maps.Copy(args, tc.args)
req := createMCPRequest(args)
- result, err := tc.tool.Handler(BaseDeps{})(context.Background(), &req)
+ result, err := tc.tool.Handler(BaseDeps{})(ContextWithDeps(context.Background(), BaseDeps{}), &req)
require.NoError(t, err)
require.True(t, result.IsError)
assert.Contains(t, getTextResult(t, result).Text, tc.want)
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index 5cfdcc5ef5..b24fbfe772 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -25,6 +25,7 @@ var (
// Issues can only be created with an open status.
issueCreationStatusNames = issueStatusNames[:4:4]
issueStatusCategories = []string{"backlog", "planned", "started", "completed", "not_planned", "duplicate"}
+ issueClosingStatusNames = issueStatusNames[4:]
)
type IssuePlanningStatus struct {
@@ -68,11 +69,12 @@ type IssueStatusUpdateOutput struct {
}
type IssueStatusInput struct {
- Owner string `json:"owner"`
- Repo string `json:"repo"`
- IssueNumber int `json:"issue_number"`
- Status string `json:"status"`
- DuplicateOf int `json:"duplicate_of,omitempty"`
+ Owner string `json:"owner"`
+ Repo string `json:"repo"`
+ IssueNumber int `json:"issue_number"`
+ Status string `json:"status"`
+ DuplicateOf int `json:"duplicate_of,omitempty"`
+ ConfirmClose bool `json:"confirm_close,omitempty"`
}
func issuePlanningStatusSchema() *jsonschema.Schema {
@@ -171,6 +173,9 @@ func normalizeIssueStatusArguments(raw json.RawMessage) (json.RawMessage, error)
if status == "Duplicate" && duplicate == 0 {
return nil, fmt.Errorf("duplicate_of is required when status is 'Duplicate'")
}
+ if _, err := OptionalParam[bool](args, "confirm_close"); err != nil {
+ return nil, err
+ }
args["issue_number"], args["status"] = number, status
return json.Marshal(args)
}
@@ -183,6 +188,7 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
Name: "update_issue_status",
Description: t("TOOL_UPDATE_ISSUE_STATUS_DESCRIPTION", "Update an issue's planning status. "+
"Done, Not planned and Duplicate close the issue; the other statuses keep it open or reopen it. "+
+ "Closing statuses require confirm_close: true, set only after the user confirms closing the issue. "+
"Duplicate requires duplicate_of, the canonical issue number in the same repository. A status cannot be removed."),
InputSchema: &jsonschema.Schema{
Type: "object",
@@ -192,6 +198,10 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
"issue_number": {Type: "number", Minimum: new(1.0), Description: "The issue number to update"},
"status": {Type: "string", Enum: enumValues(issueStatusNames), Description: "The planning status to assign."},
"duplicate_of": {Type: "number", Minimum: new(1.0), Description: "The canonical issue number. Required only for Duplicate."},
+ "confirm_close": {
+ Type: "boolean",
+ Description: "Must be true for Done, Not planned or Duplicate. Set only after the user confirms closing the issue.",
+ },
},
Required: []string{"owner", "repo", "issue_number", "status"},
},
@@ -205,6 +215,10 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
},
scopes.RequireAll(scopes.Repo),
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args IssueStatusInput) (*mcp.CallToolResult, *IssueStatusUpdateOutput, error) {
+ // This is a caller-supplied confirmation policy, not proof that a trusted UI prompted the user.
+ if slices.Contains(issueClosingStatusNames, args.Status) && !args.ConfirmClose {
+ return utils.NewToolResultError("confirm_close must be true to use a status that closes the issue"), nil, nil
+ }
client, err := deps.GetClient(ctx)
if err != nil {
return utils.NewToolResultErrorFromErr("failed to get GitHub client", err), nil, nil
diff --git a/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md b/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
index a80fa16e96..18f7e10e7d 100644
--- a/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
+++ b/pkg/skills/catalog/skills/issue-backlog-triage/SKILL.md
@@ -65,7 +65,8 @@ important one in the backlog; judge on content, not on dates alone.
- `issue_read` with `method: get` returns `status` as an ID, name and category,
or null. Filter `search_issues` with `status:"In progress"` or another fixed status.
Use `update_issue_status` for Backlog, Todo, In progress, In review, Done,
- Not planned or Duplicate. Done, Not planned and Duplicate close the issue;
+ Not planned or Duplicate. Done, Not planned and Duplicate close the issue
+ and require `confirm_close: true`, set only after the user confirms closing;
the others keep it open or reopen it. Duplicate requires `duplicate_of`,
the canonical issue number in the same repository. Status cannot be removed.
- `type` — only valid if `list_issue_types` returned it. Guessing a type fails the
From 43aac2179ea8a8eb3fb772aac3aa51b2543820af Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 27 Nov 2026 09:54:44 +0000
Subject: [PATCH 09/11] chore: regenerate license files
Auto-generated by license-check workflow
---
third-party-licenses.darwin.md | 48 ++++++++++++++++++++++++++++++---
third-party-licenses.linux.md | 2 +-
third-party-licenses.windows.md | 2 +-
3 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/third-party-licenses.darwin.md b/third-party-licenses.darwin.md
index 002d5a25bf..316e29ea6e 100644
--- a/third-party-licenses.darwin.md
+++ b/third-party-licenses.darwin.md
@@ -4,13 +4,55 @@ The following open source dependencies are used to build the [github/github-mcp-
## Table of Contents
-- [amd64, arm64](#amd64-arm64)
+- [arm64](#arm64)
+- [amd64](#amd64)
---
-## amd64, arm64
+## arm64
-The following packages are included for the amd64, arm64 architectures.
+The following packages are included for the arm64 architectures.
+
+ - [github.com/aymerick/douceur](https://pkg.go.dev/github.com/aymerick/douceur) ([MIT](https://github.com/aymerick/douceur/blob/v0.2.0/LICENSE))
+ - [github.com/fsnotify/fsnotify](https://pkg.go.dev/github.com/fsnotify/fsnotify) ([BSD-3-Clause](https://github.com/fsnotify/fsnotify/blob/v1.9.0/LICENSE))
+ - [github.com/github/github-mcp-server/v2](https://pkg.go.dev/github.com/github/github-mcp-server/v2) ([MIT](https://github.com/github/github-mcp-server/blob/HEAD/LICENSE))
+ - [github.com/go-chi/chi/v5](https://pkg.go.dev/github.com/go-chi/chi/v5) ([MIT](https://github.com/go-chi/chi/blob/v5.5.0/LICENSE))
+ - [github.com/go-viper/mapstructure/v2](https://pkg.go.dev/github.com/go-viper/mapstructure/v2) ([MIT](https://github.com/go-viper/mapstructure/blob/v2.5.0/LICENSE))
+ - [github.com/google/go-github/v92/github](https://pkg.go.dev/github.com/google/go-github/v92/github) ([BSD-3-Clause](https://github.com/google/go-github/blob/v92.0.0/LICENSE))
+ - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE))
+ - [github.com/google/jsonschema-go/jsonschema](https://pkg.go.dev/github.com/google/jsonschema-go/jsonschema) ([MIT](https://github.com/google/jsonschema-go/blob/v0.4.3/LICENSE))
+ - [github.com/gorilla/css/scanner](https://pkg.go.dev/github.com/gorilla/css/scanner) ([BSD-3-Clause](https://github.com/gorilla/css/blob/v1.0.1/LICENSE))
+ - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE))
+ - [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE))
+ - [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md))
+ - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
+ - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
+ - [github.com/muesli/cache2go](https://pkg.go.dev/github.com/muesli/cache2go) ([BSD-3-Clause](https://github.com/muesli/cache2go/blob/518229cd8021/LICENSE.txt))
+ - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.4/LICENSE))
+ - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.11.0/LICENSE))
+ - [github.com/segmentio/asm](https://pkg.go.dev/github.com/segmentio/asm) ([MIT](https://github.com/segmentio/asm/blob/v1.1.3/LICENSE))
+ - [github.com/segmentio/encoding](https://pkg.go.dev/github.com/segmentio/encoding) ([MIT](https://github.com/segmentio/encoding/blob/v0.5.4/LICENSE))
+ - [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/2402fdf4a9ed/LICENSE))
+ - [github.com/shurcooL/graphql](https://pkg.go.dev/github.com/shurcooL/graphql) ([MIT](https://github.com/shurcooL/graphql/blob/7ee5256398cf/LICENSE))
+ - [github.com/sourcegraph/conc](https://pkg.go.dev/github.com/sourcegraph/conc) ([MIT](https://github.com/sourcegraph/conc/blob/5f936abd7ae8/LICENSE))
+ - [github.com/spf13/afero](https://pkg.go.dev/github.com/spf13/afero) ([Apache-2.0](https://github.com/spf13/afero/blob/v1.15.0/LICENSE.txt))
+ - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.10.0/LICENSE))
+ - [github.com/spf13/cobra](https://pkg.go.dev/github.com/spf13/cobra) ([Apache-2.0](https://github.com/spf13/cobra/blob/v1.10.2/LICENSE.txt))
+ - [github.com/spf13/pflag](https://pkg.go.dev/github.com/spf13/pflag) ([BSD-3-Clause](https://github.com/spf13/pflag/blob/v1.1.0/LICENSE))
+ - [github.com/spf13/viper](https://pkg.go.dev/github.com/spf13/viper) ([MIT](https://github.com/spf13/viper/blob/v1.21.0/LICENSE))
+ - [github.com/subosito/gotenv](https://pkg.go.dev/github.com/subosito/gotenv) ([MIT](https://github.com/subosito/gotenv/blob/v1.6.0/LICENSE))
+ - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE))
+ - [go.yaml.in/yaml/v3](https://pkg.go.dev/go.yaml.in/yaml/v3) ([MIT](https://github.com/yaml/go-yaml/blob/v3.0.6/LICENSE))
+ - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.61.0:LICENSE))
+ - [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) ([BSD-3-Clause](https://cs.opensource.google/go/x/oauth2/+/v0.38.0:LICENSE))
+ - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.24.0:LICENSE))
+ - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.49.0:LICENSE))
+ - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.43.0:LICENSE))
+ - [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) ([BSD-3-Clause](https://cs.opensource.google/go/x/time/+/v0.15.0:LICENSE))
+
+## amd64
+
+The following packages are included for the amd64 architectures.
- [github.com/aymerick/douceur](https://pkg.go.dev/github.com/aymerick/douceur) ([MIT](https://github.com/aymerick/douceur/blob/v0.2.0/LICENSE))
- [github.com/fsnotify/fsnotify](https://pkg.go.dev/github.com/fsnotify/fsnotify) ([BSD-3-Clause](https://github.com/fsnotify/fsnotify/blob/v1.9.0/LICENSE))
diff --git a/third-party-licenses.linux.md b/third-party-licenses.linux.md
index 0b5cc2f591..68619e1fe9 100644
--- a/third-party-licenses.linux.md
+++ b/third-party-licenses.linux.md
@@ -21,7 +21,7 @@ The following packages are included for the 386, amd64, arm64 architectures.
- [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE))
- [github.com/google/jsonschema-go/jsonschema](https://pkg.go.dev/github.com/google/jsonschema-go/jsonschema) ([MIT](https://github.com/google/jsonschema-go/blob/v0.4.3/LICENSE))
- [github.com/gorilla/css/scanner](https://pkg.go.dev/github.com/gorilla/css/scanner) ([BSD-3-Clause](https://github.com/gorilla/css/blob/v1.0.1/LICENSE))
- - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE))
+ - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE))
- [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE))
- [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md))
- [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
diff --git a/third-party-licenses.windows.md b/third-party-licenses.windows.md
index 7f5e84a53d..af97bc393e 100644
--- a/third-party-licenses.windows.md
+++ b/third-party-licenses.windows.md
@@ -22,7 +22,7 @@ The following packages are included for the 386, amd64, arm64 architectures.
- [github.com/google/jsonschema-go/jsonschema](https://pkg.go.dev/github.com/google/jsonschema-go/jsonschema) ([MIT](https://github.com/google/jsonschema-go/blob/v0.4.3/LICENSE))
- [github.com/gorilla/css/scanner](https://pkg.go.dev/github.com/gorilla/css/scanner) ([BSD-3-Clause](https://github.com/gorilla/css/blob/v1.0.1/LICENSE))
- [github.com/inconshreveable/mousetrap](https://pkg.go.dev/github.com/inconshreveable/mousetrap) ([Apache-2.0](https://github.com/inconshreveable/mousetrap/blob/v1.1.0/LICENSE))
- - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE))
+ - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE))
- [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE))
- [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md))
- [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
From a3f98644c192af0d03e3f975a6a30489d1e72ddc Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 27 Nov 2026 10:06:02 +0000
Subject: [PATCH 10/11] chore: regenerate license files
Auto-generated by license-check workflow
---
third-party-licenses.darwin.md | 48 +++------------------------------
third-party-licenses.linux.md | 2 +-
third-party-licenses.windows.md | 2 +-
3 files changed, 5 insertions(+), 47 deletions(-)
diff --git a/third-party-licenses.darwin.md b/third-party-licenses.darwin.md
index 316e29ea6e..002d5a25bf 100644
--- a/third-party-licenses.darwin.md
+++ b/third-party-licenses.darwin.md
@@ -4,55 +4,13 @@ The following open source dependencies are used to build the [github/github-mcp-
## Table of Contents
-- [arm64](#arm64)
-- [amd64](#amd64)
+- [amd64, arm64](#amd64-arm64)
---
-## arm64
+## amd64, arm64
-The following packages are included for the arm64 architectures.
-
- - [github.com/aymerick/douceur](https://pkg.go.dev/github.com/aymerick/douceur) ([MIT](https://github.com/aymerick/douceur/blob/v0.2.0/LICENSE))
- - [github.com/fsnotify/fsnotify](https://pkg.go.dev/github.com/fsnotify/fsnotify) ([BSD-3-Clause](https://github.com/fsnotify/fsnotify/blob/v1.9.0/LICENSE))
- - [github.com/github/github-mcp-server/v2](https://pkg.go.dev/github.com/github/github-mcp-server/v2) ([MIT](https://github.com/github/github-mcp-server/blob/HEAD/LICENSE))
- - [github.com/go-chi/chi/v5](https://pkg.go.dev/github.com/go-chi/chi/v5) ([MIT](https://github.com/go-chi/chi/blob/v5.5.0/LICENSE))
- - [github.com/go-viper/mapstructure/v2](https://pkg.go.dev/github.com/go-viper/mapstructure/v2) ([MIT](https://github.com/go-viper/mapstructure/blob/v2.5.0/LICENSE))
- - [github.com/google/go-github/v92/github](https://pkg.go.dev/github.com/google/go-github/v92/github) ([BSD-3-Clause](https://github.com/google/go-github/blob/v92.0.0/LICENSE))
- - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE))
- - [github.com/google/jsonschema-go/jsonschema](https://pkg.go.dev/github.com/google/jsonschema-go/jsonschema) ([MIT](https://github.com/google/jsonschema-go/blob/v0.4.3/LICENSE))
- - [github.com/gorilla/css/scanner](https://pkg.go.dev/github.com/gorilla/css/scanner) ([BSD-3-Clause](https://github.com/gorilla/css/blob/v1.0.1/LICENSE))
- - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE))
- - [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE))
- - [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md))
- - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
- - [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([MIT](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
- - [github.com/muesli/cache2go](https://pkg.go.dev/github.com/muesli/cache2go) ([BSD-3-Clause](https://github.com/muesli/cache2go/blob/518229cd8021/LICENSE.txt))
- - [github.com/pelletier/go-toml/v2](https://pkg.go.dev/github.com/pelletier/go-toml/v2) ([MIT](https://github.com/pelletier/go-toml/blob/v2.2.4/LICENSE))
- - [github.com/sagikazarmark/locafero](https://pkg.go.dev/github.com/sagikazarmark/locafero) ([MIT](https://github.com/sagikazarmark/locafero/blob/v0.11.0/LICENSE))
- - [github.com/segmentio/asm](https://pkg.go.dev/github.com/segmentio/asm) ([MIT](https://github.com/segmentio/asm/blob/v1.1.3/LICENSE))
- - [github.com/segmentio/encoding](https://pkg.go.dev/github.com/segmentio/encoding) ([MIT](https://github.com/segmentio/encoding/blob/v0.5.4/LICENSE))
- - [github.com/shurcooL/githubv4](https://pkg.go.dev/github.com/shurcooL/githubv4) ([MIT](https://github.com/shurcooL/githubv4/blob/2402fdf4a9ed/LICENSE))
- - [github.com/shurcooL/graphql](https://pkg.go.dev/github.com/shurcooL/graphql) ([MIT](https://github.com/shurcooL/graphql/blob/7ee5256398cf/LICENSE))
- - [github.com/sourcegraph/conc](https://pkg.go.dev/github.com/sourcegraph/conc) ([MIT](https://github.com/sourcegraph/conc/blob/5f936abd7ae8/LICENSE))
- - [github.com/spf13/afero](https://pkg.go.dev/github.com/spf13/afero) ([Apache-2.0](https://github.com/spf13/afero/blob/v1.15.0/LICENSE.txt))
- - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.10.0/LICENSE))
- - [github.com/spf13/cobra](https://pkg.go.dev/github.com/spf13/cobra) ([Apache-2.0](https://github.com/spf13/cobra/blob/v1.10.2/LICENSE.txt))
- - [github.com/spf13/pflag](https://pkg.go.dev/github.com/spf13/pflag) ([BSD-3-Clause](https://github.com/spf13/pflag/blob/v1.1.0/LICENSE))
- - [github.com/spf13/viper](https://pkg.go.dev/github.com/spf13/viper) ([MIT](https://github.com/spf13/viper/blob/v1.21.0/LICENSE))
- - [github.com/subosito/gotenv](https://pkg.go.dev/github.com/subosito/gotenv) ([MIT](https://github.com/subosito/gotenv/blob/v1.6.0/LICENSE))
- - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE))
- - [go.yaml.in/yaml/v3](https://pkg.go.dev/go.yaml.in/yaml/v3) ([MIT](https://github.com/yaml/go-yaml/blob/v3.0.6/LICENSE))
- - [golang.org/x/net](https://pkg.go.dev/golang.org/x/net) ([BSD-3-Clause](https://cs.opensource.google/go/x/net/+/v0.61.0:LICENSE))
- - [golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) ([BSD-3-Clause](https://cs.opensource.google/go/x/oauth2/+/v0.38.0:LICENSE))
- - [golang.org/x/sync/errgroup](https://pkg.go.dev/golang.org/x/sync/errgroup) ([BSD-3-Clause](https://cs.opensource.google/go/x/sync/+/v0.24.0:LICENSE))
- - [golang.org/x/sys](https://pkg.go.dev/golang.org/x/sys) ([BSD-3-Clause](https://cs.opensource.google/go/x/sys/+/v0.49.0:LICENSE))
- - [golang.org/x/text](https://pkg.go.dev/golang.org/x/text) ([BSD-3-Clause](https://cs.opensource.google/go/x/text/+/v0.43.0:LICENSE))
- - [golang.org/x/time/rate](https://pkg.go.dev/golang.org/x/time/rate) ([BSD-3-Clause](https://cs.opensource.google/go/x/time/+/v0.15.0:LICENSE))
-
-## amd64
-
-The following packages are included for the amd64 architectures.
+The following packages are included for the amd64, arm64 architectures.
- [github.com/aymerick/douceur](https://pkg.go.dev/github.com/aymerick/douceur) ([MIT](https://github.com/aymerick/douceur/blob/v0.2.0/LICENSE))
- [github.com/fsnotify/fsnotify](https://pkg.go.dev/github.com/fsnotify/fsnotify) ([BSD-3-Clause](https://github.com/fsnotify/fsnotify/blob/v1.9.0/LICENSE))
diff --git a/third-party-licenses.linux.md b/third-party-licenses.linux.md
index 68619e1fe9..0b5cc2f591 100644
--- a/third-party-licenses.linux.md
+++ b/third-party-licenses.linux.md
@@ -21,7 +21,7 @@ The following packages are included for the 386, amd64, arm64 architectures.
- [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE))
- [github.com/google/jsonschema-go/jsonschema](https://pkg.go.dev/github.com/google/jsonschema-go/jsonschema) ([MIT](https://github.com/google/jsonschema-go/blob/v0.4.3/LICENSE))
- [github.com/gorilla/css/scanner](https://pkg.go.dev/github.com/gorilla/css/scanner) ([BSD-3-Clause](https://github.com/gorilla/css/blob/v1.0.1/LICENSE))
- - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE))
+ - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE))
- [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE))
- [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md))
- [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
diff --git a/third-party-licenses.windows.md b/third-party-licenses.windows.md
index af97bc393e..7f5e84a53d 100644
--- a/third-party-licenses.windows.md
+++ b/third-party-licenses.windows.md
@@ -22,7 +22,7 @@ The following packages are included for the 386, amd64, arm64 architectures.
- [github.com/google/jsonschema-go/jsonschema](https://pkg.go.dev/github.com/google/jsonschema-go/jsonschema) ([MIT](https://github.com/google/jsonschema-go/blob/v0.4.3/LICENSE))
- [github.com/gorilla/css/scanner](https://pkg.go.dev/github.com/gorilla/css/scanner) ([BSD-3-Clause](https://github.com/gorilla/css/blob/v1.0.1/LICENSE))
- [github.com/inconshreveable/mousetrap](https://pkg.go.dev/github.com/inconshreveable/mousetrap) ([Apache-2.0](https://github.com/inconshreveable/mousetrap/blob/v1.1.0/LICENSE))
- - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/LICENSE))
+ - [github.com/josephburnett/jd/v2](https://pkg.go.dev/github.com/josephburnett/jd/v2) ([MIT](https://github.com/josephburnett/jd/blob/v2.5.0/v2/LICENSE))
- [github.com/lithammer/fuzzysearch/fuzzy](https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy) ([MIT](https://github.com/lithammer/fuzzysearch/blob/v1.1.8/LICENSE))
- [github.com/microcosm-cc/bluemonday](https://pkg.go.dev/github.com/microcosm-cc/bluemonday) ([BSD-3-Clause](https://github.com/microcosm-cc/bluemonday/blob/v1.0.27/LICENSE.md))
- [github.com/modelcontextprotocol/go-sdk](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk) ([Apache-2.0](https://github.com/modelcontextprotocol/go-sdk/blob/v1.8.0/LICENSE))
From 197c7b7f0bc8feb89b251afed482df90f6fb16b0 Mon Sep 17 00:00:00 2001
From: Michelle Grounds <48298484+MichelleGrounds@users.noreply.github.com>
Date: Fri, 27 Nov 2026 11:43:22 +0000
Subject: [PATCH 11/11] Harden issue planning status updates
Validate repository path segments, allow public-repo scope access, and report when requested creation status is not applied.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
pkg/github/granular_tools_test.go | 12 +++-
pkg/github/issue_status.go | 57 ++++++++++++++++---
pkg/github/issues.go | 6 +-
pkg/github/issues_granular.go | 3 +
.../typed_consolidated_issue_outputs_test.go | 14 ++---
5 files changed, 71 insertions(+), 21 deletions(-)
diff --git a/pkg/github/granular_tools_test.go b/pkg/github/granular_tools_test.go
index edf2b53939..a014d8ae40 100644
--- a/pkg/github/granular_tools_test.go
+++ b/pkg/github/granular_tools_test.go
@@ -1273,6 +1273,10 @@ func TestIssuePlanningStatusInvalidInput(t *testing.T) {
{UpdateIssueStatus(translate), map[string]any{"status": "Done"}, "confirm_close must be true"},
{UpdateIssueStatus(translate), map[string]any{"status": "Not planned", "confirm_close": false}, "confirm_close must be true"},
{UpdateIssueStatus(translate), map[string]any{"status": "Done", "confirm_close": "true"}, "confirm_close"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Todo", "repo": "repo/../../user"}, "repository path segments"},
+ {UpdateIssueStatus(translate), map[string]any{"status": "Todo", "owner": ".."}, "repository path segments"},
+ {GranularCreateIssue(translate), map[string]any{"status": "Todo", "owner": `owner\x`}, "repository path segments"},
+ {IssueWrite(translate), map[string]any{"status": "Todo", "repo": "."}, "repository path segments"},
{GranularCreateIssue(translate), map[string]any{"status": "Done"}, "status must be one of: Backlog, Todo, In progress, In review"},
{IssueWrite(translate), map[string]any{"method": "update", "status": "Todo"}, "status is only supported with the create method"},
{IssueWrite(translate), map[string]any{"status": "Todo", "state": "closed"}, "status cannot be combined with state"},
@@ -1290,7 +1294,7 @@ func TestIssuePlanningStatusInvalidInput(t *testing.T) {
}
}
-func TestIssuePlanningStatusCreationIgnored(t *testing.T) {
+func TestIssuePlanningStatusCreationNotApplied(t *testing.T) {
for _, tool := range []inventory.ServerTool{
IssueWrite(translations.NullTranslationHelper), GranularCreateIssue(translations.NullTranslationHelper),
} {
@@ -1305,8 +1309,10 @@ func TestIssuePlanningStatusCreationIgnored(t *testing.T) {
req := createMCPRequest(map[string]any{"owner": "owner", "repo": "repo", "title": "Subject", "method": "create", "status": "Todo"})
result, err := tool.Handler(deps)(ContextWithDeps(context.Background(), deps), &req)
require.NoError(t, err)
- require.False(t, result.IsError, "creation succeeds even when optional metadata is not applied")
- assert.JSONEq(t, `{"id":"123","url":"https://github.com/owner/repo/issues/42"}`, getTextResult(t, result).Text)
+ require.True(t, result.IsError)
+ text := getTextResult(t, result).Text
+ assert.Contains(t, text, "issue created but requested status was not applied")
+ assert.Contains(t, text, `requested="Todo", applied="Backlog", issue_id=123, issue_url="https://github.com/owner/repo/issues/42"`)
})
}
}
diff --git a/pkg/github/issue_status.go b/pkg/github/issue_status.go
index b24fbfe772..ecb8157eb2 100644
--- a/pkg/github/issue_status.go
+++ b/pkg/github/issue_status.go
@@ -5,13 +5,13 @@ import (
"encoding/json"
"fmt"
"net/http"
+ "net/url"
"slices"
"strings"
ghErrors "github.com/github/github-mcp-server/v2/pkg/errors"
"github.com/github/github-mcp-server/v2/pkg/ifc"
"github.com/github/github-mcp-server/v2/pkg/inventory"
- "github.com/github/github-mcp-server/v2/pkg/scopes"
"github.com/github/github-mcp-server/v2/pkg/translations"
"github.com/github/github-mcp-server/v2/pkg/utils"
"github.com/google/go-github/v92/github"
@@ -213,12 +213,16 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
OpenWorldHint: new(true),
},
},
- scopes.RequireAll(scopes.Repo),
+ publicRepositoryWriteScopeAccess(),
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, args IssueStatusInput) (*mcp.CallToolResult, *IssueStatusUpdateOutput, error) {
// This is a caller-supplied confirmation policy, not proof that a trusted UI prompted the user.
if slices.Contains(issueClosingStatusNames, args.Status) && !args.ConfirmClose {
return utils.NewToolResultError("confirm_close must be true to use a status that closes the issue"), nil, nil
}
+ repoPath, err := repositoryAPIPath(args.Owner, args.Repo)
+ if err != nil {
+ return utils.NewToolResultError(err.Error()), nil, nil
+ }
client, err := deps.GetClient(ctx)
if err != nil {
return utils.NewToolResultErrorFromErr("failed to get GitHub client", err), nil, nil
@@ -240,7 +244,7 @@ func UpdateIssueStatus(t translations.TranslationHelperFunc) inventory.ServerToo
return utils.NewToolResultError("failed to get duplicate issue: response did not include a valid issue ID"), nil, nil
}
}
- req, err := client.NewRequest(ctx, http.MethodPatch, fmt.Sprintf("repos/%s/%s/issues/%d", args.Owner, args.Repo, args.IssueNumber), body)
+ req, err := client.NewRequest(ctx, http.MethodPatch, fmt.Sprintf("%s/issues/%d", repoPath, args.IssueNumber), body)
if err != nil {
return utils.NewToolResultErrorFromErr("failed to create status update request", err), nil, nil
}
@@ -273,25 +277,64 @@ func issueCreationStatusProperty() *jsonschema.Schema {
}
}
+// repositoryAPIPath rejects coordinates that are not single path segments and
+// escapes them, so hand-built REST URLs cannot target a different API path.
+func repositoryAPIPath(owner, repo string) (string, error) {
+ for _, segment := range []string{owner, repo} {
+ if strings.TrimSpace(segment) == "" || segment == "." || segment == ".." || strings.ContainsAny(segment, "/\\") {
+ return "", fmt.Errorf("owner and repo must be nonempty repository path segments")
+ }
+ }
+ return fmt.Sprintf("repos/%s/%s", url.PathEscape(owner), url.PathEscape(repo)), nil
+}
+
// createRESTIssue preserves the standard request fields while adding the API's
// status field, which go-github does not yet expose.
-func createRESTIssue(ctx context.Context, client *github.Client, owner, repo string, body github.CreateIssueRequest, status string) (*github.Issue, *github.Response, error) {
+func createRESTIssue(ctx context.Context, client *github.Client, owner, repo string, body github.CreateIssueRequest, status string) (*issueWithStatus, *github.Response, error) {
if status == "" {
- return client.Issues.Create(ctx, owner, repo, body)
+ issue, resp, err := client.Issues.Create(ctx, owner, repo, body)
+ if err != nil {
+ return nil, resp, err
+ }
+ if issue == nil {
+ issue = &github.Issue{}
+ }
+ return &issueWithStatus{Issue: *issue}, resp, nil
+ }
+ repoPath, err := repositoryAPIPath(owner, repo)
+ if err != nil {
+ return nil, nil, err
}
requestBody := struct {
github.CreateIssueRequest
Status string `json:"status"`
}{body, status}
- req, err := client.NewRequest(ctx, http.MethodPost, fmt.Sprintf("repos/%s/%s/issues", owner, repo), requestBody)
+ req, err := client.NewRequest(ctx, http.MethodPost, repoPath+"/issues", requestBody)
if err != nil {
return nil, nil, err
}
- var issue github.Issue
+ var issue issueWithStatus
resp, err := client.Do(req, &issue)
return &issue, resp, err
}
+// unappliedIssueStatusError reports a created issue whose status differs from
+// the requested one, so callers can fix that issue instead of creating another.
+func unappliedIssueStatusError(requested string, issue *issueWithStatus) error {
+ if requested == "" {
+ return nil
+ }
+ applied := ""
+ if status := issue.planningStatus(); status != nil {
+ applied = status.Name
+ }
+ if applied == requested {
+ return nil
+ }
+ return fmt.Errorf("requested=%q, applied=%q, issue_id=%d, issue_url=%q; issue statuses may be unavailable in this repository; use update_issue_status to correct the issue instead of creating it again",
+ requested, applied, issue.GetID(), issue.GetHTMLURL())
+}
+
func resolveIssueStatusID(ctx context.Context, client *githubv4.Client, owner, repo, status string) (githubv4.ID, error) {
var query struct {
Repository struct {
diff --git a/pkg/github/issues.go b/pkg/github/issues.go
index 7d8aa3ca82..f1972b01ee 100644
--- a/pkg/github/issues.go
+++ b/pkg/github/issues.go
@@ -3390,11 +3390,15 @@ func createIssue(ctx context.Context, client *github.Client, owner string, repo
}
if len(labels) > 0 {
- if err := unappliedIssueLabelsError(labels, issue); err != nil {
+ if err := unappliedIssueLabelsError(labels, &issue.Issue); err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "issue created but requested labels were not fully applied", resp, err), nil, nil
}
}
+ if err := unappliedIssueStatusError(status, issue); err != nil {
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "issue created but requested status was not applied", resp, err), nil, nil
+ }
+
// Return minimal response with just essential information
minimalResponse := MinimalResponse{
ID: fmt.Sprintf("%d", issue.GetID()),
diff --git a/pkg/github/issues_granular.go b/pkg/github/issues_granular.go
index 5cf878b3bf..c51aad10d8 100644
--- a/pkg/github/issues_granular.go
+++ b/pkg/github/issues_granular.go
@@ -180,6 +180,9 @@ func GranularCreateIssue(t translations.TranslationHelperFunc) inventory.ServerT
if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to create issue", resp, err), nil, nil
}
+ if err := unappliedIssueStatusError(args.Status, issue); err != nil {
+ return ghErrors.NewGitHubAPIErrorResponse(ctx, "issue created but requested status was not applied", resp, err), nil, nil
+ }
return granularIssueMinimalResult(&MinimalResponse{
ID: fmt.Sprintf("%d", issue.GetID()),
diff --git a/pkg/github/typed_consolidated_issue_outputs_test.go b/pkg/github/typed_consolidated_issue_outputs_test.go
index ad0af30015..2e4186f7ed 100644
--- a/pkg/github/typed_consolidated_issue_outputs_test.go
+++ b/pkg/github/typed_consolidated_issue_outputs_test.go
@@ -222,13 +222,11 @@ func TestIssuePlanningStatusRead(t *testing.T) {
func TestIssuePlanningStatusCreation(t *testing.T) {
for _, protocol := range []string{inventory.ProtocolVersionMultiRoundTrip, "2025-11-25"} {
- for _, tc := range []struct{ granular, parent, ignored bool }{
- {false, false, false}, {false, true, false},
- {true, false, false}, {true, true, false},
- {false, false, true}, {true, false, true},
+ for _, tc := range []struct{ granular, parent bool }{
+ {false, false}, {false, true}, {true, false}, {true, true},
} {
granular, parent := tc.granular, tc.parent
- t.Run(fmt.Sprintf("%s/granular=%t/parent=%t/ignored=%t", protocol, granular, parent, tc.ignored), func(t *testing.T) {
+ t.Run(fmt.Sprintf("%s/granular=%t/parent=%t", protocol, granular, parent), func(t *testing.T) {
calls := 0
rest := &http.Client{Transport: recorderTransport{handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
calls++
@@ -241,11 +239,7 @@ func TestIssuePlanningStatusCreation(t *testing.T) {
assert.Equal(t, "Body", body["body"])
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusCreated)
- statusName, category := "In review", "started"
- if tc.ignored {
- statusName, category = "Backlog", "backlog"
- }
- _, _ = fmt.Fprintf(w, `{"id":123,"number":42,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":5,"name":%q,"category":%q}}`, statusName, category)
+ _, _ = w.Write([]byte(`{"id":123,"number":42,"html_url":"https://github.com/owner/repo/issues/42","status":{"id":5,"name":"In review","category":"started"}}`))
})}}
gql := defaultGQLClient
if parent {