Figma MCP server version: 1.0.3 (remote, https://mcp.figma.com/mcp)
Client: Any MCP host using OpenAI-compatible API
Seat: Dev/Full seat, Professional plan
Description
When using the Figma MCP remote server with an OpenAI-compatible model, every API call fails with HTTP 400 before the model even starts responding. The error message is:
Invalid JSON schema: regex lookaround is not supported.
Found at $.properties.fileKey.pattern
Root cause
All Figma MCP tools that accept a fileKey parameter use this regex pattern in their JSON schema:
"pattern": "^(?!undefined$|null$)"
The (?!...) part is a negative lookahead assertion (lookaround). OpenAI's JSON Schema validator strictly follows ECMA-262 regex, which does not support lookahead/lookbehind assertions. This causes the entire tool definition list to be rejected.
Impact
This affects ALL tools with a fileKey parameter, which is essentially the entire toolset:
- get_design_context
- get_screenshot
- get_metadata
- get_variable_defs
- get_code_connect_map
- get_code_connect_suggestions
- search_design_system
- use_figma
- generate_figma_design
- generate_diagram
- upload_assets
- whoami
- get_libraries
- get_figjam
- create_design_system_rules
- figma_add_code_connect_map
- figma_get_context_for_code_connect
- figma_send_code_connect_mappings
Any MCP client that forwards tool schemas to an OpenAI-compatible endpoint is affected — including OpenAI's Codex CLI, any setup using an OpenAI-compatible proxy/provider, and hybrid clients that use OpenAI models for tool calling.
This is a server-side issue since the Figma MCP remote server controls the tool schema definitions. Users cannot work around it without disabling the Figma MCP entirely.
Suggested fix
Replace the lookaround pattern with a lookaround-free alternative on the server side. For example:
Option A — alphanumeric validation (recommended, since fileKey values are always alphanumeric):
"pattern": "^[a-zA-Z0-9]+$"
Option B — simple non-empty check (the lookaround was likely intended to reject "undefined" and "null" literal strings):
"minLength": 1
Option C — remove the pattern entirely and keep just "type": "string" with "minLength"
References
This is a known cross-ecosystem compatibility issue with OpenAI's schema validation:
- https://github.com/anomalyco/opencode/issues/31996
- https://github.com/NousResearch/hermes-agent/issues/42631
- https://github.com/pydantic/pydantic-ai/pull/5519
- https://github.com/SmartBear/smartbear-mcp/issues/491
Steps to reproduce
1. Connect any MCP client to Figma remote server (https://mcp.figma.com/mcp).
2. Configure the client to use an OpenAI-compatible model (e.g. gpt-4o, gpt-5.5, or any OpenAI/Azure endpoint).
3. Send any message that triggers a tool call.
4. Observe HTTP 400 error: "Invalid JSON schema: regex lookaround is not supported."
Expected behavior
Tool schemas should use regex patterns compatible with ECMA-262, which OpenAI's validator enforces. Patterns with lookahead/lookbehind should be replaced with equivalent alternatives.
