Skip to content

Commit c619997

Browse files
fix: restore Icon fields to toolset metadata and add icons to docs
- Add Icon field to all ToolsetMetadata definitions (lost during rebase conflict resolution) - Update doc generator to include Octicon icons in toolsets table - Update doc generator to include icons in tool section headers - Use Primer Octicons CDN for GitHub markdown compatibility
1 parent 163e134 commit c619997

File tree

3 files changed

+86
-44
lines changed

3 files changed

+86
-44
lines changed

README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -453,26 +453,26 @@ GITHUB_TOOLSETS="default,stargazers" ./github-mcp-server
453453
The following sets of tools are available:
454454

455455
<!-- START AUTOMATED TOOLSETS -->
456-
| Toolset | Description |
457-
| ----------------------- | ------------------------------------------------------------- |
458-
| `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |
459-
| `actions` | GitHub Actions workflows and CI/CD operations |
460-
| `code_security` | Code security related tools, such as GitHub Code Scanning |
461-
| `dependabot` | Dependabot tools |
462-
| `discussions` | GitHub Discussions related tools |
463-
| `gists` | GitHub Gist related tools |
464-
| `git` | GitHub Git API related tools for low-level Git operations |
465-
| `issues` | GitHub Issues related tools |
466-
| `labels` | GitHub Labels related tools |
467-
| `notifications` | GitHub Notifications related tools |
468-
| `orgs` | GitHub Organization related tools |
469-
| `projects` | GitHub Projects related tools |
470-
| `pull_requests` | GitHub Pull Request related tools |
471-
| `repos` | GitHub Repository related tools |
472-
| `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning |
473-
| `security_advisories` | Security advisories related tools |
474-
| `stargazers` | GitHub Stargazers related tools |
475-
| `users` | GitHub User related tools |
456+
| | Toolset | Description |
457+
| --- | ----------------------- | ------------------------------------------------------------- |
458+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/person-16.svg" width="16" height="16" alt="person"> | `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |
459+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/workflow-16.svg" width="16" height="16" alt="workflow"> | `actions` | GitHub Actions workflows and CI/CD operations |
460+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/codescan-16.svg" width="16" height="16" alt="codescan"> | `code_security` | Code security related tools, such as GitHub Code Scanning |
461+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/dependabot-16.svg" width="16" height="16" alt="dependabot"> | `dependabot` | Dependabot tools |
462+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/comment-discussion-16.svg" width="16" height="16" alt="comment-discussion"> | `discussions` | GitHub Discussions related tools |
463+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/logo-gist-16.svg" width="16" height="16" alt="logo-gist"> | `gists` | GitHub Gist related tools |
464+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/git-branch-16.svg" width="16" height="16" alt="git-branch"> | `git` | GitHub Git API related tools for low-level Git operations |
465+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/issue-opened-16.svg" width="16" height="16" alt="issue-opened"> | `issues` | GitHub Issues related tools |
466+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/tag-16.svg" width="16" height="16" alt="tag"> | `labels` | GitHub Labels related tools |
467+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/bell-16.svg" width="16" height="16" alt="bell"> | `notifications` | GitHub Notifications related tools |
468+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/organization-16.svg" width="16" height="16" alt="organization"> | `orgs` | GitHub Organization related tools |
469+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/project-16.svg" width="16" height="16" alt="project"> | `projects` | GitHub Projects related tools |
470+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/git-pull-request-16.svg" width="16" height="16" alt="git-pull-request"> | `pull_requests` | GitHub Pull Request related tools |
471+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/repo-16.svg" width="16" height="16" alt="repo"> | `repos` | GitHub Repository related tools |
472+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/shield-lock-16.svg" width="16" height="16" alt="shield-lock"> | `secret_protection` | Secret protection related tools, such as GitHub Secret Scanning |
473+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/shield-16.svg" width="16" height="16" alt="shield"> | `security_advisories` | Security advisories related tools |
474+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/star-16.svg" width="16" height="16" alt="star"> | `stargazers` | GitHub Stargazers related tools |
475+
| <img src="https://unpkg.com/@primer/octicons@latest/build/svg/people-16.svg" width="16" height="16" alt="people"> | `users` | GitHub User related tools |
476476
<!-- END AUTOMATED TOOLSETS -->
477477

