dia is an MCP server named dia. An AI assistant connected to it can create, read, and revise diagrams in the user’s dia account. The pages in this section are generated from the server’s own responses, so they show the exact text an AI receives.
Connection URL
https://dia.rakudeji.com/mcpThe server speaks MCP over Streamable HTTP. The first connection opens a page in the browser where the user allows the AI to access dia.
Server instructions
The server returns these instructions when a client connects. Most clients add them to the model’s context.
dia stores node-and-edge diagrams grouped into documents; documents are grouped into projects.
Every document belongs to a project; the project "default" exists from the start.
Create a document with create_document, then add diagrams with write_diagram.
Find existing projects and documents with list_projects.
Inspect a document with read_document. Reorder or retitle with write_document by
rearranging the diagrams array; there are no positional indexes.
A diagram is a single JSON object with title, description, model (structure),
style (appearance), and optional presets (named style values shared between nodes).
Edits are sent as JSON Patch; never resend the whole diagram.
Coordinates and sizes are computed automatically and cannot be specified.
Nodes are created from ids used in edges, so model.nodes is usually unnecessary.
Every write appends a version. See list_versions and restore_diagram.
Readable diagrams:
- One diagram answers one question. Split a large system into several diagrams in one document
(an overview, then one diagram per area or flow), or add views that highlight each flow.
- Draw one kind of relation as arrows in a diagram (data flow, calls, or control);
state the other kinds in labels or the description instead of adding crossing arrows.
- Keep labels to a few words; explanations, assumptions, and numbers go in description.
- To build a picture up step by step, or to compare before and after, use a "steps" document.
- Check each diagram with render_diagram and revise what reads poorly.
For table-like diagrams, preset the container { gap 0, padding 0, paddingY 12, flow right }
and the rows { padding 16, paddingY 4, minHeight 0 }.Tools
The server has 17 tools. Tools lists each one with its description and parameters.
create_project: Create a projectcreate_document: Create a documentlist_projects: List projects and documentswrite_project: Write a project (JSON Patch)delete_project: Delete a projectdelete_document: Delete a documentwrite_diagram: Write a diagram (JSON Patch)read_document: Read a documentwrite_document: Write a document (JSON Patch)copy_diagram: Copy a diagramdelete_diagram: Delete a diagramread_diagram: Read a diagramlist_versions: List diagram versionsrestore_diagram: Restore a versionrender_diagram: Render a diagram (PNG)upload_icon: Upload an iconsearch_icons: Search icons