Class McpToolIconUtils

java.lang.Object
io.meeds.mcp.server.util.McpToolIconUtils

public final class McpToolIconUtils extends Object
Turns the Font Awesome icon name an add-on declares for a tool (fa-clipboard) into the standard MCP tool icon external clients display: the matching Font Awesome Free solid SVG, bundled in this module under "mcp-tool-icons/fa-solid/", inlined as a data:image/svg+xml URI with a mid-grey fill that reads on light and dark backgrounds. Only the bundled SVGs are served: a name with no bundled file gives no icon.
  • Field Details

    • ICONS_PATH

      public static final String ICONS_PATH
      The classpath folder of the bundled Font Awesome Free solid SVGs.
      See Also:
    • MAX_ICON_BYTES

      public static final int MAX_ICON_BYTES
      The largest SVG file inlined, in bytes.
      See Also:
    • ICON_FILL

      public static final String ICON_FILL
      The fill given to the icon, readable on light and dark backgrounds.
      See Also:
  • Method Details

    • toMcpIcons

      public static List<io.modelcontextprotocol.spec.McpSchema.Icon> toMcpIcons(String iconName)
      Parameters:
      iconName - a Font Awesome icon name, such as fa-clipboard
      Returns:
      the MCP icons of that name: one data URI icon, or an empty list when the name is blank, malformed, or has no bundled SVG