478478
### Additional Toolsets in Remote GitHub MCP Server
@@ -488,7 +488,7 @@ The following sets of tools are available:
488488
<!-- START AUTOMATED TOOLS -->
489489
<details>
490490

491-
<summary>Actions</summary>
491+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/workflow-16.svg" width="16" height="16" alt="workflow"> Actions</summary>
492492

493493
- **cancel_workflow_run** - Cancel workflow run
494494
- `owner`: Repository owner (string, required)
@@ -582,7 +582,7 @@ The following sets of tools are available:
582582

583583
<details>
584584

585-
<summary>Code Security</summary>
585+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/codescan-16.svg" width="16" height="16" alt="codescan"> Code Security</summary>
586586

587587
- **get_code_scanning_alert** - Get code scanning alert
588588
- `alertNumber`: The number of the alert. (number, required)
@@ -601,7 +601,7 @@ The following sets of tools are available:
601601

602602
<details>
603603

604-
<summary>Context</summary>
604+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/person-16.svg" width="16" height="16" alt="person"> Context</summary>
605605

606606
- **get_me** - Get my user profile
607607
- No parameters required
@@ -617,7 +617,7 @@ The following sets of tools are available:
617617

618618
<details>
619619

620-
<summary>Dependabot</summary>
620+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/dependabot-16.svg" width="16" height="16" alt="dependabot"> Dependabot</summary>
621621

622622
- **get_dependabot_alert** - Get dependabot alert
623623
- `alertNumber`: The number of the alert. (number, required)
@@ -634,7 +634,7 @@ The following sets of tools are available:
634634

635635
<details>
636636

637-
<summary>Discussions</summary>
637+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/comment-discussion-16.svg" width="16" height="16" alt="comment-discussion"> Discussions</summary>
638638

639639
- **get_discussion** - Get discussion
640640
- `discussionNumber`: Discussion Number (number, required)
@@ -665,7 +665,7 @@ The following sets of tools are available:
665665

666666
<details>
667667

668-
<summary>Gists</summary>
668+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/logo-gist-16.svg" width="16" height="16" alt="logo-gist"> Gists</summary>
669669

670670
- **create_gist** - Create Gist
671671
- `content`: Content for simple single-file gist creation (string, required)
@@ -692,7 +692,7 @@ The following sets of tools are available:
692692

693693
<details>
694694

695-
<summary>Git</summary>
695+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/git-branch-16.svg" width="16" height="16" alt="git-branch"> Git</summary>
696696

697697
- **get_repository_tree** - Get repository tree
698698
- `owner`: Repository owner (username or organization) (string, required)
@@ -705,7 +705,7 @@ The following sets of tools are available:
705705

706706
<details>
707707

708-
<summary>Issues</summary>
708+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/issue-opened-16.svg" width="16" height="16" alt="issue-opened"> Issues</summary>
709709

710710
- **add_issue_comment** - Add comment to issue
711711
- `body`: Comment content (string, required)
@@ -798,7 +798,7 @@ The following sets of tools are available:
798798

799799
<details>
800800

801-
<summary>Labels</summary>
801+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/tag-16.svg" width="16" height="16" alt="tag"> Labels</summary>
802802

803803
- **get_label** - Get a specific label from a repository.
804804
- `name`: Label name. (string, required)
@@ -822,7 +822,7 @@ The following sets of tools are available:
822822

823823
<details>
824824

825-
<summary>Notifications</summary>
825+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/bell-16.svg" width="16" height="16" alt="bell"> Notifications</summary>
826826

827827
- **dismiss_notification** - Dismiss notification
828828
- `state`: The new state of the notification (read/done) (string, required)
@@ -858,7 +858,7 @@ The following sets of tools are available:
858858

859859
<details>
860860

