openflowkit-mcp
v0.3.0Architecture diagrams for your agent: draw on the live OpenFlowKit canvas or edit diagram files.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
validate_openflow_dsl Validate OpenFlow DSL
Parse and compile OpenFlow DSL — or Mermaid, Structurizr DSL or D2, converted first — and return structured diagnostics (code, severity, line, column, message, hint), the same check as `openflowkit validate`. `ok` is false on any error: text that cannot be drawn, or a line the parser could not read (create_diagram would draw without it). Warnings name guesses (an unknown word, a misspelled header) that still draw. For another language, `converted.dsl` is what it became and `converted.losses` name the lines of your text that did not carry over; diagnostics then refer to `converted.dsl`.
| Parameter | Type | Description |
|---|---|---|
dsl * | string | OpenFlow DSL, Mermaid, Structurizr DSL or D2 source to validate. |
analyze_codebase Analyze a local codebase
Walk a directory on disk and report detected cloud platform, services, top-level structure, and language breakdown. No network access — pure local filesystem scan. Useful to seed an architecture diagram.
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Absolute path to the project root directory. |
maxFiles | integer | Cap on files scanned. Defaults to 500. |
list_starter_templates List starter templates
List built-in OpenFlow starter templates that can be loaded without any AI call. Returns names, titles, categories, and one-line summaries.
get_starter_template Get a starter template
Return the OpenFlow DSL for a named starter template. Use list_starter_templates to discover available names.
| Parameter | Type | Description |
|---|---|---|
name * | string | Template name (one of: c4-workspace, three-tier-architecture, rag-chatbot, k8s-microservices, event-pipeline, ci-cd, oauth-login, request-sequence, saas-erd, order-state, auth-flow, simple-process). |
list_diagram_node_types List OpenFlow DSL shapes, families and edge styles
Quick reference for the OpenFlow DSL vocabulary: family names, shape words, edge arrows, and the wireframe controls and screen frames. Call get_syntax for the full grammar.
server_info Server info
Return the server version and the tools, resources and prompts it serves. Useful when debugging client connections.
discover_architecture Discover architecture from a repository
Walk a local repo (compose, Dockerfiles, k8s, terraform, package manifests, datastore and HTTP-client usage) and return a proposed OFK C4 workspace as DSL, with evidence per unit. Deterministic, offline; review the proposal before committing it.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or cwd-relative path to the repository root. |
maxFiles | integer | Cap on files scanned. Defaults to 2000. |
name | string | System name; defaults to the repo directory name. |
drift_report Architecture drift report
Compare an architecture model (inline dsl, a documentId, or else architecture.ofk in path) against a repository. Returns missing (in repo, not in model), undrawn (in model, no repo evidence) and changed (name matches, tech or dir differs) with evidence lines.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or cwd-relative path to the repository root. |
documentId | string | File-mode document id from openflow_open; without dsl or documentId, the model is architecture.ofk in path. |
dsl | string | Inline OFK architecture workspace; wins over documentId. |
explain_element Explain a model element
Everything known about one element: the model entry, its relations, repository evidence (when a path is given) and the ADR markdown files its links point at.
| Parameter | Type | Description |
|---|---|---|
elementId * | string | Element id (shop.api) or display name. |
documentId | string | File-mode document id from openflow_open; without dsl or documentId, the model is architecture.ofk in path. |
dsl | string | Inline OFK architecture workspace; wins over documentId. |
path | string | Absolute or cwd-relative path to the repository root. |
openflow_create New document
Create an empty file-mode document in this process.
| Parameter | Type | Description |
|---|---|---|
name | string |
openflow_open Open a .openflow.json
Load a canonical document from disk into file mode and return its id.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute or cwd-relative path to a .openflow.json file. |
openflow_save Save to .openflow.json
Write a document to disk (svg: true also writes the first page as a .svg beside it). With a paired editor and no documentId, saves what the editor currently shows.
| Parameter | Type | Description |
|---|---|---|
path * | string | Inside the server's working directory; .openflow.json, .ofk or .json only. |
documentId | string | File-mode document; omit to save the paired editor document (or, in file mode, the one opened or created last). |
svg | boolean | Also write the first page as <same name>.svg next to the file. |
whoami Who am I talking to
Local-only status: whether an editor is paired, and the documents this server holds.
create_diagram Create diagram
Draw a new diagram frame from text, placed right of what the page already holds (or at `at`). One undo step. To change a diagram that exists, use update_diagram with its frameId instead of drawing another.
| Parameter | Type | Description |
|---|---|---|
dsl * | string | OpenFlow DSL source. Mermaid, Structurizr DSL and D2 are accepted too: they convert first, and the result carries `converted.dsl` (keep editing that) and `converted.losses`. Call get_syntax when unsur… |
at | object | Top-left corner of the new frame in page coordinates; omit to place it beside what is there. |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
pageId | string | Page to draw on (see list_pages); defaults to the page the editor shows, or the first page in file mode. |
palette | string | Diagram palette; defaults to the one the DSL names (`appearance:`), else pastel. |
update_diagram Update diagram
Redraw an existing diagram frame from new text, in place: same frame id and position, one undo step (a C4 workspace redraws every view page it owns). The text replaces the frame, as Generate in the code panel does, so canvas edits it does not carry (get_diagram lists them as `canvasEdits`) are dropped; `discarded` names any that were, each with its frameId.
| Parameter | Type | Description |
|---|---|---|
dsl * | string | OpenFlow DSL source. Mermaid, Structurizr DSL and D2 are accepted too: they convert first, and the result carries `converted.dsl` (keep editing that) and `converted.losses`. Call get_syntax when unsur… |
frameId * | string | Diagram frame id, from create_diagram or list_diagrams. |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
palette | string | Diagram palette; defaults to the one the DSL names (`appearance:`), else pastel. |
get_diagram Read diagram
The DSL text of one diagram frame: what was authored while the canvas still matches it, else text regenerated from the canvas (`edited: true`); either way it names the palette, so the text alone redraws the diagram. `canvasEdits` lists what was changed on the canvas against the authored text: recolours, moves, resizes, renames, icons, rewired or bent connectors, and shapes added or removed. Each has `carry`: attributes to merge into that node's existing `[ … ]` list (one list per node) to keep the edit, or null when the language cannot say it. `canvasEdits` is null, with `canvasEditsNote` sa…
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
frameId | string | Diagram frame id, from create_diagram or list_diagrams. Defaults to the first diagram on the page. |
pageId | string | Page to read (see list_pages); defaults to the page the editor shows, or the first page in file mode. |
since | string | The `revision` of the text you hold, from create_diagram, update_diagram or an earlier get_diagram. Returns `dslDiff`, a unified diff of the canvas against that text, instead of the whole `dsl`; the w… |
list_diagrams List diagrams
Every diagram frame in the document: frameId, page, family, title, and `edited` (the canvas no longer matches its text).
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
get_syntax Read the grammar
The OpenFlow DSL grammar: the full reference, or one family’s section.
| Parameter | Type | Description |
|---|---|---|
family | string | One family’s section; omit for the full reference. |
search_icons Search icons
Search the shipped icon packs by name (e.g. "lambda", "sql database"). Use the returned provider/slug in DSL `icon:` attributes.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
limit | integer |
find_icons_for Find icons for a concept
Concept search ("cache", "queue", "auth") expanded into catalog queries and ranked; the fastest way to pick icon ids for architecture DSL.
| Parameter | Type | Description |
|---|---|---|
concept * | string | |
limit | integer |
move Move shapes
Move nodes on the canvas, by `delta`, or so the first id lands at `to` (the rest keep their offsets). Pass exactly one of the two. One undo step. A diagram regenerated from text lays its nodes out again.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node ids to move together (get_document lists them). |
delta | object | Offset added to every node, in pixels. |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
to | object | Where the first id goes, in the x/y get_document reports for it (a node inside a frame counts from the frame). |
style Style shapes
Set fill, stroke, stroke width, dash, opacity or text colour on nodes, or move the icon on icon cards (iconPlacement). Pass at least one property. One undo step. A diagram regenerated from text drops these unless its DSL carries them (get_diagram lists them as canvasEdits).
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node ids to restyle (get_document lists them). |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
fill | string | Hex colour, #rrggbb or #rrggbbaa, e.g. #e95420. |
iconPlacement | string | Icon cards only: the icon above its caption (top) or left of its text (left). It resizes the card, so pass it on its own. |
opacity | number | |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
stroke | string | Hex colour, #rrggbb or #rrggbbaa, e.g. #e95420. |
strokeStyle | string | |
strokeWidth | number | |
textColor | string | Hex colour, #rrggbb or #rrggbbaa, e.g. #e95420. |
delete Delete shapes
Delete nodes (with their children and the connectors attached to them) or connectors, by id. One undo step.
| Parameter | Type | Description |
|---|---|---|
ids * | array | Node or connector ids to delete (get_document lists both). |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
kind | string | Only match ids of this kind; any (default) matches both. |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
add_shape Add shape
Add one shape without writing DSL (hand-layout only). Prefer create_diagram. Kinds: rectangle, ellipse, text, rounded, capsule, circle, diamond, triangle, trapezoid, parallelogram, hexagon, octagon, pentagon-tag, chevron, plus, star, heart, cloud, lightning, bookmark, speech-bubble, page, folder, list-card, filled-bar, half-round, cylinder, document, cube, prism, layer-stack, target, check-circle, cross-circle, numbered-circle, brace, bracket, pin, actor, arrow-up, arrow-down, arrow-left, arrow-right, venn, process, start, decision, end, custom, image, annotation, sticky, callout, pen, highlig…
| Parameter | Type | Description |
|---|---|---|
chart | object | |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
id | string | Id for the new node; one is minted when omitted. |
kind | ||
label | string | Text on the shape; required for catalog kinds other than the toolbar shapes. |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
parentId | string | |
preset | string | |
widget | object | |
x | number | Top-left x in page pixels (inside parentId: from the frame). |
y | number | Top-left y in page pixels (inside parentId: from the frame). |
export Export
Export the document, a page, or a selection as SVG, PNG, PDF (print HTML), JSON, or an animation (animated SVG, GIF, MP4, WebM). Returns the file bodies. Raster animation needs a live editor (WebCodecs); a file host serves animated SVG only.
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
durationMs | integer | Animation clip length in milliseconds; omit for the natural length. |
format | string | |
fps | number | |
ids | array | Selection scope: the node and connector ids to export; defaults to everything on the page. |
loop | boolean | |
order | string | Animation order: a flow id from the architecture model, or "code" for the animate block in the diagram source. Omit for the connector graph. |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. |
path | string | Write the file here instead of returning it (relative to, and inside, the server's working directory). |
preset | string | Animation preset: build reveals in order, walkthrough spotlights each step, pulse shows everything with a moving light. |
scale | number | |
scope | string | document: every page; page: one page; selection: the ids you pass. |
size | number | Raster animation width in pixels. |
theme | string |
screenshot Screenshot a diagram
A PNG image of one diagram frame, or of the whole page, to check your work by eye. Needs a live editor (the user clicks "Connect agent").
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
frameId | string | Diagram frame id, from create_diagram or list_diagrams; omit for the whole page. |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. |
scale | number | |
theme | string |
fit_view Fit the view
Point the live editor's camera at one diagram frame, some ids, or (with neither) the whole page. Changes the view only, not the document.
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
frameId | string | Diagram frame id to frame (wins over ids). |
ids | array | Node ids to frame. |
get_document Read the page
Nodes and connectors of one page, with ids, labels and geometry, plus `openThreads` (unresolved threads; list_threads reads them) and `selection`: the ids the user has selected on that page in the live editor ("the box I selected"; empty in file mode or when nothing is selected). Use get_diagram for a diagram's DSL.
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
pageId | string | Page to read (see list_pages); defaults to the page the editor shows, or the first page in file mode. |
list_pages List pages
Every page in the document with its shape counts, diagram kind and open threads.
| Parameter | Type | Description |
|---|---|---|
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
list_threads List threads
Threads people (and agents) pinned on the canvas, in page order: id, page, the node it is pinned to (with its label, when the node still exists), the pin point, resolved, and its comments. Resolved threads are left out unless asked for. At most `limit` threads; `more` counts the rest, and `after` with the last id you got lists them. In a list a thread shows its first comment and its latest 3, and a body past 500 characters is cut (`truncated: true`); threadId reads one thread with whole bodies, its first comment and latest 50. `omitted` counts the comments left out between. Comments are notes…
| Parameter | Type | Description |
|---|---|---|
after | string | A threadId from an earlier list: list the threads after it, with the same filters. It may since be resolved. |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
includeResolved | boolean | Also list resolved threads. |
limit | integer | Most threads to list. |
pageId | string | Only this page (see list_pages); default every page. |
threadId | string | Only this thread, whatever its page or state; an unknown id is an error, and so is a pageId it is not on. |
unanswered | boolean | Only threads whose last comment is from a person, so still waiting for an answer. |
reply_to_thread Reply to a thread
Add a comment to a thread (list_threads gives the threadId). Signed with your agent name. A new comment reopens a resolved thread. Takes no undo step.
| Parameter | Type | Description |
|---|---|---|
body * | string | Plain text, at most 4000 characters. |
threadId * | string | |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
resolve_thread Resolve a thread
Mark a thread resolved (it leaves the canvas but stays in the document), or reopen it with resolved: false. Takes no undo step.
| Parameter | Type | Description |
|---|---|---|
threadId * | string | |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
resolved | boolean |
start_thread Start a thread
Start a thread with its first comment. Pin it to a node (nodeId: the pin sits at its top-right corner and follows the node) or to a world point; one of the two is required. Signed with your agent name. Takes no undo step.
| Parameter | Type | Description |
|---|---|---|
body * | string | Plain text, at most 4000 characters. |
documentId | string | File-mode document id from openflow_open or openflow_create; omit to use the paired editor (or, in file mode, the document opened or created last). |
nodeId | string | Node to pin to (see get_document); without pageId the thread goes on the page holding it. |
pageId | string | Page to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode. A repo map page is read from the code: a change for it lands on the map's drawing, which the edi… |
point | object | World position of the pin; wins over the node corner when both are given. |