Line9 for AI assistants (MCP)
Line9’s hosted MCP server puts the same layout engine as line9.ai inside the conversation. Your assistant writes Mermaid; Line9 lays it out and shows it as a widget (or as text plus an Open-in-Line9 link, on hosts without widgets).
The server URL is https://mcp.line9.ai/mcp.
Connect
Or paste this JSON into an MCP config file:
{
"mcpServers": {
"line9": {
"url": "https://mcp.line9.ai/mcp"
}
}
} claude.ai and Claude Desktop
Settings → Connectors → Add custom connector. URL: https://mcp.line9.ai/mcp.
ChatGPT
Settings → Apps & Connectors → Advanced → turn on developer mode, then add the server URL https://mcp.line9.ai/mcp.
Cursor
Use Add to Cursor above, or put the JSON snippet in Cursor’s MCP settings.
VS Code
Use Add to VS Code above, or add the same JSON to VS Code’s MCP settings.
Claude Code
claude mcp add --transport http line9 https://mcp.line9.ai/mcp Claude Code runs in a terminal: you get the tool’s text verdict and an Open-in-Line9 link, not the in-conversation widget.
Tools
Four tools, in this order.
render_diagram — no sign-in. Render Mermaid source with Line9’s layout engine and show it inside the conversation. Flowcharts and sequence diagrams get Line9 layout; other Mermaid kinds are rendered with Mermaid’s own layout and flagged. No sign-in needed; renders carry a small Line9 mark unless you are signed in to Line9 Pro.
list_diagrams — scope diagrams:read. List published diagrams in your Line9 workspace(s). Requires sign-in.
get_diagram — scope diagrams:read. Fetch a published diagram by name or slug, show it rendered, and return source stamped with the diagram’s identity. Requires sign-in.
publish_diagram — scope diagrams:write. Publish source to your Line9 workspace. Only when you have asked to publish. Flowcharts and sequence diagrams only. Requires Line9 Pro.
Sign-in and scopes
render_diagram is anonymous. Listing, fetching and publishing go through Line9’s existing accounts over OAuth 2.1. A host that needs those tools will send you to line9.ai to sign in.
Two scopes:
diagrams:read— see diagrams you have published (list_diagrams,get_diagram).diagrams:write— publish (publish_diagram).
Watermark removal is not a scope. It follows the signed-in user’s plan: Pro output is clean; otherwise the Line9 mark stays. Publish needs Pro.
Revoke a grant from Connected apps.
How Line9's MCP handles your data
This is the single reference. Other Line9 pages link here rather than restating it.
Rendered in memory and discarded. Your diagram source is sent to
mcp.line9.aionly when your assistant calls a Line9 tool. It is rendered inside a stateless Cloudflare Worker, returned, and discarded — no diagram content is written to storage and no request bodies are logged. We record anonymous usage counts (which tool, diagram kind, node and edge counts, timing, the name of the assistant) and nothing else. Nothing of your diagram is kept unless you sign in and choose to publish, and then only what you publish.
What makes that true, in plain English, with mcp/wrangler.toml as the citable proof:
- No storage on the render path.
mcp/wrangler.tomldeclares no D1, KV, R2 or Durable Object binding. The one write per call is a Cloudflare Analytics Engine data point of counts, never content — the claim says so rather than pretending there is no write. - Logs are an allowlist. Structured log fields are a closed set of names (tool, outcome, timing, counts, client name). Request bodies are not logged. There is no Tail Worker, no Logpush, no third-party error tracker.
- No analytics in the widget. No PostHog, no beacons, no third-party script.
- Cloudflare’s WAF and Bot Fight Mode on
mcp.line9.ailog request metadata, never bodies. Logpush is not enabled for the zone. - Publish is the only content write, and it goes to line9.ai’s existing store under the privacy policy.
- The layout plan is client-carried. Bytes the widget needs to re-render without a re-solve leave encrypted, live in the widget’s memory, and expire; the server holds nothing between calls.
This page is about MCP. The web viewer still renders in your browser; the CLI still renders on your machine. Those surfaces are not this one.
Troubleshooting
401 / sign-in challenge. list_diagrams, get_diagram and publish_diagram need a Line9 sign-in. Complete the OAuth prompt. If it still fails, revoke the grant at Connected apps and add the connector again.
Widget not shown. Some hosts do not display MCP Apps widgets (Claude Code in a terminal is one). You still get a short verdict and an Open-in-Line9 link. If a host that should show the widget does not, check that it is on a current MCP Apps build and that the connector is the hosted URL, not a local stdio server.
Fallback badge. Class diagrams, state diagrams, Gantt and other kinds Line9’s engine does not lay out yet are drawn with Mermaid’s own layout and marked. That is expected, not an error. Publish from MCP is engine kinds only; open the diagram on line9.ai to publish a fallback kind.
100-node limit. Flowcharts over 100 nodes fall back to Mermaid’s layout with a note to split the diagram or raise its abstraction level. Line9 layout is for diagrams you would actually present, not for dumping a whole codebase into one graph.