Skip to content

Conversation

@SamMorrowDrums
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums commented Dec 13, 2025

Summary

Adds Octicon icons to all MCP tools, resources, and prompts for better visual identification in MCP clients.

Changes

  • Upgrade MCP Go SDK to v1.2.0-pre.1 which includes the Icons field support
  • Add Icon field to ToolsetMetadata - each toolset can specify an Octicon name
  • Create pkg/octicons package - handles icon loading and data URI generation
  • Light/dark theme support - icons are provided in both themes for client compatibility
  • Automatic icon inheritance - tools/resources/prompts inherit icons from their toolset if not explicitly set
  • Custom icons for repository resources - different icons for files, commits, branches, etc.

Icon Assignment

Toolset Icon
context person
repos repo
git git-branch
issues issue-opened
pull_requests git-pull-request
users people
orgs organization
actions workflow
code_security codescan
secret_protection shield-lock
dependabot dependabot
notifications bell
experiments beaker
discussions comment-discussion
gists logo-gist
security_advisories shield
projects project
stargazers star
dynamic tools
labels tag

Testing

  • All existing tests pass
  • Added tests for octicons package
  • Verified icons display correctly in VS Code MCP client

Notes

  • Icons are embedded as base64 data URIs (PNG format) for maximum client compatibility
  • Uses 24px icons from Octicons with theme-appropriate colors (light icons for dark theme, dark for light)

@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner December 13, 2025 23:22
Copilot AI review requested due to automatic review settings December 13, 2025 23:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Octicon icons to all MCP tools by upgrading the MCP Go SDK from v1.1.0 to v1.2.0-pre.1 and implementing icon infrastructure that automatically applies icons based on toolset metadata.

Key Changes

  • Upgraded MCP Go SDK to v1.2.0-pre.1 to enable Icons field support
  • Added icon infrastructure in pkg/toolsets/server_tool.go with automatic icon application during tool registration
  • Assigned appropriate Octicon icons to all 22 toolset metadata constants

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
go.mod Upgraded modelcontextprotocol/go-sdk from v1.1.0 to v1.2.0-pre.1
go.sum Updated checksums for SDK upgrade and new golang-jwt/jwt/v5 dependency
pkg/github/server.go Migrated from deprecated HasTools/HasResources/HasPrompts to new Capabilities API structure
pkg/toolsets/server_tool.go Added Icon field to ToolsetMetadata, OcticonURL helper, Icons() method, and automatic icon application in RegisterFunc
pkg/github/tools.go Assigned Octicon icon names to all 22 toolset metadata constants

Copy link

@bretthowell714-source bretthowell714-source left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@SamMorrowDrums SamMorrowDrums force-pushed the SamMorrowDrums/server-tool-refactor-toolsets branch 6 times, most recently from a536c15 to 6b6a874 Compare December 14, 2025 23:50
@SamMorrowDrums SamMorrowDrums force-pushed the SamMorrowDrums/add-icons-to-tools branch 5 times, most recently from 813b441 to 29583e1 Compare December 15, 2025 22:42
@SamMorrowDrums SamMorrowDrums changed the base branch from SamMorrowDrums/server-tool-refactor-toolsets to SamMorrowDrums/registry-builder-pattern December 15, 2025 22:42
Base automatically changed from SamMorrowDrums/registry-builder-pattern to SamMorrowDrums/server-tool-refactor-toolsets December 16, 2025 18:53
Base automatically changed from SamMorrowDrums/server-tool-refactor-toolsets to SamMorrowDrums/server-tool-refactor-projects December 16, 2025 19:01
Base automatically changed from SamMorrowDrums/server-tool-refactor-projects to SamMorrowDrums/server-tool-refactor-security-advisories December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-security-advisories to SamMorrowDrums/server-tool-refactor-discussions December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-discussions to SamMorrowDrums/server-tool-refactor-code-scanning December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-code-scanning to SamMorrowDrums/server-tool-refactor-git December 16, 2025 19:02
Base automatically changed from SamMorrowDrums/server-tool-refactor-git to SamMorrowDrums/server-tool-refactor-actions December 16, 2025 19:03
Base automatically changed from SamMorrowDrums/server-tool-refactor-actions to SamMorrowDrums/server-tool-refactor-pullrequests December 16, 2025 19:03
Base automatically changed from SamMorrowDrums/server-tool-refactor-pullrequests to SamMorrowDrums/server-tool-refactor-issues December 16, 2025 19:36
Base automatically changed from SamMorrowDrums/server-tool-refactor-issues to SamMorrowDrums/server-tool-refactor-repositories December 16, 2025 19:38
Base automatically changed from SamMorrowDrums/server-tool-refactor-repositories to SamMorrowDrums/server-tool-refactor-notifications December 16, 2025 20:32
@SamMorrowDrums SamMorrowDrums force-pushed the SamMorrowDrums/server-tool-refactor-notifications branch from 33662a0 to daee6b8 Compare December 16, 2025 20:44
Base automatically changed from SamMorrowDrums/server-tool-refactor-notifications to SamMorrowDrums/server-tool-refactor December 16, 2025 20:53
Base automatically changed from SamMorrowDrums/server-tool-refactor to main December 17, 2025 08:56
- 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.
- 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 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.
- 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
- 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
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
- 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
- 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
- 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.
@SamMorrowDrums SamMorrowDrums changed the title Add Octicon icons to MCP tools feat: Add Octicon icons to MCP tools, resources, and prompts Dec 17, 2025
@SamMorrowDrums SamMorrowDrums force-pushed the SamMorrowDrums/add-icons-to-tools branch from dafbd5c to 163e134 Compare December 17, 2025 09:19
- 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
- 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
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.
…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 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
- Remove unused 'icon' parameter from writeToolDoc function signature
- Fix whitespace inconsistency in octicons_test.go
- Fixes lint failure: unused-parameter revive error
…ndering

- 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 function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants