MCP Apps Kit - v0.5.0
    Preparing search index...

    Function iconFromFile

    • Create an Icon object from a local image file.

      Reads the file, converts it to a base64 data URI, and returns an Icon object ready for use in createApp configuration.

      Size limit: Files must be under 1MB. For larger images, host them externally and use a URL instead. Consider using SVG for logos (smaller size, scalable).

      Parameters

      • filePath: string

        Path to the image file (absolute or relative to cwd)

      • options: IconFromFileOptions = {}

        Optional icon configuration (sizes, theme, mimeType override)

      Returns Icon

      Icon object with base64 data URI

      import { createApp, iconFromFile } from "@mcp-apps-kit/core";

      const app = createApp({
      name: "my-app",
      version: "1.0.0",
      icons: [iconFromFile("./assets/icon.png")],
      tools: { ... }
      });
      const app = createApp({
      name: "my-app",
      version: "1.0.0",
      icons: [
      iconFromFile("./assets/icon-48.png", { sizes: ["48x48"] }),
      iconFromFile("./assets/icon-dark.png", { theme: "dark" }),
      iconFromFile("./assets/icon.svg", { sizes: ["any"] }),
      ],
      tools: { ... }
      });

      Error if the file cannot be read, exceeds size limit, or has an unsupported extension