§ mcp

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. Authentication: Sign in when needed. OAuth client: Use Claude’s published identity. Claude may run the Line9 sign-in as soon as you add the connector; No sign-in keeps rendering working but never shows your diagram list.

ChatGPT

Settings → Apps & Connectors → Advanced → turn on developer mode, then add the server URL https://mcp.line9.ai/mcp; no client secret is asked for.

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.

In Claude, say “using Line9” — otherwise it may draw with its own renderer.

  • Using Line9, draw a flowchart of how a pull request gets merged
  • Using Line9, turn this process into a diagram: …
  • Show me my Line9 diagrams

Tools

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

Sign-in and scopes

render_diagram is anonymous. Listing and fetching 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.

One scope:

  • diagrams:read — see diagrams you have published (list_diagrams, get_diagram).

Watermark removal is not a scope. It follows the signed-in user’s plan: Pro output is clean; otherwise the Line9 mark stays.

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.ai only 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.

Your diagram text is sent to our web service only for the MCP renderer. The web viewer renders in your browser; the CLI renders on your machine.

Troubleshooting

401 / sign-in challenge. list_diagrams and get_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. To publish, open the diagram in Line9.

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.