Skip to content

Conversation

@SamMorrowDrums
Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums commented Dec 13, 2025

Summary

This PR adds Octicon icons to all MCP tools, using the new Icons field added in MCP Go SDK v1.2.0-pre.1.

Stacked on #1602 (toolsets refactor) - demonstrates how the refactored architecture makes adding new cross-cutting features simpler.

Changes

SDK Upgrade

  • Upgrade MCP Go SDK from v1.1.0 to v1.2.0-pre.1 (adds Icons field on Tool struct)
  • Update NewServer() to use new Capabilities API instead of deprecated HasTools/HasResources/HasPrompts fields

Icon Infrastructure (pkg/toolsets/server_tool.go)

  • Add Icon field to ToolsetMetadata for storing Octicon name
  • Add OcticonURL(name, size) helper to generate CDN URLs for Octicon SVGs
  • Add Icons() method on ToolsetMetadata that returns []mcp.Icon (16x16 and 24x24 sizes)
  • Update RegisterFunc() to automatically apply icons from toolset metadata when registering tools

Icon Assignments (pkg/github/tools.go)

All 22 toolset metadata constants now have appropriate Octicon icons:

  • reposrepo, issuesissue-opened, pull_requestsgit-pull-request
  • actionsplay, code_securitycodescan, dependabotdependabot
  • notificationsbell, discussionscomment-discussion
  • And more...

The chosen icons:

Screenshot from 2025-12-14 12-19-26 Screenshot from 2025-12-14 12-19-06 Screenshot from 2025-12-14 12-18-58 Screenshot from 2025-12-14 12-18-47

Why the Refactor Makes This Easier

Before refactor: Would need to call SetIcons() on every toolset creation in DefaultToolsetGroup(), or modify each individual tool definition.

After refactor: Simply add Icon field to ToolsetMetadata in one place, and icons are automatically applied to all tools via RegisterFunc(). The self-describing nature of ServerTool with embedded ToolsetMetadata enables this clean architecture.

Testing

  • All existing tests pass
  • Icons are served from GitHub's Octicon CDN at raw.githubusercontent.com/primer/octicons/main/icons/

Related

- 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.
@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

- 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)
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

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