Skip to content

Commit 71e7884

Browse files
authored
feat: add theme field to Icon type for light/dark mode support (#1978)
1 parent 6f8b791 commit 71e7884

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/mcp/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
GetTaskRequestParams,
7171
GetTaskResult,
7272
Icon,
73+
IconTheme,
7374
ImageContent,
7475
Implementation,
7576
IncludeContext,
@@ -275,6 +276,7 @@
275276
"BlobResourceContents",
276277
"EmbeddedResource",
277278
"Icon",
279+
"IconTheme",
278280
"ImageContent",
279281
"ResourceContents",
280282
"ResourceLink",

src/mcp/types/_types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
ProgressToken = str | int
2929
Role = Literal["user", "assistant"]
3030

31+
IconTheme = Literal["light", "dark"]
32+
3133
TaskExecutionMode = Literal["forbidden", "optional", "required"]
3234
TASK_FORBIDDEN: Final[Literal["forbidden"]] = "forbidden"
3335
TASK_OPTIONAL: Final[Literal["optional"]] = "optional"
@@ -170,6 +172,15 @@ class Icon(MCPModel):
170172
sizes: list[str] | None = None
171173
"""Optional list of strings specifying icon dimensions (e.g., ["48x48", "96x96"])."""
172174

175+
theme: IconTheme | None = None
176+
"""Optional theme specifier.
177+
178+
`"light"` indicates the icon is designed for a light background, `"dark"` indicates the icon
179+
is designed for a dark background.
180+
181+
See https://modelcontextprotocol.io/specification/2025-11-25/schema#icon for more details.
182+
"""
183+
173184

174185
class Implementation(BaseMetadata):
175186
"""Describes the name and version of an MCP implementation."""

0 commit comments

Comments
 (0)