Skip to main content

Overview

Exports a Figma node as an image in one of the supported formats: PNG, JPG, SVG, or PDF. The exported image is returned as base64-encoded data that can be displayed or saved.

Usage

const result = await mcp.use_mcp_tool({
  server_name: "TalkToFigma",
  tool_name: "export_node_as_image",
  arguments: {
    nodeId: "123:456",
    format: "PNG",
    scale: 2
  }
});

Parameters

nodeId
string
required
The ID of the node to export
format
enum
default:"PNG"
Export format. Supported values:
  • PNG - Portable Network Graphics (default)
  • JPG - JPEG format
  • SVG - Scalable Vector Graphics
  • PDF - Portable Document Format
scale
number
default:"1"
Export scale multiplier. Use higher values (e.g., 2 or 3) for higher resolution exports.Common scale values:
  • 1 - Standard resolution
  • 2 - Retina/2x resolution
  • 3 - 3x resolution for high-DPI displays

Response

The tool returns an image content block with:
  • imageData - Base64-encoded image data
  • mimeType - MIME type corresponding to the format (e.g., image/png, image/jpeg, image/svg+xml, application/pdf)

Format-Specific Notes

PNG

  • Supports transparency
  • Lossless compression
  • Best for UI elements, icons, and designs with sharp edges

JPG

  • No transparency support
  • Lossy compression
  • Best for photographs and complex images with gradients

SVG

  • Vector format (resolution-independent)
  • Scale parameter is ignored
  • Best for scalable graphics and icons
  • Preserves editability

PDF

  • Vector format when possible
  • Preserves layers and structure
  • Best for print-ready exports

Example Workflows

Export for Web (2x Retina)

const webExport = await mcp.use_mcp_tool({
  server_name: "TalkToFigma",
  tool_name: "export_node_as_image",
  arguments: {
    nodeId: "123:456",
    format: "PNG",
    scale: 2  // 2x for retina displays
  }
});

Export Vector Asset

const vectorExport = await mcp.use_mcp_tool({
  server_name: "TalkToFigma",
  tool_name: "export_node_as_image",
  arguments: {
    nodeId: "123:456",
    format: "SVG"  // Scale not needed for vector
  }
});

Export Multiple Sizes

const scales = [1, 2, 3];
for (const scale of scales) {
  await mcp.use_mcp_tool({
    server_name: "TalkToFigma",
    tool_name: "export_node_as_image",
    arguments: {
      nodeId: "123:456",
      format: "PNG",
      scale
    }
  });
}

Build docs developers (and LLMs) love