跳转到内容

Connection

管理 Figma 插件连接。

Type reference
// Connection manages the WebSocket link between the MCP server and the Figma plugin.
// Channels are named rooms — both the MCP server and Figma plugin must join the same channel to communicate.
// Workflow: connection(method:"create") to join a channel → connection(method:"get") to verify Figma plugin is connected.
// If get times out (5s), the Figma plugin is not running or not on the same channel.
// list shows all active channels and their connected clients. delete factory-resets a channel.

4 methods available.

Join a relay channel (required first step before any other tool)

ParameterTypeRequiredDescription
channelstringThe channel name displayed in the Figma plugin panel. Defaults to 'vibma' if omitted. (default: "vibma")

Response

Confirmation message with channel and port

FieldTypeDescription
resultstringConfirmation message with channel and port
Example response
"Joined channel \"vibma\" on port 3055. Call connection(method: \"get\") to verify the Figma plugin is connected."

Verify end-to-end connection to Figma

No parameters.

Response

FieldTypeDescription
status"pong"
documentNamestringActive Figma document name
currentPagestringCurrent page name
timestampnumberUnix timestamp
Example response
{
"status": "pong",
"documentName": "Design System",
"currentPage": "Components",
"timestamp": 1709337600
}

Inspect which clients (MCP, plugin) are connected to each channel

No parameters.

Disconnect all clients (MCP server and Figma plugin) from a channel and reset its state

ParameterTypeRequiredDescription
channelstringChannel to reset. Defaults to 'vibma'. (default: "vibma")

Response

Confirmation of tunnel reset

FieldTypeDescription
resultstringConfirmation of tunnel reset
Example response
"Channel vibma reset"