feat: add labels support to create_pull_request tool
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- go
調査の方向性
まず PR #2413 と、CreatePullRequest InputSchema、AddLabelsToIssue 呼び出し、テスト、および issue で指定されている pr-write MCP App の変更を確認します。go test ./... と golangci-lint run --new-from-rev=HEAD を実行します。オプションのラベルが機能し、ラベルの失敗時に PR が作成されたことが明確に報告され、文書化されているツールが更新されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the feature or problem you'd like to solve
The create_pull_request tool currently does not support adding labels during PR creation. Users who want to label PRs at creation time must make a separate add_label tool call after creating the PR, which adds friction in agentic workflows where a PR should be created with appropriate labels in a single step.
This is especially common in real-world usage — developers naturally say "create a PR and label it as bug" rather than thinking of it as two separate operations.
Proposed solution
Add an optional labels parameter (string array) to the create_pull_request tool. Since the GitHub REST API (POST /repos/{owner}/{repo}/pulls) does not natively support labels, the implementation uses a two-step approach:
- Create the PR via the existing pulls endpoint
- Apply labels via
POST /repos/{owner}/{repo}/issues/{issue_number}/labels
If label application fails after PR creation, the error clearly indicates the PR was created successfully but labels could not be applied, so no work is silently lost.
Benefits:
- Reduces tool calls needed for a common workflow (2 → 1)
- Aligns with how developers naturally think about PR creation
- Fully backwards-compatible — the parameter is optional
- Consistent with
issue_writewhich already supports labels at creation time
Example prompts or workflows (for tools/toolsets only)
-
"Create a pull request from my feature branch to main and label it as
bugandpriority:high" — Single-step PR creation with classification labels, common in triage workflows. -
"Open a PR for this hotfix, mark it as draft, and add the
urgentlabel" — Combines draft mode with labeling for time-sensitive fixes. -
"Create a PR titled 'Add user auth' from
feat/authtodevelopwith labelsenhancementandsecurity" — Full PR creation with multiple labels in one natural request. -
"Submit a pull request for my changes and tag it as
documentation" — Simple single-label use case that feels natural to say but currently requires two tool calls. -
"Create PRs for each of my feature branches and label them with their respective area labels" — Batch automation scenario where reducing tool calls per PR matters.
Additional context
I have a working implementation in PR #2413 that includes:
- Backend:
labelsarray property inCreatePullRequestInputSchema +AddLabelsToIssuepost-creation call - Tests: 2 new test cases (success with labels, label failure after PR creation)
- UI: Labels input field in the
pr-writeMCP App - Docs: Updated toolsnap + auto-generated README via
script/generate-docs
All tests pass (go test ./...) and lint is clean (golangci-lint run --new-from-rev=HEAD → 0 issues).
- 主要言語
- Go
- スター
- 33.1k
- フォーク
- 5k
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 25
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/github-mcp-server のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/github-mcp-server#3235 ·
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
github/github-mcp-server#3042 · コメント 2 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/github-mcp-server#3032 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
github/github-mcp-server#2803 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/github-mcp-server#2740 ·
github/github-mcp-server の issue をすべて見る
似ている issue
-
feature-request helm
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gravitational/teleport#69785 ·
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
crossplane/crossplane#7859 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100