Commit 6b3c375
authored
feat: Add Octicon icons to MCP tools, resources, and prompts (#1603)
* Upgrade MCP Go SDK to v1.2.0-pre.1 and add Octicon icons to tools
- Upgrade MCP Go SDK from v1.1.0 to v1.2.0-pre.1 for Icon support
- Add Icon field to ToolsetMetadata for Octicon name assignment
- Add OcticonURL() helper to generate CDN URLs for Octicon SVGs
- Add Icons() method on ToolsetMetadata to generate MCP Icon objects
- Apply icons automatically in RegisterFunc when tool is registered
- Add icons to all 22 toolset metadata constants with appropriate Octicons
- Update server.go to use new Capabilities API (fixes deprecation warnings)
This demonstrates how the toolsets refactor makes adding new features simpler:
icons are defined once in ToolsetMetadata and automatically applied to all
tools in that toolset during registration.
* Update third-party licenses for SDK upgrade
* Address review feedback: enum size validation, mutation fix, tests
- Replace runtime size validation with compile-time enum type (Size with SizeSM=16, SizeLG=24)
- Fix RegisterFunc mutation by making shallow copy of tool before modifying Icons
- Add comprehensive tests for octicons package (URL, Icons, Size constants)
- Add toolsets tests for ToolsetMetadata.Icons(), RegisterFunc mutation prevention,
and existing icon preservation
- Improve icon choices for better visual semantics:
- actions: play → workflow (more specific to GitHub Actions)
- secret_protection: key → shield-lock (better represents protection)
- gists: code → logo-gist (dedicated gist icon exists)
* Add GitHub mark icon to server metadata
Add the mark-github octicon to the server's Implementation struct
so that MCP clients can display the GitHub logo for this server.
The icon is provided in both 16x16 and 24x24 SVG sizes.
* Fix rebase conflicts: use Registry methods and NullTranslationHelper
- Remove duplicate old toolsets functions (AvailableToolsets, GetValidToolsetIDs, GetDefaultToolsetIDs)
- Use Registry.AvailableToolsets() and Registry.HasToolset() instead
- Replace stubTranslator with translations.NullTranslationHelper
- Use new SDK Capabilities struct instead of deprecated HasTools/HasResources/HasPrompts
- Add icon-related tests to registry_test.go
* Use embedded data URIs for Octicon icons
- Embed SVG icons using go:embed for offline use and faster loading
- Convert icons to base64 data URIs at runtime
- Fall back to CDN URL for non-embedded icons
- Add test to verify all toolset icons are properly embedded
- 44 SVG files (22 icons × 2 sizes) totaling ~27KB
* Convert icons from SVG to PNG for MCP client compatibility
MCP clients don't support SVG data URIs, so convert all embedded icons
to PNG format using rsvg-convert.
Changes:
- Convert all 44 SVG icons to PNG format
- Add 8 new icons: copilot, git-merge, repo-forked, star-fill
- Update octicons.go to use PNG MIME type
- Add script/fetch-icons for easy icon management
- Update tests and toolsnaps for PNG format
* Add mark-github icon for server metadata
* Add light/dark theme icons for tools, resources, and prompts
- Switch from size-based (16/24px) to theme-based (light/dark) icons
- Use only 16x16 icons for smaller bundle size
- Generate white (inverted) icons for dark theme backgrounds
- Add icons to resources and prompts (auto-applied from toolset metadata)
- Add 'file' icon for repository content resources
- Update fetch-icons script to generate both theme variants
* Use 24px icons with SVG fill modification for themes
- Switch from 16px to 24px icons for better visibility
- Use SVG fill attribute (#24292f for light, #ffffff for dark) instead
of ImageMagick color inversion for cleaner theme variants
- Remove ImageMagick dependency from fetch-icons script
* 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.
* 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
* feat: add icons to individual tools in documentation
* fix: use repo-local icons with picture element for GitHub theme support
- Reference icons from pkg/octicons/icons/ instead of external CDN
- Use picture element with prefers-color-scheme for light/dark mode
- GitHub markdown renderer will display these correctly
* fix: remove redundant icons from individual tools
Icons are kept on section headers and toolsets table only - having the same
icon on every tool within a section was visually noisy and redundant.
* Add icons to remote server toolsets documentation
* Fix icon paths for docs/remote-server.md
* Add remote-only toolsets with auto-generated documentation and icons guide
- Add ToolsetMetadataCopilot, ToolsetMetadataCopilotSpaces, ToolsetMetadataSupportSearch
- Add RemoteOnlyToolsets() function to return remote-only toolset metadata
- Update doc generator to auto-generate remote-only toolsets table with icons
- Create docs/toolsets-and-icons.md explaining how to add icons to toolsets
- Add link to icons guide in CONTRIBUTING.md
* Add icon validation tests and single source of truth for required icons
- Add pkg/octicons/required_icons.txt as single source of truth for icons
- Add RequiredIcons() function to read the required icons list
- Update script/fetch-icons to read from required_icons.txt
- Update octicons_test.go to use RequiredIcons() instead of hardcoded list
- Add pkg/github/toolset_icons_test.go with:
- TestAllToolsetIconsExist: validates all toolset icons are embedded
- TestToolsetMetadataHasIcons: ensures all toolsets have icons set
- Add 'book' icon for SupportSearch toolset
- Update docs/toolsets-and-icons.md with fetch-icons and CI validation docs
* fix: remove unused icon parameter from writeToolDoc
- Remove unused 'icon' parameter from writeToolDoc function signature
- Fix whitespace inconsistency in octicons_test.go
- Fixes lint failure: unused-parameter revive error
* fix: combine icon with name column in remote docs for proper table rendering
- Move icon from separate column to Name column with <br> separator
- Keep <picture> element for light/dark theme support
- Remove empty icon column that was collapsing to zero width
- Remove unused octiconSimpleImg function1 parent bc5d08d commit 6b3c375
File tree
89 files changed
+974
-93
lines changed- cmd/github-mcp-server
- docs
- internal/ghmcp
- pkg
- github
- __toolsnaps__
- inventory
- octicons
- icons
- script
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
89 files changed
+974
-93
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
107 | 133 | | |
108 | 134 | | |
109 | 135 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
113 | 139 | | |
114 | 140 | | |
115 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
116 | 144 | | |
117 | 145 | | |
118 | 146 | | |
119 | 147 | | |
120 | | - | |
| 148 | + | |
| 149 | + | |
121 | 150 | | |
122 | 151 | | |
123 | 152 | | |
| |||
134 | 163 | | |
135 | 164 | | |
136 | 165 | | |
| 166 | + | |
137 | 167 | | |
138 | 168 | | |
139 | 169 | | |
| |||
145 | 175 | | |
146 | 176 | | |
147 | 177 | | |
148 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
149 | 183 | | |
150 | 184 | | |
151 | 185 | | |
| |||
154 | 188 | | |
155 | 189 | | |
156 | 190 | | |
| 191 | + | |
157 | 192 | | |
158 | 193 | | |
159 | 194 | | |
| |||
190 | 225 | | |
191 | 226 | | |
192 | 227 | | |
193 | | - | |
| 228 | + | |
194 | 229 | | |
195 | 230 | | |
196 | 231 | | |
| |||
302 | 337 | | |
303 | 338 | | |
304 | 339 | | |
305 | | - | |
306 | | - | |
307 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
308 | 343 | | |
309 | 344 | | |
310 | | - | |
| 345 | + | |
| 346 | + | |
311 | 347 | | |
312 | 348 | | |
313 | 349 | | |
| |||
329 | 365 | | |
330 | 366 | | |
331 | 367 | | |
332 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
333 | 371 | | |
334 | 372 | | |
335 | 373 | | |
336 | 374 | | |
337 | | - | |
| 375 | + | |
338 | 376 | | |
339 | 377 | | |
340 | 378 | | |
341 | 379 | | |
342 | 380 | | |
343 | 381 | | |
344 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
345 | 423 | | |
346 | 424 | | |
347 | 425 | | |
| |||
0 commit comments