1
---
2
name: github-issues
3
description: 'Create, update, and manage GitHub issues using MCP tools. Use this skill when users want to create bug reports, feature requests, or task issues, update existing issues, add labels/assignees/milestones, manage repository labels, set issue fields (dates, priority, custom fields), set issue types, manage issue workflows, link issues, add dependencies, or track blocked-by/blocking relationships. Triggers on requests like "create an issue", "file a bug", "request a feature", "update issue X", "set the priority", "set the start date", "create a label", "rename a label", "list repo labels", "link issues", "add dependency", "blocked by", "blocking", or any GitHub issue management task.'
4
---
5
6
# GitHub Issues
7
8
Manage GitHub issues using the `@modelcontextprotocol/server-github` MCP server.
9
10
## Available Tools
11
12
### MCP Tools (read operations)
13
14
| Tool | Purpose |
15
|------|---------|
16
| `mcp__github__issue_read` | Read issue details, sub-issues, comments, labels (methods: get, get_comments, get_sub_issues, get_labels) |
17
| `mcp__github__list_issues` | List and filter repository issues by state, labels, date |
18
| `mcp__github__search_issues` | Search issues across repos using GitHub search syntax |
19
| `mcp__github__projects_list` | List projects, project fields, project items, status updates |
20
| `mcp__github__projects_get` | Get details of a project, field, item, or status update |
21
| `mcp__github__projects_write` | Add/update/delete project items, create status updates |
22
23
### MCP Tools (write operations)
24
25
| Tool | Purpose |
26
|------|---------|
27
| `mcp__github__issue_write` | Create or update an issue (methods: create, update). Supports title, body, type, labels, assignees, milestone, and issue fields |
28
| `mcp__github__add_issue_comment` | Add a comment or a reaction to an issue |
29
| `mcp__github__sub_issue_write` | Add, remove, or reprioritize a sub-issue |
30
31
### CLI / REST API (write operations)
32
33
`gh api` performs the same writes and is the form used in the examples below. Reach for it when the MCP server is not connected, or when you need a REST field the MCP tools do not expose.
34
35
| Operation | Command |
36
|-----------|---------|
37
| Create issue | `gh api repos/{owner}/{repo}/issues -X POST -f title=... -f body=...` |
38
| Update issue | `gh api repos/{owner}/{repo}/issues/{number} -X PATCH -f title=... -f state=...` |
39
| Add comment | `gh api repos/{owner}/{repo}/issues/{number}/comments -X POST -f body=...` |
40
| Close issue | `gh api repos/{owner}/{repo}/issues/{number} -X PATCH -f state=closed` |
41
| Set issue type | Include `-f type=Bug` in the create call (REST API only, not supported by `gh issue create` CLI) |
42
43
**Note:** `gh issue create` works for basic issue creation but does **not** support the `--type` flag. Use `gh api` when you need to set issue types.
44
45
## Workflow
46
47
1. **Determine action**: Create, update, or query?
48
2. **Gather context**: Get repo info, existing labels, milestones if needed
49
3. **Structure content**: Use appropriate template from [references/templates.md](references/templates.md)
50
4. **Execute**: Use MCP tools for reads, `gh api` for writes
51
5. **Confirm**: Report the issue URL to user
52
53
## Creating Issues
54
55
Use `gh api` to create issues. This supports all parameters including issue types.
56
57
```bash
58
gh api repos/{owner}/{repo}/issues \
59
-X POST \
60
-f title="Issue title" \
61
-f body="Issue body in markdown" \
62
-f type="Bug" \
63
--jq '{number, html_url}'
64
```
65
66
### Optional Parameters
67
68
Add any of these flags to the `gh api` call:
69
70
```
71
-f type="Bug" # Issue type (Bug, Feature, Task, Epic, etc.)
72
-f 'labels[]=bug' # Labels (repeat for multiple)
73
-f 'assignees[]=username' # Assignees (repeat for multiple)
74
-f milestone=1 # Milestone number
75
```
76
77
**Quote the whole `name[]=value` pair.** `[]` is a glob pattern in zsh, the default shell
78
on macOS, so an unquoted `-f labels[]=bug` never reaches `gh`:
79
80
```
81
zsh: no matches found: labels[]=bug
82
```
83
84
**Issue types** are organization-level metadata. To discover available types, use:
85
```bash
86
gh api graphql -f query='{ organization(login: "ORG") { issueTypes(first: 10) { nodes { name } } } }' --jq '.data.organization.issueTypes.nodes[].name'
87
```
88
89
**Prefer issue types over labels for categorization.** When issue types are available (e.g., Bug, Feature, Task), use the `type` parameter instead of applying equivalent labels like `bug` or `enhancement`. Issue types are the canonical way to categorize issues on GitHub. Only fall back to labels when the org has no issue types configured.
90
91
### Title Guidelines
92
93
- Be specific and actionable
94
- Keep under 72 characters
95
- When issue types are set, don't add redundant prefixes like `[Bug]`
96
- Examples:
97
- `Login fails with SSO enabled` (with type=Bug)
98
- `Add dark mode support` (with type=Feature)
99
- `Add unit tests for auth module` (with type=Task)
100
101
### Body Structure
102
103
Always use the templates in [references/templates.md](references/templates.md). Choose based on issue type:
104
105
| User Request | Template |
106
|--------------|----------|
107
| Bug, error, broken, not working | Bug Report |
108
| Feature, enhancement, add, new | Feature Request |
109
| Task, chore, refactor, update | Task |
110
111
## Updating Issues
112
113
Use `gh api` with PATCH:
114
115
```bash
116
gh api repos/{owner}/{repo}/issues/{number} \
117
-X PATCH \
118
-f state=closed \
119
-f title="Updated title" \
120
--jq '{number, html_url}'
121
```
122
123
Only include fields you want to change. Available fields: `title`, `body`, `state` (open/closed), `labels`, `assignees`, `milestone`.
124
125
## Examples
126
127
### Example 1: Bug Report
128
129
**User**: "Create a bug issue - the login page crashes when using SSO"
130
131
**Action**:
132
```bash
133
gh api repos/github/awesome-copilot/issues \
134
-X POST \
135
-f title="Login page crashes when using SSO" \
136
-f type="Bug" \
137
-f body="## Description
138
The login page crashes when users attempt to authenticate using SSO.
139
140
## Steps to Reproduce
141
1. Navigate to login page
142
2. Click 'Sign in with SSO'
143
3. Page crashes
144
145
## Expected Behavior
146
SSO authentication should complete and redirect to dashboard.
147
148
## Actual Behavior
149
Page becomes unresponsive and displays error." \
150
--jq '{number, html_url}'
151
```
152
153
### Example 2: Feature Request
154
155
**User**: "Create a feature request for dark mode with high priority"
156
157
**Action**:
158
```bash
159
gh api repos/github/awesome-copilot/issues \
160
-X POST \
161
-f title="Add dark mode support" \
162
-f type="Feature" \
163
-f 'labels[]=high-priority' \
164
-f body="## Summary
165
Add dark mode theme option for improved user experience and accessibility.
166
167
## Motivation
168
- Reduces eye strain in low-light environments
169
- Increasingly expected by users
170
171
## Proposed Solution
172
Implement theme toggle with system preference detection.
173
174
## Acceptance Criteria
175
- [ ] Toggle switch in settings
176
- [ ] Persists user preference
177
- [ ] Respects system preference by default" \
178
--jq '{number, html_url}'
179
```
180
181
## Common Labels
182
183
Use these standard labels when applicable:
184
185
| Label | Use For |
186
|-------|---------|
187
| `bug` | Something isn't working |
188
| `enhancement` | New feature or improvement |
189
| `documentation` | Documentation updates |
190
| `good first issue` | Good for newcomers |
191
| `help wanted` | Extra attention needed |
192
| `question` | Further information requested |
193
| `wontfix` | Will not be addressed |
194
| `duplicate` | Already exists |
195
| `high-priority` | Urgent issues |
196
197
## Tips
198
199
- Always confirm the repository context before creating issues
200
- Ask for missing critical information rather than guessing
201
- Link related issues when known: `Related to #123`
202
- For updates, fetch current issue first to preserve unchanged fields
203
204
## Extended Capabilities
205
206
The following features require REST or GraphQL APIs beyond the basic MCP tools. Each is documented in its own reference file so the agent only loads the knowledge it needs.
207
208
| Capability | When to use | Reference |
209
|------------|-------------|-----------|
210
| Advanced search | Complex queries with boolean logic, date ranges, cross-repo search, issue field filters (`field.name:value`) | [references/search.md](references/search.md) |
211
| Sub-issues & parent issues | Breaking work into hierarchical tasks | [references/sub-issues.md](references/sub-issues.md) |
212
| Milestones | Create, read, update, close, reopen, delete milestones and manage milestone issues | [references/milestones.md](references/milestones.md) |
213
| Labels | Discover, create, rename, recolor, and delete repository labels; add or replace labels on an issue | [references/labels.md](references/labels.md) |
214
| Issue dependencies | Tracking blocked-by / blocking relationships | [references/dependencies.md](references/dependencies.md) |
215
| Issue types (advanced) | GraphQL operations beyond MCP `list_issue_types` / `type` param | [references/issue-types.md](references/issue-types.md) |
216
| Projects V2 | Project boards, progress reports, field management | [references/projects.md](references/projects.md) |
217
| Issue fields | Custom metadata: dates, priority, text, numbers (private preview) | [references/issue-fields.md](references/issue-fields.md) |
218
| Images in issues | Embedding images in issue bodies and comments via CLI | [references/images.md](references/images.md) |
219