klayout-draw-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@klayout-draw-mcpdraw a 10um square on layer 1 and save as out.gds"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
klayout-draw-mcp
An MCP server for drawing GDS layouts with KLayout — generate, edit, and view layouts from an AI assistant such as Claude Code or Claude Desktop.
Layout geometry is built in-process with the standalone klayout Python module (no GUI needed). The installed KLayout application is launched only for viewing or manual editing.
Tools
Tool | Purpose |
| Start a new in-memory layout (coordinates in micrometers) |
| Add a rectangle |
| Add a polygon from |
| Add a path with width |
| Add a text label |
| Inspect current layout (layers, bbox, shape count) |
| Write GDS/OASIS; optionally open in the editor |
| Open a file in KLayout (viewer) |
| Open KLayout in editor mode, or a blank layout |
| Run arbitrary Python with |
Related MCP server: kicad-mcp
Requirements
Python ≥ 3.10
The
klayoutandmcpPython packages (installed via the steps below)The KLayout application — only needed for
open_layout/open_editor
Install
uv syncRegister with Claude Code
claude mcp add klayout -s user -- "<repo>/.venv/Scripts/python.exe" -m klayout_draw_mcp.serverOn macOS/Linux use .venv/bin/python.
Usage
"Draw a 5×5 µm box on layer 1 and a 2 µm-wide path, then save to out.gds and open it."
Claude calls new_layout → add_box / add_path → save_gds(open_after=True).
For anything beyond the basic shapes, run_script exposes the full klayout.db API.
Note
run_script executes arbitrary Python locally, in-process. Only run scripts you trust.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/geniuskey/klayout-draw-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server