klayout-mcp¶
klayout-mcp is a read-only MCP server for KLayout. It opens GDS/OAS layouts, inspects geometry and hierarchy, renders deterministic PNGs, and runs batch DRC with structured JSON output.
What It Covers¶
- Open a layout and inspect layers, cells, and hierarchy
- Query geometry in bounded regions and measure shapes
- Render deterministic view images for layouts and markers
- Run batch DRC decks and extract marker crops
Install¶
Fastest one-off run:
uvx klayout-mcp@latest
Install once:
uv tool install klayout-mcp
Traditional Python install:
python -m pip install klayout-mcp
If you use batch DRC, make sure the klayout executable is on PATH or exported through KLAYOUT_BIN.
Typical Workflow¶
open_layoutlist_layerslist_cellsordescribe_cellquery_regionmeasure_geometryanalyze_waveguiderender_viewrun_drc_scriptextract_markersclose_session
Continue with Getting Started for the shortest local setup path, or jump to MCP Clients for Codex, Claude Code, Cursor, and OpenCode examples.