Skip to content

Commit ad9c392

Browse files
committed
Merge branch 'main' into tommy/mcp-ui-apps-2
2 parents bea9bf9 + f62ff63 commit ad9c392

File tree

19 files changed

+807
-151
lines changed

19 files changed

+807
-151
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ The following sets of tools are available:
751751

752752
- **assign_copilot_to_issue** - Assign Copilot to issue
753753
- **Required OAuth Scopes**: `repo`
754+
- `base_ref`: Git reference (e.g., branch) that the agent will start its work from. If not specified, defaults to the repository's default branch (string, optional)
754755
- `issue_number`: Issue number (number, required)
755756
- `owner`: Repository owner (string, required)
756757
- `repo`: Repository name (string, required)

cmd/github-mcp-server/generate_docs.go

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -198,30 +198,6 @@ func generateToolsDoc(r *inventory.Inventory) string {
198198
return buf.String()
199199
}
200200

201-
func formatToolsetName(name string) string {
202-
switch name {
203-
case "pull_requests":
204-
return "Pull Requests"
205-
case "repos":
206-
return "Repositories"
207-
case "code_security":
208-
return "Code Security"
209-
case "secret_protection":
210-
return "Secret Protection"
211-
case "orgs":
212-
return "Organizations"
213-
default:
214-
// Fallback: capitalize first letter and replace underscores with spaces
215-
parts := strings.Split(name, "_")
216-
for i, part := range parts {
217-
if len(part) > 0 {
218-
parts[i] = strings.ToUpper(string(part[0])) + part[1:]
219-
}
220-
}
221-
return strings.Join(parts, " ")
222-
}
223-
}
224-
225201
func writeToolDoc(buf *strings.Builder, tool inventory.ServerTool) {
226202
// Tool name (no icon - section header already has the toolset icon)
227203
fmt.Fprintf(buf, "- **%s** - %s\n", tool.Tool.Name, tool.Tool.Annotations.Title)
@@ -373,14 +349,13 @@ func generateRemoteToolsetsDoc() string {
373349

374350
// Add "all" toolset first (special case)
375351
allIcon := octiconImg("apps", "../")
376-
fmt.Fprintf(&buf, "| %s<br>all | All available GitHub MCP tools | https://api.githubcopilot.com/mcp/ | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%%7B%%22type%%22%%3A%%20%%22http%%22%%2C%%22url%%22%%3A%%20%%22https%%3A%%2F%%2Fapi.githubcopilot.com%%2Fmcp%%2F%%22%%7D) | [read-only](https://api.githubcopilot.com/mcp/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%%7B%%22type%%22%%3A%%20%%22http%%22%%2C%%22url%%22%%3A%%20%%22https%%3A%%2F%%2Fapi.githubcopilot.com%%2Fmcp%%2Freadonly%%22%%7D) |\n", allIcon)
352+
fmt.Fprintf(&buf, "| %s<br>`all` | All available GitHub MCP tools | https://api.githubcopilot.com/mcp/ | [Install](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%%7B%%22type%%22%%3A%%20%%22http%%22%%2C%%22url%%22%%3A%%20%%22https%%3A%%2F%%2Fapi.githubcopilot.com%%2Fmcp%%2F%%22%%7D) | [read-only](https://api.githubcopilot.com/mcp/readonly) | [Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=github&config=%%7B%%22type%%22%%3A%%20%%22http%%22%%2C%%22url%%22%%3A%%20%%22https%%3A%%2F%%2Fapi.githubcopilot.com%%2Fmcp%%2Freadonly%%22%%7D) |\n", allIcon)
377353

378354
// AvailableToolsets() returns toolsets that have tools, sorted by ID
379355
// Exclude context (handled separately) and dynamic (internal only)
380356
for _, ts := range r.AvailableToolsets("context", "dynamic") {
381357
idStr := string(ts.ID)
382358

383-
formattedName := formatToolsetName(idStr)
384359
apiURL := fmt.Sprintf("https://api.githubcopilot.com/mcp/x/%s", idStr)
385360
readonlyURL := fmt.Sprintf("https://api.githubcopilot.com/mcp/x/%s/readonly", idStr)
386361

@@ -396,9 +371,9 @@ func generateRemoteToolsetsDoc() string {
396371
readonlyInstallLink := fmt.Sprintf("[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-%s&config=%s)", idStr, readonlyConfig)
397372

398373
icon := octiconImg(ts.Icon, "../")
399-
fmt.Fprintf(&buf, "| %s<br>%s | %s | %s | %s | [read-only](%s) | %s |\n",
374+
fmt.Fprintf(&buf, "| %s<br>`%s` | %s | %s | %s | [read-only](%s) | %s |\n",
400375
icon,
401-
formattedName,
376+
idStr,
402377
ts.Description,
403378
apiURL,
404379
installLink,
@@ -421,7 +396,6 @@ func generateRemoteOnlyToolsetsDoc() string {
421396
for _, ts := range github.RemoteOnlyToolsets() {
422397
idStr := string(ts.ID)
423398

424-
formattedName := formatToolsetName(idStr)
425399
apiURL := fmt.Sprintf("https://api.githubcopilot.com/mcp/x/%s", idStr)
426400
readonlyURL := fmt.Sprintf("https://api.githubcopilot.com/mcp/x/%s/readonly", idStr)
427401

@@ -437,9 +411,9 @@ func generateRemoteOnlyToolsetsDoc() string {
437411
readonlyInstallLink := fmt.Sprintf("[Install read-only](https://insiders.vscode.dev/redirect/mcp/install?name=gh-%s&config=%s)", idStr, readonlyConfig)
438412

439413
icon := octiconImg(ts.Icon, "../")
440-
fmt.Fprintf(&buf, "| %s<br>%s | %s | %s | %s | [read-only](%s) | %s |\n",
414+
fmt.Fprintf(&buf, "| %s<br>`%s` | %s | %s | %s | [read-only](%s) | %s |\n",
441415
icon,
442-
formattedName,
416+
idStr,
443417
ts.Description,
444418
apiURL,
445419
installLink,

cmd/github-mcp-server/helpers.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package main
2+
3+
import "strings"
4+
5+
// formatToolsetName converts a toolset ID to a human-readable name.
6+
// Used by both generate_docs.go and list_scopes.go for consistent formatting.
7+
func formatToolsetName(name string) string {
8+
switch name {
9+
case "pull_requests":
10+
return "Pull Requests"
11+
case "repos":
12+
return "Repositories"
13+
case "code_security":
14+
return "Code Security"
15+
case "secret_protection":
16+
return "Secret Protection"
17+
case "orgs":
18+
return "Organizations"
19+
default:
20+
// Fallback: capitalize first letter and replace underscores with spaces
21+
parts := strings.Split(name, "_")
22+
for i, part := range parts {
23+
if len(part) > 0 {
24+
parts[i] = strings.ToUpper(string(part[0])) + part[1:]
25+
}
26+
}
27+
return strings.Join(parts, " ")
28+
}
29+
}

0 commit comments

Comments
 (0)