From 7be092848e8da9b477df3059e1e76288d69e7915 Mon Sep 17 00:00:00 2001 From: Guillaume FORTAINE Date: Fri, 30 Jan 2026 14:30:14 +0100 Subject: [PATCH] feat: add theme field to Icon type for light/dark mode support Add IconTheme type alias and theme field to the Icon class for parity with the Go SDK. This allows servers to specify whether an icon is designed for a light or dark background, enabling clients to select the appropriate icon based on their UI theme. Closes #1977 --- src/mcp/types/__init__.py | 2 ++ src/mcp/types/_types.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/mcp/types/__init__.py b/src/mcp/types/__init__.py index 666defaa2..b44230393 100644 --- a/src/mcp/types/__init__.py +++ b/src/mcp/types/__init__.py @@ -70,6 +70,7 @@ GetTaskRequestParams, GetTaskResult, Icon, + IconTheme, ImageContent, Implementation, IncludeContext, @@ -275,6 +276,7 @@ "BlobResourceContents", "EmbeddedResource", "Icon", + "IconTheme", "ImageContent", "ResourceContents", "ResourceLink", diff --git a/src/mcp/types/_types.py b/src/mcp/types/_types.py index 26dfde7a6..42036eed7 100644 --- a/src/mcp/types/_types.py +++ b/src/mcp/types/_types.py @@ -28,6 +28,8 @@ ProgressToken = str | int Role = Literal["user", "assistant"] +IconTheme = Literal["light", "dark"] + TaskExecutionMode = Literal["forbidden", "optional", "required"] TASK_FORBIDDEN: Final[Literal["forbidden"]] = "forbidden" TASK_OPTIONAL: Final[Literal["optional"]] = "optional" @@ -170,6 +172,10 @@ class Icon(MCPModel): sizes: list[str] | None = None """Optional list of strings specifying icon dimensions (e.g., ["48x48", "96x96"]).""" + theme: IconTheme | None = None + """Optional theme specifier. 'light' indicates the icon is designed for a light + background, 'dark' indicates the icon is designed for a dark background.""" + class Implementation(BaseMetadata): """Describes the name and version of an MCP implementation."""