Environment Variables
All environment variables are optional. The server uses sensible defaults if not specified.TEMPAD_MCP_TOOL_TIMEOUT
Tool call timeout in milliseconds. Increase this if you’re working with complex selections that take longer to generate.Example:
TEMPAD_MCP_AUTO_ACTIVATE_GRACE
Delay in milliseconds before auto-activating the sole connected extension. When only one Figma tab with TemPad Dev is open, the server waits this duration before automatically marking it as active.Example:Set to
0 to activate immediately when a single extension connects.TEMPAD_MCP_MAX_ASSET_BYTES
Maximum upload size for captured assets and screenshots in bytes. Default is 8 MB.Example:
Increasing this limit also requires sufficient payload budget. The overall MCP message payload limit is 4 MB.
TEMPAD_MCP_ASSET_TTL_MS
Asset cleanup TTL (time to live) in milliseconds, based on last access time. Default is 30 days (2,592,000,000 ms).Set to
0 to disable automatic cleanup.Example:TEMPAD_MCP_RUNTIME_DIR
Override the runtime directory where the server stores Unix sockets and lock files.Default paths:
- macOS/Linux:
/tmp/tempad-dev/run - Windows:
%TEMP%\tempad-dev\run
TEMPAD_MCP_LOG_DIR
Override the log directory. Currently not actively used but reserved for future logging enhancements.Default paths:
- macOS/Linux:
/tmp/tempad-dev/log - Windows:
%TEMP%\tempad-dev\log
TEMPAD_MCP_ASSET_DIR
Override the asset storage directory where uploaded assets are cached.Default paths:
- macOS/Linux:
/tmp/tempad-dev/assets - Windows:
%TEMP%\tempad-dev\assets
Hard-Coded Constants
Some limits are hard-coded in the shared contract and cannot be changed via environment variables:Maximum MCP message payload size: 4 MBThis is the total size limit for tool responses, including code, assets metadata, and tokens. Assets are returned as URLs, not embedded bytes, to stay within this limit.
WebSocket server port candidates. The server tries these ports in order and uses the first available one.If all ports are in use, the server will fail to start.
Asset hash length in hex characters. Hashes are the first 8 characters of the SHA-256 digest.
Configuration Examples
Development Environment
For faster iteration during development:Production/CI Environment
For stable, long-running deployments:High-Volume Asset Usage
For teams generating many assets:Minimal Cleanup
Disable cleanup for persistent asset storage:Setting Environment Variables
How you set environment variables depends on your MCP client:- Claude Desktop
- VS Code / Cursor
- Shell / Terminal
Add
env to your server configuration:Troubleshooting
Asset cleanup not working
Asset cleanup not working
- Verify
TEMPAD_MCP_ASSET_TTL_MSis set to a positive value (not0) - Check that the asset directory is writable
- Cleanup runs at most once per day; wait for the next cleanup cycle
- Check server logs for cleanup sweep messages
Timeouts still occurring
Timeouts still occurring
- Increase
TEMPAD_MCP_TOOL_TIMEOUTfurther - Try selecting a smaller subtree or simpler node
- Check if the Figma file is very complex (thousands of layers)
- Verify the Figma tab is active and responsive
Port conflicts
Port conflicts
- Check if ports 6220, 7431, or 8127 are in use:
lsof -i :6220 - Stop other services using those ports
- Port candidates are hard-coded and cannot be changed without modifying source
Asset uploads failing
Asset uploads failing
- Check
TEMPAD_MCP_MAX_ASSET_BYTESlimit - Verify asset directory has sufficient disk space
- Ensure asset directory permissions allow writes
- Check if asset file size exceeds the limit
Monitoring and Logging
The MCP server logs to stdout using structured JSON logging (viapino). Key log events include:
- Hub startup: Version, runtime directories, WebSocket port
- Extension connections: Connection, registration, activation, disconnection
- Tool calls: Tool name, request ID, extension ID, duration
- Asset operations: Uploads, downloads, cleanup sweeps
- Errors: Tool failures, timeout errors, validation errors
Performance Tuning
Reduce Timeout
Lower
TEMPAD_MCP_TOOL_TIMEOUT for faster failure feedback during development (e.g., 10000 ms).Increase Asset Limit
Raise
TEMPAD_MCP_MAX_ASSET_BYTES if working with high-resolution screenshots or large SVGs.Persistent Storage
Set
TEMPAD_MCP_ASSET_DIR to a dedicated directory outside system temp for better performance.Aggressive Cleanup
Reduce
TEMPAD_MCP_ASSET_TTL_MS to 1-7 days if disk space is constrained.Most users do not need to change these defaults. Only adjust configuration if you encounter specific issues or have special requirements.