Skip to content

Commit dafbd5c

Browse files
Add specific icons for each repository resource type
- repository_content: repo icon - repository_content_branch: git-branch icon - repository_content_commit: git-commit icon (new) - repository_content_tag: tag icon - repository_content_pr: git-pull-request icon Resources now have explicit icons set rather than relying on toolset fallback.
1 parent 3b0611e commit dafbd5c

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

pkg/github/repository_resource.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strconv"
1414
"strings"
1515

16+
"github.com/github/github-mcp-server/pkg/octicons"
1617
"github.com/github/github-mcp-server/pkg/raw"
1718
"github.com/github/github-mcp-server/pkg/registry"
1819
"github.com/github/github-mcp-server/pkg/translations"
@@ -37,6 +38,7 @@ func GetRepositoryResourceContent(t translations.TranslationHelperFunc) registry
3738
Name: "repository_content",
3839
URITemplate: repositoryResourceContentURITemplate.Raw(),
3940
Description: t("RESOURCE_REPOSITORY_CONTENT_DESCRIPTION", "Repository Content"),
41+
Icons: octicons.Icons("repo"),
4042
},
4143
repositoryResourceContentsHandlerFunc(repositoryResourceContentURITemplate),
4244
)
@@ -50,6 +52,7 @@ func GetRepositoryResourceBranchContent(t translations.TranslationHelperFunc) re
5052
Name: "repository_content_branch",
5153
URITemplate: repositoryResourceBranchContentURITemplate.Raw(),
5254
Description: t("RESOURCE_REPOSITORY_CONTENT_BRANCH_DESCRIPTION", "Repository Content for specific branch"),
55+
Icons: octicons.Icons("git-branch"),
5356
},
5457
repositoryResourceContentsHandlerFunc(repositoryResourceBranchContentURITemplate),
5558
)
@@ -63,6 +66,7 @@ func GetRepositoryResourceCommitContent(t translations.TranslationHelperFunc) re
6366
Name: "repository_content_commit",
6467
URITemplate: repositoryResourceCommitContentURITemplate.Raw(),
6568
Description: t("RESOURCE_REPOSITORY_CONTENT_COMMIT_DESCRIPTION", "Repository Content for specific commit"),
69+
Icons: octicons.Icons("git-commit"),
6670
},
6771
repositoryResourceContentsHandlerFunc(repositoryResourceCommitContentURITemplate),
6872
)
@@ -76,6 +80,7 @@ func GetRepositoryResourceTagContent(t translations.TranslationHelperFunc) regis
7680
Name: "repository_content_tag",
7781
URITemplate: repositoryResourceTagContentURITemplate.Raw(),
7882
Description: t("RESOURCE_REPOSITORY_CONTENT_TAG_DESCRIPTION", "Repository Content for specific tag"),
83+
Icons: octicons.Icons("tag"),
7984
},
8085
repositoryResourceContentsHandlerFunc(repositoryResourceTagContentURITemplate),
8186
)
@@ -89,6 +94,7 @@ func GetRepositoryResourcePrContent(t translations.TranslationHelperFunc) regist
8994
Name: "repository_content_pr",
9095
URITemplate: repositoryResourcePrContentURITemplate.Raw(),
9196
Description: t("RESOURCE_REPOSITORY_CONTENT_PR_DESCRIPTION", "Repository Content for specific pull request"),
97+
Icons: octicons.Icons("git-pull-request"),
9298
},
9399
repositoryResourceContentsHandlerFunc(repositoryResourcePrContentURITemplate),
94100
)
324 Bytes
Loading
448 Bytes
Loading

pkg/octicons/octicons_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestEmbeddedIconsExist(t *testing.T) {
108108
expectedIcons := []string{
109109
"apps", "beaker", "bell", "check-circle", "codescan",
110110
"comment-discussion", "copilot", "dependabot", "file", "git-branch",
111-
"git-merge", "git-pull-request", "issue-opened", "logo-gist", "mark-github",
111+
"git-commit", "git-merge", "git-pull-request", "issue-opened", "logo-gist", "mark-github",
112112
"organization", "people", "person", "project", "repo", "repo-forked",
113113
"shield", "shield-lock", "star", "star-fill", "tag", "tools", "workflow",
114114
}

script/fetch-icons

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ DEFAULT_ICONS=(
2525
dependabot
2626
file
2727
git-branch
28+
git-commit
2829
git-merge
2930
git-pull-request
3031
issue-opened

0 commit comments

Comments
 (0)