Model Context Protocol

The draf.ing connector.

draf.ing runs a remote MCP server. Connect it once and Claude can build P&ID sheets in your account from a description of the process. The engine still chooses the symbols, the tag structure and the geometry.

Before you start

Connect in Claude

  1. Open Settings, then Connectors, and choose Add custom connector.
  2. Name it draf.ing and paste https://draf.ing/mcp as the server URL.
  3. Choose Connect. draf.ing asks you to sign in if you have not already.
  4. The consent page names the client and the address your access code will be sent to. Read both, then choose Allow.
  5. Open a new chat, switch the connector on for it, and ask for a drawing to confirm the link.
Keep the path

The handshake has to arrive at /mcp. A connector set up with https://draf.ing completes the sign-in and then reports that no MCP server was found at the URL.

Connect in Claude Code

One command, then authorise from inside the session.

claude mcp add --transport http draf-ing https://draf.ing/mcp

Run /mcp, pick draf-ing, and finish the sign-in in the browser window it opens. Once the token is held, claude mcp list shows the connection.

What the connector can do

Thirteen tools. A symbol's position can come from the client; its size, its nozzles, its tag number and the route of every line stay with the server.

ToolWhat it does
create_pidBuilds a sheet from process intent: streams, equipment, control loops.
list_diagramsLists your drawings with their ids, titles and current revisions.
get_diagramReads the drawing as a compact summary: every symbol's box, and for every line the faces it uses and how many bends its route has.
add_nodeAdds one ISA symbol: equipment, instrument, final element, in-line device or off-page connector. Takes an optional x and y.
place_nodesMoves symbols to given coordinates, re-routes every line that touches them, and nudges a symbol that came within about 30 px of lining up onto that axis. Reports the sheet size and any boxes that overlap.
add_edgeConnects two symbols through the port-aware orthogonal router, which picks the faces from where the two symbols stand.
set_flowShows, hides or reverses the flow arrowheads on a line.
delete_nodeDeletes a symbol and every line attached to it.
delete_edgeDeletes one line.
relayoutArranges symbols that have no position yet. Positions set by hand or by place_nodes, and locked symbols, stay where they are.
validate_diagramRuns the engineering validation rules over the drawing.
export_pngReturns the sheet as an image, ruled with a labelled 100 px grid, so an assistant can see the drawing and read a correction straight off it.
export_svgExports the drawing as a self-contained SVG, for saving or handing to a person.

The server also publishes two resources a client can read: draf://schema/intent, the process intent schema, and draf://catalog, the ISA symbol catalogue.

How to ask for a drawing

Say what the process is and you get a sheet back. Tag numbers, symbol shapes and line routes are the engine's to assign, so asking for a particular symbol file or a hand-drawn pipe route gets you nothing. Where the symbols sit is the one thing you can set yourself.

A description that works

Draw the overhead system. A reflux drum fed by the condenser, a pump taking suction from the drum, level control on the drum acting on the pump discharge, and a pressure transmitter on the drum wired back to the control system.

A description that does not

Tag the drum D-102, use the vessel-drum symbol, and run its outlet pipe down the left edge of the sheet.

Laying the sheet out yourself

Reproducing a drawing means choosing the coordinates and leaving the drawing to the server. Six steps, and the last three can run as many times as the arrangement needs.

  1. Add every symbol with x and y. Coordinates are the top-left of the box in sheet pixels, x to the right and y down, snapped to a 10 px grid. Each call returns the box the engine built, so line symbols up by their centres (x + width/2) rather than their corners.
  2. Leave room. A valve is about 32×48, an instrument bubble 56×56, equipment 70 to 180 px. Sixty pixels between neighbours reads well, and an instrument wants a clear 100 px above or below the line it serves.
  3. Connect with add_edge and no port names. The router picks the faces the two symbols present each other, and picks them again whenever one of the symbols moves.
  4. Call place_nodes on what you placed. It re-routes the lines, lines up anything within a nudge of straight, and names the boxes that now overlap.
  5. Read get_diagram. Every line reports from_side, to_side and bends. A run with no bends is straight; two or more usually means the symbols are in the wrong place, so move a symbol instead of redrawing the line.
  6. Look at it. export_png returns the sheet as an image, ruled with a labelled 100 px grid in sheet coordinates, so whatever stands in the wrong place can be read off the picture and moved with place_nodes. Reproducing a drawing means repeating this until the two match.
Seeing the sheet

A language model reads PNG, JPEG, GIF and WebP. An SVG reaches it as source text, which is both large and unreadable as a picture, so export_png is how an assistant checks its own work. A 900 px render of a normal sheet is about 25 KB and takes roughly 55 ms on the server; export_svg of the same sheet is 10 to 150 KB of markup nobody can look at.

Lines stay with draf.ing

Moving a symbol re-routes every line attached to it through the same port-aware router the editor uses, so runs keep their right angles, their nozzles and their crossing hops. There is no way to hand the server a pipe route, and that is deliberate: two sources of geometry would disagree.

When it does not work

Sheets the connector creates are ordinary draf.ing drawings. Same editor, same catalogue, same export.

Open the editor