Skip to main content
Glama
paragdesai1

Cursor Talk to Figma MCP

by paragdesai1

join_channel

Connect to a Figma channel to enable communication and collaboration between Cursor AI and Figma design files.

Instructions

Join a specific channel to communicate with Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelNoThe name of the channel to join

Implementation Reference

  • Registration of the 'join_channel' MCP tool, including input schema (channel: string) and the handler function that validates input and calls the joinChannel helper.
    server.tool(
      "join_channel",
      "Join a specific channel to communicate with Figma",
      {
        channel: z.string().describe("The name of the channel to join").default(""),
      },
      async ({ channel }) => {
        try {
          if (!channel) {
            // If no channel provided, ask the user for input
            return {
              content: [
                {
                  type: "text",
                  text: "Please provide a channel name to join:",
                },
              ],
              followUp: {
                tool: "join_channel",
                description: "Join the specified channel",
              },
            };
          }
    
          await joinChannel(channel);
          return {
            content: [
              {
                type: "text",
                text: `Successfully joined channel: ${channel}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error joining channel: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
  • The joinChannel helper function implements the core logic: sends a 'join' command via WebSocket to the Figma plugin server with the specified channel name and updates the currentChannel state.
    async function joinChannel(channelName: string): Promise<void> {
      if (!ws || ws.readyState !== WebSocket.OPEN) {
        throw new Error("Not connected to Figma");
      }
    
      try {
        await sendCommandToFigma("join", { channel: channelName });
        currentChannel = channelName;
        logger.info(`Joined channel: ${channelName}`);
      } catch (error) {
        logger.error(`Failed to join channel: ${error instanceof Error ? error.message : String(error)}`);
        throw error;
      }
    }
  • General sendCommandToFigma utility used by joinChannel to send the 'join' websocket message to the Figma plugin, with special handling for join command (no prior channel required).
    function sendCommandToFigma(
      command: FigmaCommand,
      params: unknown = {},
      timeoutMs: number = 30000
    ): Promise<unknown> {
      return new Promise((resolve, reject) => {
        // If not connected, try to connect first
        if (!ws || ws.readyState !== WebSocket.OPEN) {
          connectToFigma();
          reject(new Error("Not connected to Figma. Attempting to connect..."));
          return;
        }
    
        // Check if we need a channel for this command
        const requiresChannel = command !== "join";
        if (requiresChannel && !currentChannel) {
          reject(new Error("Must join a channel before sending commands"));
          return;
        }
    
        const id = uuidv4();
        const request = {
          id,
          type: command === "join" ? "join" : "message",
          ...(command === "join"
            ? { channel: (params as any).channel }
            : { channel: currentChannel }),
          message: {
            id,
            command,
            params: {
              ...(params as any),
              commandId: id, // Include the command ID in params
            },
          },
        };
    
        // Set timeout for request
        const timeout = setTimeout(() => {
          if (pendingRequests.has(id)) {
            pendingRequests.delete(id);
            logger.error(`Request ${id} to Figma timed out after ${timeoutMs / 1000} seconds`);
            reject(new Error('Request to Figma timed out'));
          }
        }, timeoutMs);
    
        // Store the promise callbacks to resolve/reject later
        pendingRequests.set(id, {
          resolve,
          reject,
          timeout,
          lastActivity: Date.now()
        });
    
        // Send the request
        logger.info(`Sending command to Figma: ${command}`);
        logger.debug(`Request details: ${JSON.stringify(request)}`);
        ws.send(JSON.stringify(request));
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool joins a channel but doesn't explain what this entails—whether it requires permissions, affects user state, has side effects like notifications, or what happens on success/failure. This leaves significant gaps for a tool that likely involves user interaction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like what 'join' means operationally, expected outcomes, or error conditions. For a tool that likely interacts with user channels, more context is needed to guide proper usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'channel' parameter documented as 'The name of the channel to join'. The description adds no additional semantic context beyond this, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('join') and resource ('a specific channel'), specifying the purpose as joining a channel to communicate with Figma. It distinguishes from siblings by focusing on channel participation rather than design manipulation, though it doesn't explicitly contrast with similar tools since none exist in the sibling list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description implies usage for communication but doesn't specify prerequisites, context (e.g., after authentication), or exclusions, leaving the agent to infer based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paragdesai1/parag-Figma-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server