MCP Gateway · OpenCode
Connect Figma to OpenCode
Terminal-first developers still need to check a design now and then. With Figma added as a remote server, OpenCode can grab a screenshot of a node, read its design context and confirm which account it's using. The OpenCode plugin sends each prompt and tool call to Speakeasy, and the device agent can install and maintain the observability package.
- Category
- Design
- Tools
- 17
- Authentication
- OAuth
- OpenCode
- Terminal
Behind the MCP Gateway
Run Figma MCP behind the MCP Gateway
One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every Figma call inspected and logged.
Set up
Add Figma to OpenCode in 4 steps
- 01
Add Figma from the catalog
An admin finds Figma in the MCP Catalog (MCP Gateway > MCP > Catalog) and clicks Add. Speakeasy registers the vendor's server as a remote MCP server and proxies sessions to it. Nothing is copied or re-hosted.
Figma uses OAuth. Servers that support dynamic client registration get their OAuth configuration applied automatically.
Where MCP-scoped policies are enabled, the install offers a recommended risk policy for the new server that detects secrets and PII and inspects tool requests and responses.
- 02
Choose who can use Figma
Give teams the
mcp:connectscope on the Figma server through team access or a role. OpenCode connects to the Figma server's own URL, and the server's authorization decides who can connect and which tools they can call. - 03
Connect OpenCode
Add the server to OpenCode's own mcp config block as a remote server.
Copy the server's URL from its hosted install page in Speakeasy.
Add it to the
mcpblock of your OpenCode config withtypeset toremote.Restart OpenCode and sign in when prompted.
{ "mcp": { "<server slug>": { "type": "remote", "url": "<URL from the hosted install page>" } } } - 04
Sign in and use Figma from OpenCode
The first time OpenCode connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.
Figma needs its own OAuth grant, so each person connects it once. Until they do, Figma calls fail while the rest of the gateway keeps working.
From then on, Figma's tools appear in OpenCode, limited to what the person's access allows, and every call lands in the gateway's tool logs.
OpenCode doesn't receive MCP servers from plugins. The observability package is installed separately, from a ZIP or with speakeasy-hooks install --provider=opencode, and the device agent can maintain it.
Use cases
What OpenCode users do with Figma
Compare a build against the design
Ask OpenCode for a screenshot of the Figma node you're implementing, then check spacing and copy against what your page renders locally.
Scaffold a component from a node
Give OpenCode a Figma URL and it reads the node's design context, then creates the component file using patterns already in your project.
Sort out a permissions error
If a Figma call fails on permissions, OpenCode can check which user is authenticated, so you know whether the wrong account is signed in.
Tools
17 tools
Each Figma tool can be allowed or denied per team and role at the MCP Gateway before OpenCode sees it.
get_screenshot
Generate a screenshot for a given node or the currently selected node in the Figma desktop app. Use the nodeId parameter to specify a node id. nodeId parameter is REQUIRED. Use the fileKey parameter to specify the file key. fileKey parameter is REQUIRED.
create_design_system_rules
Provides a prompt to generate design system rules for this repo.
get_design_context
Get design context for a Figma node — the primary tool for design-to-code workflows. Returns reference code, a screenshot, and contextual metadata that should be adapted to the target project. See the server instructions for how to interpret and adapt the response.
get_metadata
IMPORTANT: Always prefer to use get_design_context tool. Get metadata for a node or page in the Figma desktop app in XML format. Useful only for getting an overview of the structure, it only includes node IDs, layer types, names, positions and sizes.
get_variable_defs
Get variable definitions for a given node id. g. {'icon/default/secondary': #949494}Variables are reusable values that can be applied to all kinds of design properties, such as fonts, colors, sizes and spacings. Use the nodeId parameter to specify a node id.
get_figjam
Generate UI code for a given FigJam node in Figma. Use the nodeId parameter to specify a node id. If no node id is provided, use 0:1 which is the root node ID. Use the fileKey parameter to specify the file key.
Control
What Speakeasy can see and stop in OpenCode
The gateway covers every client the same way. The rest depends on what OpenCode exposes to Speakeasy.
Tool logs
Gateway
Every Figma call is logged with the person and the client that made it.
Access by role
Gateway
People reach only the Figma tools their team or role allows.
Request and response blocking
Gateway
A risk policy scoped to Figma can reject a tool request before it reaches the server, or withhold a result from OpenCode. MCP-scoped policies are enabled per organization.
Prompt and tool-call blocking
OpenCode
The OpenCode plugin sends each prompt and tool call to Speakeasy, which allows or denies it before it runs.
Usage telemetry
OpenCode
Token and cost totals flow through the plugin, reported per turn.
Device agent
OpenCode
The device agent installs and maintains the observability package.
- OpenCode has no OpenTelemetry exporter, so session data comes through the plugin.
- Tool output is blocked at the gateway rather than in OpenCode's hooks.
Questions
Frequently asked questions
Can OpenCode receive Figma through a plugin?
Does Figma tool output pass through OpenCode's hooks?
How do OpenCode users get Figma?
Are Figma calls from OpenCode logged?
Connect more