LikeC4 MCP Server

Query a LikeC4 architecture-as-code model: elements, relationships, deployments and views

Official · LikeC4 TypeScript Local · stdio Developer toolsDesign

62 popularity score ★ 6.0k ↓ 537/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add likec4 -- npx -y @likec4/mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "likec4": {
      "command": "npx",
      "args": [
        "-y",
        "@likec4/mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "likec4": {
      "command": "npx",
      "args": [
        "-y",
        "@likec4/mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "likec4": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@likec4/mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.likec4]
command = "npx"
args = ["-y", "@likec4/mcp"]
Gemini CLITerminal
gemini mcp add --scope user likec4 npx -- -y @likec4/mcp

Settings 1

LIKEC4_WORKSPACE Optional: Folder holding the LikeC4 projects to load. Defaults to the current directory when unset.

What it does

LikeC4 is a language for describing software architecture as code, in the spirit of the C4 model. You write elements, relationships, deployment nodes and views in .c4 files. Its MCP server loads every LikeC4 project in a workspace folder, then answers questions about the model they define, such as which services depend on the backend API, everything tagged legacy in one team's project, or the full chain of calls between two components.

Most of its tools only read. They list projects, search elements by id, title, kind, shape, tags or metadata, walk the element hierarchy, follow incoming and outgoing dependencies recursively, find relationship paths between two elements, compare two elements, and return view contents along with the source location of each item. render-view and preview-view draw a view as an interactive diagram inside chat on hosts that support MCP Apps. preview-view takes draft DSL text and renders it against the real model without saving anything.

The npm package @likec4/mcp runs the server alone over stdio. The workspace comes from LIKEC4_WORKSPACE, or the current directory when that is not set, and the server watches it for changes. The same server also comes built into the LikeC4 VS Code extension and the likec4 CLI (likec4 mcp).

The docs list 19 tools for the package. The v1.59.4 source (createMCPServer.ts) registers a 20th, apply-semantic-layout, which the docs leave out. It asks the client's own model for layout hints through MCP sampling, then saves a layout snapshot for the view into the workspace. The server's built-in instructions still describe every tool as read-only.

What it needs

RuntimeNode.js

Node.js, to run it with npx. A folder that holds one or more LikeC4 projects (.c4 / .likec4 files), set with LIKEC4_WORKSPACE or used as the current directory. render-view and preview-view need a client that supports MCP Apps. apply-semantic-layout needs a client that supports MCP sampling. No account or API key.

Limits

open-view is listed in the docs but works only when the server runs inside the LikeC4 editor extension. The standalone package does not register it. The tools cannot edit model source files, generate LeanIX bridge artifacts, run LeanIX sync, or export Draw.io with the leanix profile. The README sends those tasks to the likec4 CLI. Watch mode is on by default, and the docs suggest --no-watch to save resources on a static workspace. HTTP mode uses port 33335 unless --port is given. The source also accepts --graphviz binary|wasm (wasm by default), which the README's option list leaves out.

Who it suits

Suits teams that already keep their architecture in LikeC4 and want an assistant to answer dependency, impact and ownership questions straight from the model, without opening diagrams. It runs locally on your own files, needs no account, and is published by the LikeC4 project itself. VS Code users with the LikeC4 extension already have it built in. It is of no use without a LikeC4 model. For drawing diagrams in other tools, or editing the .c4 sources, you need something else.

Tools 21

list-projects
Lists the LikeC4 projects found in the workspace.
read-project-summary
Returns a project's specification, config, elements, deployment nodes and views.
search-element
Finds elements and deployment nodes in all projects by id, title, kind, shape, tags or metadata.
read-element
Gives one element's details: relationships, views it appears in, deployments, metadata, source location.
read-deployment
Gives details of a deployment node or a deployed instance.
read-view
Returns a view's nodes, edges and source location.
render-view
Draws a saved view as a pan-and-zoom diagram in chat, on MCP Apps hosts.
preview-view
Renders draft view DSL against a project's real elements without writing files.
find-relationships
Lists direct and indirect relationships between two elements.
query-graph
Walks hierarchy (parent, children, siblings, ancestors, descendants) and one-hop incomers or outgoers.
query-incomers-graph
Builds the full recursive graph of upstream dependencies of an element.
query-outgoers-graph
Builds the full recursive graph of downstream dependents of an element.
query-by-metadata
Filters elements by metadata key and value with exact, contains or exists matching.
query-by-tags
Filters elements by tags using allOf, anyOf and noneOf logic.
query-by-tag-pattern
Matches tags by prefix, substring or suffix.
find-relationship-paths
Finds multi-hop relationship chains between two elements with a bounded breadth-first search.
batch-read-elements
Returns summaries of several elements in one call, with links and source locations.
subgraph-summary
Summarises an element's descendants with depth, metadata and relationship counts.
element-diff
Compares two elements' properties, tags, metadata and relationships.
apply-semantic-layout
Gets layout hints from the client's model via sampling and saves a layout snapshot for a view.
open-view
Opens a view panel in the editor; only when running inside the LikeC4 extension.

Similar servers