Skip to main content
Back to the Figma MCP server

MCP Gateway · Codex

Figma icon

Connect Figma to Codex

Codex can take a design task end to end when it can read the design. Figma gives it component properties, variants and existing Code Connect links, so the code it writes lines up with the file designers maintain. Speakeasy's agent hooks allow or deny each tool call before Codex runs it, and spend limits can block Codex traffic once a budget is reached.

Category
Design
Tools
17
Authentication
OAuth
Codex
CLI and ChatGPT desktop app

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.

Deploy on MCP Gateway

Set up

Add Figma to Codex in 4 steps

  1. 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.

  2. 02

    Choose who can use Figma

    Give teams the mcp:connect scope on the Figma server through team access or a role. The organization gateway works out each person's servers from their live access, so granting access adds Figma to their gateway on the next call, and removing it takes it away.

  3. 03

    Connect Codex

    Add the gateway as an MCP server, then log in.

    Run the first command with your organization gateway URL.

    Run the second command to sign in.

    codex mcp add 'speakeasy' \
      --url 'https://<organization host>/mcp/gateway/<organization slug>'
    codex mcp login 'speakeasy'
  4. 04

    Sign in and use Figma from Codex

    The first time Codex 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 Codex, limited to what the person's access allows, and every call lands in the gateway's tool logs.

To roll it out to a team, a ChatGPT workspace admin imports the plugin marketplace under Admin > Plugins and sets an installation policy per role. Imported plugins reach nobody until a policy is set.

Use cases

What Codex users do with Figma

Write Code Connect templates

Codex reads a component set's properties, variants and nested instances, writes the Code Connect template file, and then adds the mapping to Figma.

get_context_for_code_connectadd_code_connect_map

Audit which components are linked

Ask Codex which Figma components already point to a source file and which don't, so the unmapped ones can go on the next sprint.

get_code_connect_map

Survey a large page first

On a busy page, Codex first lists node IDs, layer types and sizes to find the frames it needs, then fetches design context only for those.

get_metadataget_design_context

Tools

17 tools

Each Figma tool can be allowed or denied per team and role at the MCP Gateway before Codex 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.

See all 17 tools

Control

What Speakeasy can see and stop in Codex

The gateway covers every client the same way. The rest depends on what Codex 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 Codex. MCP-scoped policies are enabled per organization.

Prompt and tool-call blocking

Codex

Agent hooks send each prompt and tool call to Speakeasy, which allows or denies it before Codex runs it.

User attribution

Codex

An [otel] block in ~/.codex/config.toml sends telemetry to Speakeasy. Export is off by default.

Budgets

Codex

Spend limits can block Codex traffic once a budget is reached.

Device agent and MDM

Codex

The device agent keeps Codex's configuration in sync on managed laptops.

  • Codex cloud tasks and GitHub code review run off the device. Neither the plugin nor OpenTelemetry covers them; OpenAI's Compliance Logs record them after the fact.
  • The workspace rollout needs a ChatGPT Business, Enterprise or Edu admin.

Questions

Frequently asked questions

Which Figma tools can change files?
use_figma runs JavaScript through the Plugin API to create, edit or delete objects, create_new_file makes a blank file, and add_code_connect_map and send_code_connect_mappings save mappings. Teams that only need to read designs can be denied these at the gateway.
Is Figma activity in Codex attributed to a developer?
An [otel] block in ~/.codex/config.toml sends telemetry to Speakeasy. Export is off by default, so turn it on to attribute sessions.
How do Codex users get Figma?
An admin adds Figma from the Speakeasy MCP Catalog and grants access by team or role. Add the gateway as an MCP server, then log in. Each person then sees only the Figma tools their access allows.
Are Figma calls from Codex logged?
Yes. Figma calls go through the MCP Gateway, which logs each tool call and attributes it to the person and the client that made it.

Connect more

Figma in other clients

AI everywhere.

Control here.