Render Mermaid with Line9 layout in your assistant.
ai.line9/diagrams MCP Server
The MCP server ai.line9/diagrams renders Mermaid diagrams using the Line9 layout. It is intended to be used within an assistant context to convert Mermaid definitions into diagrams laid out with Line9 styling.
🛠️ Key Features
Mermaid rendering
Line9 layout support
🚀 Use Cases
Generate Line9-formatted Mermaid diagrams in an assistant workflow
⚡ Developer Benefits
Consistent diagram layout via Line9 when rendering Mermaid
⚠️ Limitations
Source data does not specify available tools, configuration options, supported Mermaid features, or input/output details
Captured live from the server via tools/list.
render_diagram
Render Mermaid source with Line9's layout engine. Call this whenever you write or change Mermaid and the user should see the result. Flowcharts and sequence diagrams get Line9's layout; other Mermaid kinds are rendered with Mermaid's own layout and flagged as such. Returns a short verdict — kind, size, warnings, or a parse error with its line and column — plus an "Open in Line9" link. On a parse error, fix the named line and call again. Assistants that support MCP Apps show the diagram in a panel; there, do not paste the SVG or repeat the source in your reply. In an assistant with no panel (a terminal or editor), reply with the verdict line and the `open_url` link — that link is the only way the user sees the diagram. Write flowcharts as `flowchart LR` unless the user asks for top-to-bottom; chat panels are wide and short. No sign-in needed; renders carry a small Line9 mark unless the user is signed in to Line9 Pro. Set theme, orientation, spacing and legend in the source itself (`line9:` frontmatter; `flowchart LR`), never as arguments. This connector cannot publish or save. To publish, the user opens the diagram in Line9 (the `open_url` link) and publishes there — not with the Line9 CLI.
Parameters2
source
string
required
Mermaid source. Optional YAML frontmatter is honoured — set it in the source, never as arguments: `title`, and a nested `line9:` block with `theme` (one of `boardroom`, `linen`, `blueprint`), `scale: { node, spacing }` and `flowchart: { legend: on | off }`. The flowchart direction directive is also honoured. Maximum 100000 characters.
plan
string
optional
Opaque plan from a previous result (widget use). A hint only: skips the solve when it still fits the source.
Raw schema
{
"type": "object",
"properties": {
"source": {
"type": "string",
"minLength": 1,
"description": "Mermaid source. Optional YAML frontmatter is honoured — set it in the source, never as arguments: `title`, and a nested `line9:` block with `theme` (one of `boardroom`, `linen`, `blueprint`), `scale: { node, spacing }` and `flowchart: { legend: on | off }`. The flowchart direction directive is also honoured. Maximum 100000 characters."
},
"plan": {
"description": "Opaque plan from a previous result (widget use). A hint only: skips the solve when it still fits the source.",
"type": "string"
}
},
"required": [
"source"
],
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": {}
}
list_diagrams
List the diagrams published in the user's Line9 workspace(s): name, visibility, version, last update and permalink. Use it to find a diagram before `get_diagram`. Requires Line9 sign-in.
Fetch a published diagram's current Mermaid source by name or slug, and show it rendered. The returned source is stamped with the diagram's identity — keep the `line9:` frontmatter block when you edit it so that Line9 recognises the diagram when it is opened and published there instead of creating a new one. Requires Line9 sign-in. This connector cannot publish or save. To publish, the user opens the diagram in Line9 (the `open_url` link) and publishes there — not with the Line9 CLI.