Skip to main content

Overview

Channels provide message isolation in Talk to Figma MCP, allowing multiple users to run MCP servers and Figma plugins simultaneously on the same machine without interfering with each other.

Why Channels?

Without channels, all messages would be broadcast to all connected clients, causing:
  • Message confusion: Commands intended for one Figma instance reach another
  • Response conflicts: Responses from one plugin resolve promises in another server
  • Security issues: Users could see or interfere with each other’s work
Channels solve this by creating isolated communication rooms where only clients in the same channel can exchange messages.

Channel Lifecycle

1. Joining a Channel

Before sending any commands, clients must join a channel:
The relay creates the channel if it doesn’t exist:
socket.ts

2. Channel Storage

The relay maintains a Map of channels to client sets:
socket.ts

3. Sending Messages

Once in a channel, clients can send messages that are broadcast only within that channel:
socket.ts
Messages are not echoed back to the sender. This prevents request-response loops and ensures clean message flow.

4. Leaving a Channel

When a client disconnects, they’re automatically removed from all channels:
socket.ts

MCP Server Channel Integration

The MCP server tracks its current channel and requires joining before sending commands:
server.ts

Channel Naming Best Practices

Project-Based

Use project names for isolation

Team-Based

Use team identifiers

Feature-Based

Use feature branches

User-Based

Use usernames for personal work
Choose channel names that are descriptive and unique within your team to avoid accidental conflicts.

Multi-Client Scenarios

Scenario 1: Single User, Multiple Devices

A user working on the same project from different locations:
Only the active Figma plugin responds to commands.

Scenario 2: Team Collaboration

Multiple users on different projects:
Messages never cross between channels.

Scenario 3: Paired Development

Two developers working on the same design:
Both servers can send commands to the same plugin.
Be cautious with multiple servers in one channel — they can issue conflicting commands to the same Figma instance.

Channel Security

Current Model

Channels provide isolation, not authentication:
  • Anyone who knows a channel name can join it
  • No password or token required
  • Suitable for localhost-only deployments
The relay is designed for local development, not production use. All WebSocket connections are unauthenticated.

Future Enhancements

Potential security improvements:
  • Channel tokens: Require secret tokens to join channels
  • User authentication: Integrate with identity providers
  • Access control: Role-based permissions per channel
  • Audit logging: Track all channel activity

Using the join_channel Tool

AI agents use the join_channel tool before issuing Figma commands:

Example Usage

Troubleshooting

”Must join a channel before sending commands”

Cause: Attempting to send commands without joining a channel first. Solution:

“No other clients in channel to receive message”

Cause: The Figma plugin hasn’t joined the same channel. Solution:
  1. Open the Figma plugin UI
  2. Connect to the relay server
  3. Join the same channel name as your MCP server

Messages Not Received

Cause: MCP server and Figma plugin are in different channels. Solution: Verify both clients joined the exact same channel name (case-sensitive):

Channel State Management

The relay automatically handles channel cleanup:
socket.ts
Channels persist in memory even when empty. Restart the relay server (bun socket) to clear all channels.

Next Steps

System Architecture

Understand the full three-component pipeline

WebSocket Relay

Learn about relay server configuration