Skip to content

Commit 013d354

Browse files
authored
Merge branch 'main' into feature/reply-to-review-comments
2 parents 572fe53 + fa2d802 commit 013d354

File tree

165 files changed

+12259
-8517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+12259
-8517
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is the **GitHub MCP Server**, a Model Context Protocol (MCP) server that co
99
- **Type:** MCP server application with CLI interface
1010
- **Primary Package:** github-mcp-server (stdio MCP server - **this is the main focus**)
1111
- **Secondary Package:** mcpcurl (testing utility - don't break it, but not the priority)
12-
- **Framework:** Uses mark3labs/mcp-go for MCP protocol, google/go-github for GitHub API
12+
- **Framework:** Uses modelcontextprotocol/go-sdk for MCP protocol, google/go-github for GitHub API
1313
- **Size:** ~60MB repository, 70 Go files
1414
- **Library Usage:** This repository is also used as a library by the remote server. Functions that could be called by other repositories should be exported (capitalized), even if not required internally. Preserve existing export patterns.
1515

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
messages:
2+
- role: system
3+
content: |
4+
You are a triage assistant for the GitHub MCP Server repository. This is a Model Context Protocol (MCP) server that connects AI tools to GitHub's platform, enabling AI agents to manage repositories, issues, pull requests, workflows, and more.
5+
6+
Your job is to analyze bug reports and assess their completeness.
7+
8+
Analyze the issue for these key elements:
9+
1. Clear description of the problem
10+
2. Affected version (from running `docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version`)
11+
3. Steps to reproduce the behavior
12+
4. Expected vs actual behavior
13+
5. Relevant logs (if applicable)
14+
15+
Provide ONE of these assessments:
16+
17+
### AI Assessment: Ready for Review
18+
Use when the bug report has most required information and can be triaged by a maintainer.
19+
20+
### AI Assessment: Missing Details
21+
Use when critical information is missing (no reproduction steps, no version info, unclear problem description).
22+
23+
### AI Assessment: Unsure
24+
Use when you cannot determine the completeness of the report.
25+
26+
After your assessment header, provide a brief explanation of your rating.
27+
If details are missing, note which specific sections need more information.
28+
- role: user
29+
content: "{{input}}"
30+
model: openai/gpt-4o-mini
31+
modelParameters:
32+
max_tokens: 500
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
messages:
2+
- role: system
3+
content: |
4+
You are a triage assistant for the GitHub MCP Server repository. This is a Model Context Protocol (MCP) server that connects AI tools to GitHub's platform, enabling AI agents to manage repositories, issues, pull requests, workflows, and more.
5+
6+
Your job is to analyze new issues and help categorize them.
7+
8+
Analyze the issue to determine:
9+
1. Is this a bug report, feature request, question, or something else?
10+
2. Is the issue clear and well-described?
11+
3. Does it contain enough information for maintainers to act on?
12+
13+
Provide ONE of these assessments:
14+
15+
### AI Assessment: Ready for Review
16+
Use when the issue is clear, well-described, and contains enough context for maintainers to understand and act on it.
17+
18+
### AI Assessment: Missing Details
19+
Use when the issue is unclear, lacks context, or needs more information to be actionable.
20+
21+
### AI Assessment: Unsure
22+
Use when you cannot determine the nature or completeness of the issue.
23+
24+
After your assessment header, provide a brief explanation including:
25+
- What type of issue this appears to be (bug, feature request, question, etc.)
26+
- What additional information might be helpful if any
27+
- role: user
28+
content: "{{input}}"
29+
model: openai/gpt-4o-mini
30+
modelParameters:
31+
max_tokens: 500
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: AI Issue Assessment
2+
3+
on:
4+
issues:
5+
types: [opened, labeled]
6+
7+
jobs:
8+
ai-issue-assessment:
9+
if: >
10+
(github.event.action == 'opened' && github.event.issue.labels[0] == null) ||
11+
(github.event.action == 'labeled' && github.event.label.name == 'bug')
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
models: read
16+
contents: read
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Run AI assessment
23+
uses: github/ai-assessment-comment-labeler@e3bedc38cfffa9179fe4cee8f7ecc93bffb3fee7 # v1.0.1
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
ai_review_label: 'bug, enhancement'
27+
issue_number: ${{ github.event.issue.number }}
28+
issue_body: ${{ github.event.issue.body }}
29+
prompts_directory: '.github/prompts'
30+
labels_to_prompts_mapping: 'bug,bug-report-review.prompt.yml|default,default-issue-review.prompt.yml'

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ _Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also
328328

329329
When no toolsets are specified, [default toolsets](#default-toolset) are used.
330330

331+
> **Looking for examples?** See the [Server Configuration Guide](./docs/server-configuration.md) for common recipes like minimal setups, read-only mode, and combining tools with toolsets.
332+
331333
#### Specifying Toolsets
332334

333335
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
@@ -717,8 +719,8 @@ The following sets of tools are available:
717719

718720
- **issue_read** - Get issue details
719721
- `issue_number`: The number of the issue (number, required)
720-
- `method`: The read operation to perform on a single issue.
721-
Options are:
722+
- `method`: The read operation to perform on a single issue.
723+
Options are:
722724
1. get - Get details of a specific issue.
723725
2. get_comments - Get issue comments.
724726
3. get_sub_issues - Get sub-issues of the issue.
@@ -736,8 +738,8 @@ Options are:
736738
- `issue_number`: Issue number to update (number, optional)
737739
- `labels`: Labels to apply to this issue (string[], optional)
738740
- `method`: Write operation to perform on a single issue.
739-
Options are:
740-
- 'create' - creates a new issue.
741+
Options are:
742+
- 'create' - creates a new issue.
741743
- 'update' - updates an existing issue.
742744
(string, required)
743745
- `milestone`: Milestone number (number, optional)
@@ -817,7 +819,7 @@ Options are:
817819
<summary>Notifications</summary>
818820

819821
- **dismiss_notification** - Dismiss notification
820-
- `state`: The new state of the notification (read/done) (string, optional)
822+
- `state`: The new state of the notification (read/done) (string, required)
821823
- `threadID`: The ID of the notification thread (string, required)
822824

823825
- **get_notification_details** - Get notification details

cmd/github-mcp-server/generate_docs.go

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import (
1515
"github.com/github/github-mcp-server/pkg/toolsets"
1616
"github.com/github/github-mcp-server/pkg/translations"
1717
gogithub "github.com/google/go-github/v79/github"
18-
"github.com/mark3labs/mcp-go/mcp"
18+
"github.com/google/jsonschema-go/jsonschema"
19+
"github.com/modelcontextprotocol/go-sdk/mcp"
1920
"github.com/shurcooL/githubv4"
2021
"github.com/spf13/cobra"
2122
)
@@ -226,7 +227,16 @@ func generateToolDoc(tool mcp.Tool) string {
226227
lines = append(lines, fmt.Sprintf("- **%s** - %s", tool.Name, tool.Annotations.Title))
227228

228229
// Parameters
229-
schema := tool.InputSchema
230+
if tool.InputSchema == nil {
231+
lines = append(lines, " - No parameters required")
232+
return strings.Join(lines, "\n")
233+
}
234+
schema, ok := tool.InputSchema.(*jsonschema.Schema)
235+
if !ok || schema == nil {
236+
lines = append(lines, " - No parameters required")
237+
return strings.Join(lines, "\n")
238+
}
239+
230240
if len(schema.Properties) > 0 {
231241
// Get parameter names and sort them for deterministic order
232242
var paramNames []string
@@ -243,30 +253,22 @@ func generateToolDoc(tool mcp.Tool) string {
243253
requiredStr = "required"
244254
}
245255

246-
// Get the type and description
247-
typeStr := "unknown"
248-
description := ""
249-
250-
if propMap, ok := prop.(map[string]interface{}); ok {
251-
if typeVal, ok := propMap["type"].(string); ok {
252-
if typeVal == "array" {
253-
if items, ok := propMap["items"].(map[string]interface{}); ok {
254-
if itemType, ok := items["type"].(string); ok {
255-
typeStr = itemType + "[]"
256-
}
257-
} else {
258-
typeStr = "array"
259-
}
260-
} else {
261-
typeStr = typeVal
262-
}
263-
}
256+
var typeStr, description string
264257

265-
if desc, ok := propMap["description"].(string); ok {
266-
description = desc
258+
// Get the type and description
259+
switch prop.Type {
260+
case "array":
261+
if prop.Items != nil {
262+
typeStr = prop.Items.Type + "[]"
263+
} else {
264+
typeStr = "array"
267265
}
266+
default:
267+
typeStr = prop.Type
268268
}
269269

270+
description = prop.Description
271+
270272
paramLine := fmt.Sprintf(" - `%s`: %s (%s, %s)", propName, description, typeStr, requiredStr)
271273
lines = append(lines, paramLine)
272274
}

docs/remote-server.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,23 @@ These toolsets are only available in the remote GitHub MCP Server and are not in
5353

5454
### Optional Headers
5555

56-
The Remote GitHub MCP server has optional headers equivalent to the Local server env vars:
56+
The Remote GitHub MCP server has optional headers equivalent to the Local server env vars or flags:
5757

5858
- `X-MCP-Toolsets`: Comma-separated list of toolsets to enable. E.g. "repos,issues".
59-
- Equivalent to `GITHUB_TOOLSETS` env var for Local server.
59+
- Equivalent to `GITHUB_TOOLSETS` env var or `--toolsets` flag for Local server.
6060
- If the list is empty, default toolsets will be used. Invalid or unknown toolsets are silently ignored without error and will not prevent the server from starting. Whitespace is ignored.
61+
- `X-MCP-Tools`: Comma-separated list of tools to enable. E.g. "get_file_contents,issue_read,pull_request_read".
62+
- Equivalent to `GITHUB_TOOLS` env var or `--tools` flag for Local server.
63+
- Invalid tools will throw an error and prevent the server from starting. Whitespace is ignored.
6164
- `X-MCP-Readonly`: Enables only "read" tools.
6265
- Equivalent to `GITHUB_READ_ONLY` env var for Local server.
6366
- If this header is empty, "false", "f", "no", "n", "0", or "off" (ignoring whitespace and case), it will be interpreted as false. All other values are interpreted as true.
6467
- `X-MCP-Lockdown`: Enables lockdown mode, hiding public issue details created by users without push access.
6568
- Equivalent to `GITHUB_LOCKDOWN_MODE` env var for Local server.
6669
- If this header is empty, "false", "f", "no", "n", "0", or "off" (ignoring whitespace and case), it will be interpreted as false. All other values are interpreted as true.
6770

71+
> **Looking for examples?** See the [Server Configuration Guide](./server-configuration.md) for common recipes like minimal setups, read-only mode, and combining tools with toolsets.
72+
6873
Example:
6974

7075
```json

0 commit comments

Comments
 (0)