861-
<summary>Organizations</summary>
861+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/organization-16.svg" width="16" height="16" alt="organization"> Organizations</summary>
862862

863863
- **search_orgs** - Search organizations
864864
- `order`: Sort order (string, optional)
@@ -871,7 +871,7 @@ The following sets of tools are available:
871871

872872
<details>
873873

874-
<summary>Projects</summary>
874+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/project-16.svg" width="16" height="16" alt="project"> Projects</summary>
875875

876876
- **add_project_item** - Add project item
877877
- `item_id`: The numeric ID of the issue or pull request to add to the project. (number, required)
@@ -941,7 +941,7 @@ The following sets of tools are available:
941941

942942
<details>
943943

944-
<summary>Pull Requests</summary>
944+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/git-pull-request-16.svg" width="16" height="16" alt="git-pull-request"> Pull Requests</summary>
945945

946946
- **add_comment_to_pending_review** - Add review comment to the requester's latest pending pull request review
947947
- `body`: The text of the review comment (string, required)
@@ -1046,7 +1046,7 @@ The following sets of tools are available:
10461046

10471047
<details>
10481048

1049-
<summary>Repositories</summary>
1049+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/repo-16.svg" width="16" height="16" alt="repo"> Repositories</summary>
10501050

10511051
- **create_branch** - Create branch
10521052
- `branch`: Name for new branch (string, required)
@@ -1163,7 +1163,7 @@ The following sets of tools are available:
11631163

11641164
<details>
11651165

1166-
<summary>Secret Protection</summary>
1166+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/shield-lock-16.svg" width="16" height="16" alt="shield-lock"> Secret Protection</summary>
11671167

11681168
- **get_secret_scanning_alert** - Get secret scanning alert
11691169
- `alertNumber`: The number of the alert. (number, required)
@@ -1181,7 +1181,7 @@ The following sets of tools are available:
11811181

11821182
<details>
11831183

1184-
<summary>Security Advisories</summary>
1184+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/shield-16.svg" width="16" height="16" alt="shield"> Security Advisories</summary>
11851185

11861186
- **get_global_security_advisory** - Get a global security advisory
11871187
- `ghsaId`: GitHub Security Advisory ID (format: GHSA-xxxx-xxxx-xxxx). (string, required)
@@ -1216,7 +1216,7 @@ The following sets of tools are available:
12161216

12171217
<details>
12181218

1219-
<summary>Stargazers</summary>
1219+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/star-16.svg" width="16" height="16" alt="star"> Stargazers</summary>
12201220

12211221
- **list_starred_repositories** - List starred repositories
12221222
- `direction`: The direction to sort the results by. (string, optional)
@@ -1237,7 +1237,7 @@ The following sets of tools are available:
12371237

12381238
<details>
12391239

1240-
<summary>Users</summary>
1240+
<summary><img src="https://unpkg.com/@primer/octicons@latest/build/svg/people-16.svg" width="16" height="16" alt="people"> Users</summary>
12411241

12421242
- **search_users** - Search users
12431243
- `order`: Sort order (string, optional)

cmd/github-mcp-server/generate_docs.go

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,33 @@ func generateRemoteServerDocs(docsPath string) error {
104104
return os.WriteFile(docsPath, []byte(updatedContent), 0600) //#nosec G306
105105
}
106106

