MCP Gateway · Codex
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.
Set up
Add Figma to Codex 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. 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. - 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' - 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.
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.
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.
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.
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?
Is Figma activity in Codex attributed to a developer?
How do Codex users get Figma?
Are Figma calls from Codex logged?
Connect more