Skip to content

Commit 8ac1eb4

Browse files
Use typed IconTheme constants from Go SDK
Replace string conversions with mcp.IconThemeLight and mcp.IconThemeDark constants to match the SDK's typed IconTheme field. This fixes the CI build errors where string literals were being used instead of the proper IconTheme type. Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
1 parent b28d7fb commit 8ac1eb4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pkg/octicons/octicons.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ func Icons(name string) []mcp.Icon {
7373
{
7474
Source: DataURI(name, ThemeLight),
7575
MIMEType: "image/png",
76-
Theme: string(ThemeLight),
76+
Theme: mcp.IconThemeLight,
7777
},
7878
{
7979
Source: DataURI(name, ThemeDark),
8080
MIMEType: "image/png",
81-
Theme: string(ThemeDark),
81+
Theme: mcp.IconThemeDark,
8282
},
8383
}
8484
}

pkg/octicons/octicons_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"strings"
55
"testing"
66

7+
"github.com/modelcontextprotocol/go-sdk/mcp"
78
"github.com/stretchr/testify/assert"
89
)
910

@@ -87,13 +88,13 @@ func TestIcons(t *testing.T) {
8788
assert.Equal(t, DataURI(tc.icon, ThemeLight), result[0].Source)
8889
assert.Equal(t, "image/png", result[0].MIMEType)
8990
assert.Empty(t, result[0].Sizes) // Sizes field omitted for backward compatibility
90-
assert.Equal(t, "light", result[0].Theme)
91+
assert.Equal(t, mcp.IconThemeLight, result[0].Theme)
9192

9293
// Verify second icon is dark theme
9394
assert.Equal(t, DataURI(tc.icon, ThemeDark), result[1].Source)
9495
assert.Equal(t, "image/png", result[1].MIMEType)
9596
assert.Empty(t, result[1].Sizes) // Sizes field omitted for backward compatibility
96-
assert.Equal(t, "dark", result[1].Theme)
97+
assert.Equal(t, mcp.IconThemeDark, result[1].Theme)
9798
})
9899
}
99100
}

0 commit comments

Comments
 (0)