107+
// octiconImg returns an img tag for an Octicon that works with GitHub's light/dark theme.
108+
// Uses the official Primer Octicons CDN.
109+
func octiconImg(name string) string {
110+
if name == "" {
111+
return ""
112+
}
113+
// Use GitHub's Octicon CDN with 16px size
114+
return fmt.Sprintf(`<img src="https://unpkg.com/@primer/octicons@latest/build/svg/%s-16.svg" width="16" height="16" alt="%s">`, name, name)
115+
}
116+
107117
func generateToolsetsDoc(i *inventory.Inventory) string {
108118
var buf strings.Builder
109119

110-
// Add table header and separator
111-
buf.WriteString("| Toolset | Description |\n")
112-
buf.WriteString("| ----------------------- | ------------------------------------------------------------- |\n")
120+
// Add table header and separator (with icon column)
121+
buf.WriteString("| | Toolset | Description |\n")
122+
buf.WriteString("| --- | ----------------------- | ------------------------------------------------------------- |\n")
113123

114124
// Add the context toolset row with custom description (strongly recommended)
115-
buf.WriteString("| `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |\n")
125+
// Get context toolset for its icon
126+
contextIcon := octiconImg("person")
127+
fmt.Fprintf(&buf, "| %s | `context` | **Strongly recommended**: Tools that provide context about the current user and GitHub context you are operating in |\n", contextIcon)
116128

117129
// AvailableToolsets() returns toolsets that have tools, sorted by ID
118130
// Exclude context (custom description above) and dynamic (internal only)
119131
for _, ts := range i.AvailableToolsets("context", "dynamic") {
120-
fmt.Fprintf(&buf, "| `%s` | %s |\n", ts.ID, ts.Description)
132+
icon := octiconImg(ts.Icon)
133+
fmt.Fprintf(&buf, "| %s | `%s` | %s |\n", icon, ts.ID, ts.Description)
121134
}
122135

123136
return strings.TrimSuffix(buf.String(), "\n")
@@ -134,6 +147,7 @@ func generateToolsDoc(r *inventory.Inventory) string {
134147
var buf strings.Builder
135148
var toolBuf strings.Builder
136149
var currentToolsetID inventory.ToolsetID
150+
var currentToolsetIcon string
137151
firstSection := true
138152

139153
writeSection := func() {
@@ -145,7 +159,11 @@ func generateToolsDoc(r *inventory.Inventory) string {
145159
}
146160
firstSection = false
147161
sectionName := formatToolsetName(string(currentToolsetID))
148-
fmt.Fprintf(&buf, "<details>\n\n<summary>%s</summary>\n\n%s\n\n</details>", sectionName, strings.TrimSuffix(toolBuf.String(), "\n\n"))
162+
icon := octiconImg(currentToolsetIcon)
163+
if icon != "" {
164+
icon += " "
165+
}
166+
fmt.Fprintf(&buf, "<details>\n\n<summary>%s%s</summary>\n\n%s\n\n</details>", icon, sectionName, strings.TrimSuffix(toolBuf.String(), "\n\n"))
149167
toolBuf.Reset()
150168
}
151169

@@ -154,6 +172,7 @@ func generateToolsDoc(r *inventory.Inventory) string {
154172
if tool.Toolset.ID != currentToolsetID {
155173
writeSection()
156174
currentToolsetID = tool.Toolset.ID
175+
currentToolsetIcon = tool.Toolset.Icon
157176
}
158177
writeToolDoc(&toolBuf, tool.Tool)
159178
toolBuf.WriteString("\n\n")

pkg/github/tools.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,99 +15,122 @@ type GetGQLClientFn func(context.Context) (*githubv4.Client, error)
1515

1616
// Toolset metadata constants - these define all available toolsets and their descriptions.
1717
// Tools use these constants to declare which toolset they belong to.
18+
// Icons are Octicon names from https://primer.style/foundations/icons
1819
var (
1920
ToolsetMetadataAll = inventory.ToolsetMetadata{
2021
ID: "all",
2122
Description: "Special toolset that enables all available toolsets",
23+
Icon: "apps",
2224
}
2325
ToolsetMetadataDefault = inventory.ToolsetMetadata{
2426
ID: "default",
2527
Description: "Special toolset that enables the default toolset configuration. When no toolsets are specified, this is the set that is enabled",
28+
Icon: "check-circle",
2629
}
2730
ToolsetMetadataContext = inventory.ToolsetMetadata{
2831
ID: "context",
2932
Description: "Tools that provide context about the current user and GitHub context you are operating in",
3033
Default: true,
34+
Icon: "person",
3135
}
3236
ToolsetMetadataRepos = inventory.ToolsetMetadata{
3337
ID: "repos",
3438
Description: "GitHub Repository related tools",
3539
Default: true,
40+
Icon: "repo",
3641
}
3742
ToolsetMetadataGit = inventory.ToolsetMetadata{
3843
ID: "git",
3944
Description: "GitHub Git API related tools for low-level Git operations",
45+
Icon: "git-branch",
4046
}
4147
ToolsetMetadataIssues = inventory.ToolsetMetadata{
4248
ID: "issues",
4349
Description: "GitHub Issues related tools",
4450
Default: true,
51+
Icon: "issue-opened",
4552
}
4653
ToolsetMetadataPullRequests = inventory.ToolsetMetadata{
4754
ID: "pull_requests",
4855
Description: "GitHub Pull Request related tools",
4956
Default: true,
57+
Icon: "git-pull-request",
5058
}
5159
ToolsetMetadataUsers = inventory.ToolsetMetadata{
5260
ID: "users",
5361
Description: "GitHub User related tools",
5462
Default: true,
63+
Icon: "people",
5564
}
5665
ToolsetMetadataOrgs = inventory.ToolsetMetadata{
5766
ID: "orgs",
5867
Description: "GitHub Organization related tools",
68+
Icon: "organization",
5969
}
6070
ToolsetMetadataActions = inventory.ToolsetMetadata{
6171
ID: "actions",
6272
Description: "GitHub Actions workflows and CI/CD operations",
73+
Icon: "workflow",
6374
}
6475
ToolsetMetadataCodeSecurity = inventory.ToolsetMetadata{
6576
ID: "code_security",
6677
Description: "Code security related tools, such as GitHub Code Scanning",
78+
Icon: "codescan",
6779
}
6880
ToolsetMetadataSecretProtection = inventory.ToolsetMetadata{
6981
ID: "secret_protection",
7082
Description: "Secret protection related tools, such as GitHub Secret Scanning",
83+
Icon: "shield-lock",
7184
}
7285
ToolsetMetadataDependabot = inventory.ToolsetMetadata{
7386
ID: "dependabot",
7487
Description: "Dependabot tools",
88+
Icon: "dependabot",
7589
}
7690
ToolsetMetadataNotifications = inventory.ToolsetMetadata{
7791
ID: "notifications",
7892
Description: "GitHub Notifications related tools",
93+
Icon: "bell",
7994
}
8095
ToolsetMetadataExperiments = inventory.ToolsetMetadata{
8196
ID: "experiments",
8297
Description: "Experimental features that are not considered stable yet",
98+
Icon: "beaker",
8399
}
84100
ToolsetMetadataDiscussions = inventory.ToolsetMetadata{
85101
ID: "discussions",
86102
Description: "GitHub Discussions related tools",
103+
Icon: "comment-discussion",
87104
}
88105
ToolsetMetadataGists = inventory.ToolsetMetadata{
89106
ID: "gists",
90107
Description: "GitHub Gist related tools",
108+
Icon: "logo-gist",
91109
}
92110
ToolsetMetadataSecurityAdvisories = inventory.ToolsetMetadata{
93111
ID: "security_advisories",
94112
Description: "Security advisories related tools",
113+
Icon: "shield",
95114
}
96115
ToolsetMetadataProjects = inventory.ToolsetMetadata{
97116
ID: "projects",
98117
Description: "GitHub Projects related tools",
118+
Icon: "project",
99119
}
100120
ToolsetMetadataStargazers = inventory.ToolsetMetadata{
101121
ID: "stargazers",
102122
Description: "GitHub Stargazers related tools",
123+
Icon: "star",
103124
}
104125
ToolsetMetadataDynamic = inventory.ToolsetMetadata{
105126
ID: "dynamic",
106127
Description: "Discover GitHub MCP tools that can help achieve tasks by enabling additional sets of tools, you can control the enablement of any toolset to access its tools when this toolset is enabled.",
128+
Icon: "tools",
107129
}
108130
ToolsetLabels = inventory.ToolsetMetadata{
109131
ID: "labels",
110132
Description: "GitHub Labels related tools",
133+
Icon: "tag",
111134
}
112135
)
113136

0 commit comments

Comments
 (0)