Documentation Index
Fetch the complete documentation index at: https://mintlify.com/open-pencil/open-pencil/llms.txt
Use this file to discover all available pages before exploring further.
Stdio Transport
The stdio transport enables IDE integrations with MCP-compatible tools like Claude Code, Cursor, and Windsurf. The AI assistant spawnsopenpencil-mcp as a subprocess and communicates over stdin/stdout using the MCP protocol.
How It Works
- Your IDE reads the MCP configuration file (e.g.
claude_desktop_config.json) - When you start a chat, the IDE spawns
openpencil-mcpas a subprocess - The AI assistant sends tool calls via stdin, receives results via stdout
- The server maintains document state (opened
.figfile) for the session lifetime - When the chat ends, the subprocess terminates
Installation
Install the MCP server globally:bunx in your config (no install required).
Configuration
Claude Code (Claude Desktop)
Edit~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
bunx without global install:
Cursor
Cursor uses the same configuration format. Edit the MCP settings file (location varies by OS):Windsurf
Windsurf also supports MCP. Add the server to your Windsurf config:Usage Example
Once configured, you can ask the AI assistant to perform design operations:File Operations
Before using most tools, you must open a.fig file or create a new document:
Open an Existing File
Create a New Document
Save the Document
Security
File Access
Stdio transport does not restrict file access. The server inherits the file permissions of the parent process (your IDE). It can read and write any file the IDE can access. Recommendation: Only use stdio transport with trusted AI assistants in secure environments. For untrusted scripts or CI, use the HTTP transport withOPENPENCIL_MCP_ROOT.
Eval Tool
Theeval tool is enabled by default in stdio transport. It allows executing arbitrary JavaScript with full Figma Plugin API access:
createServer() in packages/mcp/src/server.ts).
Troubleshooting
Tools not appearing in IDE
Cause: MCP config not loaded or invalid JSON. Fix:- Verify the config file path matches your IDE’s expected location
- Check JSON syntax (use
jq . < config.jsonto validate) - Restart the IDE completely (not just reload window)
“No document loaded” error
Cause: Attempting to use tools before callingopen_file or new_document.
Fix: Always start with:
”command not found: openpencil-mcp”
Cause: Global bin directory not in PATH, or package not installed. Fix:- Ensure
bun add -g @open-pencil/mcpsucceeded - Add
~/.bun/binto PATH - Or use
bunx @open-pencil/mcpin config instead
File not found errors
Cause: Relative paths are resolved from the IDE’s working directory, which may not be your project root. Fix: Use absolute paths:Server crashes or hangs
Cause: Malformed tool parameters or bugs in the server. Fix:- Check the IDE’s MCP server logs (location varies by IDE)
- Test the operation manually using the HTTP transport
- Report issues at github.com/open-pencil/open-pencil
Environment Variables
You can pass environment variables via the MCP config:Next Steps
- Tools Reference — explore all 75+ available tools
- HTTP Transport — alternative for scripts and CI