openflowkit-mcp

v0.3.0
@openflowkit/openflowkit-mcp Checked 2 hours ago Published 23 days ago

Local-first Model Context Protocol server for OpenFlowKit — pair the live editor or edit .openflow.json files: create/update/read diagrams from DSL, scene…

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`.

ParameterTypeDescription
dsl *stringOpenFlow 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.

ParameterTypeDescription
rootPath *stringAbsolute path to the project root directory.
maxFilesintegerCap 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.

ParameterTypeDescription
name *stringTemplate 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.

ParameterTypeDescription
path *stringAbsolute or cwd-relative path to the repository root.
maxFilesintegerCap on files scanned. Defaults to 2000.
namestringSystem 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.

ParameterTypeDescription
path *stringAbsolute or cwd-relative path to the repository root.
documentIdstringFile-mode document id from openflow_open; without dsl or documentId, the model is architecture.ofk in path.
dslstringInline 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.

ParameterTypeDescription
elementId *stringElement id (shop.api) or display name.
documentIdstringFile-mode document id from openflow_open; without dsl or documentId, the model is architecture.ofk in path.
dslstringInline OFK architecture workspace; wins over documentId.
pathstringAbsolute or cwd-relative path to the repository root.

openflow_create New document

Create an empty file-mode document in this process.

ParameterTypeDescription
namestring

openflow_open Open a .openflow.json

Load a canonical document from disk into file mode and return its id.

ParameterTypeDescription
path *stringAbsolute 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.

ParameterTypeDescription
path *stringInside the server's working directory; .openflow.json, .ofk or .json only.
documentIdstringFile-mode document; omit to save the paired editor document (or, in file mode, the one opened or created last).
svgbooleanAlso 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.

ParameterTypeDescription
dsl *stringOpenFlow 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…
atobjectTop-left corner of the new frame in page coordinates; omit to place it beside what is there.
documentIdstringFile-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).
pageIdstringPage to draw on (see list_pages); defaults to the page the editor shows, or the first page in file mode.
palettestringDiagram 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.

ParameterTypeDescription
dsl *stringOpenFlow 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 *stringDiagram frame id, from create_diagram or list_diagrams.
documentIdstringFile-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).
pageIdstringPage 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…
palettestringDiagram 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…

ParameterTypeDescription
documentIdstringFile-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).
frameIdstringDiagram frame id, from create_diagram or list_diagrams. Defaults to the first diagram on the page.
pageIdstringPage to read (see list_pages); defaults to the page the editor shows, or the first page in file mode.
sincestringThe `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).

ParameterTypeDescription
documentIdstringFile-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.

ParameterTypeDescription
familystringOne 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.

ParameterTypeDescription
query *string
limitinteger

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.

ParameterTypeDescription
concept *string
limitinteger

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.

ParameterTypeDescription
ids *arrayNode ids to move together (get_document lists them).
deltaobjectOffset added to every node, in pixels.
documentIdstringFile-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).
pageIdstringPage 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…
toobjectWhere 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).

ParameterTypeDescription
ids *arrayNode ids to restyle (get_document lists them).
documentIdstringFile-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).
fillstringHex colour, #rrggbb or #rrggbbaa, e.g. #e95420.
iconPlacementstringIcon cards only: the icon above its caption (top) or left of its text (left). It resizes the card, so pass it on its own.
opacitynumber
pageIdstringPage 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…
strokestringHex colour, #rrggbb or #rrggbbaa, e.g. #e95420.
strokeStylestring
strokeWidthnumber
textColorstringHex 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.

ParameterTypeDescription
ids *arrayNode or connector ids to delete (get_document lists both).
documentIdstringFile-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).
kindstringOnly match ids of this kind; any (default) matches both.
pageIdstringPage 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…

ParameterTypeDescription
chartobject
documentIdstringFile-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).
idstringId for the new node; one is minted when omitted.
kind
labelstringText on the shape; required for catalog kinds other than the toolbar shapes.
pageIdstringPage 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…
parentIdstring
presetstring
widgetobject
xnumberTop-left x in page pixels (inside parentId: from the frame).
ynumberTop-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.

ParameterTypeDescription
documentIdstringFile-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).
durationMsintegerAnimation clip length in milliseconds; omit for the natural length.
formatstring
fpsnumber
idsarraySelection scope: the node and connector ids to export; defaults to everything on the page.
loopboolean
orderstringAnimation order: a flow id from the architecture model, or "code" for the animate block in the diagram source. Omit for the connector graph.
pageIdstringPage to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode.
pathstringWrite the file here instead of returning it (relative to, and inside, the server's working directory).
presetstringAnimation preset: build reveals in order, walkthrough spotlights each step, pulse shows everything with a moving light.
scalenumber
scopestringdocument: every page; page: one page; selection: the ids you pass.
sizenumberRaster animation width in pixels.
themestring

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").

ParameterTypeDescription
documentIdstringFile-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).
frameIdstringDiagram frame id, from create_diagram or list_diagrams; omit for the whole page.
pageIdstringPage to act on (see list_pages); defaults to the page the editor shows, or the first page in file mode.
scalenumber
themestring

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.

ParameterTypeDescription
documentIdstringFile-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).
frameIdstringDiagram frame id to frame (wins over ids).
idsarrayNode 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.

ParameterTypeDescription
documentIdstringFile-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).
pageIdstringPage 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.

ParameterTypeDescription
documentIdstringFile-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…

ParameterTypeDescription
afterstringA threadId from an earlier list: list the threads after it, with the same filters. It may since be resolved.
documentIdstringFile-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).
includeResolvedbooleanAlso list resolved threads.
limitintegerMost threads to list.
pageIdstringOnly this page (see list_pages); default every page.
threadIdstringOnly this thread, whatever its page or state; an unknown id is an error, and so is a pageId it is not on.
unansweredbooleanOnly 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.

ParameterTypeDescription
body *stringPlain text, at most 4000 characters.
threadId *string
documentIdstringFile-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).
pageIdstringPage 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.

ParameterTypeDescription
threadId *string
documentIdstringFile-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).
pageIdstringPage 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…
resolvedboolean

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.

ParameterTypeDescription
body *stringPlain text, at most 4000 characters.
documentIdstringFile-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).
nodeIdstringNode to pin to (see get_document); without pageId the thread goes on the page holding it.
pageIdstringPage 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…
pointobjectWorld position of the pin; wins over the node corner when both are given.