Icons returns MCP Icon objects for the given octicon name in light and dark themes. Icons are embedded as 24x24 PNG data URIs for offline use and faster loading. The name should be the base octicon name without size suffix (e.g., "repo" not "repo-16"). See https://primer.style/foundations/icons for
(name string)
| 66 | // Note: The Sizes field is omitted for backward compatibility with older MCP clients |
| 67 | // that expect it to be a string rather than an array per the 2025-11-25 MCP spec. |
| 68 | func Icons(name string) []mcp.Icon { |
| 69 | if name == "" { |
| 70 | return nil |
| 71 | } |
| 72 | return []mcp.Icon{ |
| 73 | { |
| 74 | Source: DataURI(name, ThemeLight), |
| 75 | MIMEType: "image/png", |
| 76 | Theme: mcp.IconThemeLight, |
| 77 | }, |
| 78 | { |
| 79 | Source: DataURI(name, ThemeDark), |
| 80 | MIMEType: "image/png", |
| 81 | Theme: mcp.IconThemeDark, |
| 82 | }, |
| 83 | } |
| 84 | } |