MCP.so
ログイン

LikeC4

@likec4

LikeC4 について

LikeC4 MCP Server provides knowledge of your LikeC4 model to LLMs.

基本情報

カテゴリ

その他

トランスポート

stdio

公開者

likec4

投稿者

Denis Davydkov

設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "likec4": {
      "command": "npx",
      "args": [
        "-y",
        "@likec4/mcp"
      ],
      "env": {
        "LIKEC4_WORKSPACE": "${workspaceFolder}"
      }
    }
  }
}

ツール

7

List LikeC4 projects discoverable in the current workspace. Request: - No input parameters. Response (JSON object): - projects: Project[] Project (object) fields: - id: string — stable project identifier - title: string — human-readable project title - folder: string — absolute path to the project root - sources: string[] — absolute file paths of related documents Notes: - Read-only, idempotent, no side effects. - Safe to call repeatedly. Example response: { "projects": [ { "id": "docs", "title": "Documentation", "folder": "/abs/path/to/workspace/docs", "sources": [ "/abs/path/to/workspace/docs/model/contexts.likec4", "/abs/path/to/workspace/docs/model/relations.likec4" ] } ] }

Request: - project: string (optional) — project id. Defaults to "default" if omitted. Response (JSON object): - title: string — human-readable project title - folder: string — absolute path to the project root - sources: string[] — absolute file paths of model documents - specification: object - elementKinds: string[] — all element kinds - relationshipKinds: string[] — all relationship kinds - deploymentKinds: string[] — all deployment kinds - tags: string[] — all tags - metadataKeys: string[] — used metadata keys - elements: Element[] — list of elements - deployments: Deployment[] — list of deployment entities - views: View[] — list of views defined in the model Element (object) fields: - id: string — element id (FQN) - kind: string — element kind - title: string — element title - tags: string[] — element tags Deployment (object) fields: - type = "deployment-node": { id: string, kind: string, title: string, tags: string[] } - type = "deployed-instance": { id: string, title: string, tags: string[], referencedElementId: string } View (object) fields: - id: string — view identifier - title: string — view title - type: "element" | "deployment" | "dynamic" Notes: - Read-only, idempotent, no side effects. - Safe to call repeatedly. Example response: { "title": "Cloud Boutique", "folder": "/abs/path/to/workspace/examples/cloud-system", "sources": [ "/abs/path/to/workspace/examples/cloud-system/model.c4" ], "specification": { "elementKinds": ["system", "container", "component"], "relationshipKinds": ["uses", "depends-on"], "deploymentKinds": ["node", "cluster"], "tags": ["public", "internal"], "metadataKeys": ["owner", "tier"] }, "elements": [ { "id": "shop.frontend", "kind": "component", "title": "Frontend", "tags": ["public"] } ], "deployments": [ { "type": "deployment-node", "id": "k8s.shop.frontend", "kind": "cluster", "title": "Frontend", "tags": [] } ], "views": [ { "name": "system-overview", "title": "System Overview", "type": "element" } ] }

Read detailed information about a LikeC4 element. Request: - id: string — element id (FQN) - project: string (optional) — project id. Defaults to "default" if omitted. Response (JSON object): - id: string — element id (FQN) - name: string — element name - kind: string — element kind - title: string — human-readable title - description: string|null — optional description - technology: string|null — optional technology - tags: string[] — assigned tags - project: string — project id this element belongs to - metadata: Record<string, string> — element metadata - shape: string — rendered shape - color: string — rendered color - children: string[] — ids (FQNs) of direct child elements - defaultView: string|null — default view name if set - includedInViews: View[] — views that include this element - relationships: object — relationships of this element (direct and indirect) - incoming: Array<{ source: { id: string, title: string, kind: string }, kind: string|null, target: string, title: string|null, description: string|null, technology: string|null, tags: string[] }> - outgoing: Array<{ source: string, target: { id: string, title: string, kind: string }, kind: string|null, title: string|null, description: string|null, technology: string|null, tags: string[] }> - deployedInstances: string[] — deployed instance ids (Deployment FQNs) - sourceLocation: { path: string, range: { start: { line: number, character: number }, end: { line: number, character: number } } } | null — source location if available View (object) fields: - id: string — view identifier - title: string — view title - type: "element" | "deployment" | "dynamic" Notes: - Read-only, idempotent, no side effects. - Safe to call repeatedly. Example response: { "id": "shop.frontend", "name": "frontend", "kind": "container", "title": "Frontend", "description": "User-facing web app", "technology": "React", "tags": ["public"], "project": "default", "metadata": { "owner": "web" }, "shape": "rounded-rectangle", "color": "#2F80ED", "children": ["shop.frontend.auth"], "defaultView": "frontend-overview", "includedInViews": [ { "id": "frontend-overview", "title": "Frontend Overview", "type": "element" } ], "relationships": { "incoming": [ { "source": { "id": "shop.api", "title": "API", "kind": "container" }, "kind": "uses", "target": "shop.frontend", "title": "Calls", "description": null, "technology": "HTTPS", "tags": [] } ], "outgoing": [] }, "deployedInstances": ["k8s.cluster.frontend"], "sourceLocation": { "path": "/abs/path/project/model.c4", "range": { "start": { "line": 10, "character": 0 }, "end": { "line": 25, "character": 0 } } } }

Read details about a deployment node or a deployed instance in a LikeC4 project. What it does: - Returns metadata about a deployment entity (node or instance), including kind, tags, color/shape, children, which views include it, and its source location. Inputs: - id: string — Deployment id (FQN) - project: string (optional, defaults to "default") — Project id Output fields: - type: "deployment-node" | "deployed-instance" - id: string — Deployment id (FQN) - kind: string — Deployment node kind, or element kind for deployed instances - name: string — Name of the deployment entity - title: string — Title of the deployment entity - description: string|null — Description text - technology: string|null — Technology info, if any - tags: string[] — Tags assigned to this entity - project: string — Project id - metadata: Record<string, string> - shape: string — Rendered shape - color: string — Rendered color - children: string[] — Child deployment ids (empty for instances) - includedInViews: View[] — Views that include this entity - instanceof: { id: string, title: string, kind: string } | null — If type is "deployed-instance", the referenced element - sourceLocation: { path: string, range: { start: { line: number, character: number }, end: { line: number, character: number } } } | null View (object) fields: - id: string — view identifier - title: string — view title - type: "element" | "deployment" | "dynamic" Notes: - Read-only, idempotent; does not mutate the model. Example request: { "id": "k8s.cluster.frontend", "project": "default" } Example response (deployed instance): { "type": "deployed-instance", "id": "k8s.cluster.frontend", "kind": "k8s.pod", "name": "frontend", "title": "Frontend Pod", "description": null, "technology": "Kubernetes", "tags": ["prod"], "project": "default", "metadata": {}, "shape": "rectangle", "color": "#2F80ED", "children": [], "includedInViews": [ { "id": "runtime-overview", "title": "Runtime Overview", "type": "deployment" } ], "instanceof": { "id": "shop.frontend", "title": "Frontend", "kind": "component" }, "sourceLocation": { "path": "/abs/path/project/model.c4", "range": { "start": { "line": 10, "character": 0 }, "end": { "line": 25, "character": 0 } } } }

Read detailed information about a LikeC4 view. Request: - viewId: string — view id (name) - project: string (optional) — project id. Defaults to "default" if omitted. Response (JSON object): - id: string — view id - type: "element" | "deployment" | "dynamic" — view type - title: string — view title (falls back to id if not set) - description: string|null — optional description - tags: string[] — view tags - project: string — project id this view belongs to - nodes: Node[] — nodes included in the view - edges: Edge[] — relationships between nodes - sourceLocation: { path: string, range: { start: { line: number, character: number }, end: { line: number, character: number } } } | null — source location if available Node (discriminated union by "type"): - type = "element": { id: string, elementId: string, kind: string, title: string, description: string|null, technology: string|null, children: string[], shape: string, color: string, tags: string[] } - type = "deployment-node": { id: string, deploymentId: string, kind: string, title: string, description: string|null, technology: string|null, children: string[], shape: string, color: string, tags: string[] } - type = "deployed-instance": { id: string, deploymentId: string, title: string, description: string|null, technology: string|null, referencedElement: { id: string, kind: string, title: string }, shape: string, color: string, tags: string[] } Edge object: - { source: string, target: string, label: string|null, description: string|null, technology: string|null, tags: string[] } Notes: - Read-only, idempotent, no side effects. Example response: { "id": "system-overview", "type": "element", "title": "System Overview", "description": null, "tags": [], "project": "default", "nodes": [ { "type": "logical", "id": "n1", "elementId": "shop.frontend", "kind": "container", "title": "Frontend", "description": null, "technology": "React", "children": [], "shape": "rounded-rectangle", "color": "#2F80ED", "tags": [] } ], "edges": [ { "source": "n1", "target": "n2", "label": "calls", "description": null, "technology": "HTTPS", "tags": [] } ], "sourceLocation": { "path": "/abs/path/project/model.c4", "range": { "start": { "line": 10, "character": 0 }, "end": { "line": 30, "character": 0 } } } }

Search LikeC4 elements and deployment nodes across all projects. Query syntax (case-insensitive): - kind:<value>: filters by kind - shape:<value>: filters by shape - meta:<key>: filters by having metadata with the given key - #<value>: matches assigned tags - Free text: matches id (FQN) or title Request: - search: string — at least 2 characters Response (JSON object): - total: number - total number of results - found: Result[] - returns top 20 results Result (discriminated union by "type"): - type = "element": { id: string, name: string, kind: string, title: string, technology: string|null, shape: string, project: string, includedInViews: View[], tags: string[], metadata: Record<string, string> } - type = "deployment-node": { id: string, name: string, kind: string, title: string, technology: string|null, shape: string, project: string, includedInViews: View[], tags: string[], metadata: Record<string, string> } View (object) fields: - id: string — view identifier - title: string — view title - type: "element" | "deployment" | "dynamic" Notes: - Read-only, idempotent. - Use results as input to other tools (e.g., read-element, read-view). Example response: { "total": 1, "found": [ { "type": "logical", "project": "default", "id": "shop.frontend", "name": "frontend", "kind": "container", "title": "Frontend", "technology": "React", "shape": "rectangle", "includedInViews": [ { "id": "system-overview", "title": "System Overview", "type": "element" } ], "tags": ["public"], "metadata": {} } ] }

Find relationships between two LikeC4 elements within a project. What it does: - Finds both direct relationships (element1 ↔ element2) and indirect ones that arise via containment (e.g. via nested elements). - Returns rich metadata for each relationship and where it appears in views. Inputs: - element1: string — Element ID (FQN) - element2: string — Element ID (FQN) - project: string (optional, defaults to "default") — Project id Output: - found: Relationship[] Relationship (object) fields: - type: "direct" | "indirect" — direct is between the specified endpoints; indirect is via nested elements - source: Endpoint - target: Endpoint - kind: string|null — relationship kind from the model - title: string|null — relationship title if provided - description: string|null — relationship description text - technology: string|null — relationship technology - tags: string[] — relationship tags - includedInViews: View[] — views where this relationship appears - sourceLocation: { path: string, range: { start: { line: number, character: number }, end: { line: number, character: number } } } | null Endpoint (object) fields: - id: string — Element ID (FQN) - title: string — element title - kind: string — element kind View (object) fields: - id: string — view identifier - title: string — view title - type: "element" | "deployment" | "dynamic" Notes: - Read-only, idempotent; does not mutate the model. May trigger UI navigation in supporting clients. - The order of results is not guaranteed. Example: Request: { "element1": "shop.frontend", "element2": "shop.backend", "project": "default" } Response: { "found": [ { "type": "direct", "source": { "id": "shop.frontend", "title": "Frontend", "kind": "component" }, "target": { "id": "shop.backend", "title": "Backend", "kind": "component" }, "kind": "sync", "title": "Calls", "description": "Frontend calls Backend", "technology": "HTTP", "tags": ["public"], "includedInViews": [ { "id": "system-overview", "title": "System Overview", "type": "element" } ], "sourceLocation": { "path": "/abs/path/project/model.c4", "range": { "start": { "line": 12, "character": 0 }, "end": { "line": 14, "character": 0 } } } } ] }

概要

What is LikeC4?

LikeC4 is a modeling language for describing software architecture and a set of tools to generate diagrams from the model. It is inspired by the C4 Model and Structurizr DSL but offers flexibility to customize notation, element types, and nested levels to fit specific needs.

How to use LikeC4?

Write architecture models in LikeC4 source files (e.g., .c4). Use the CLI to preview diagrams by running npx likec4 start. A VS Code extension is available for syntax highlighting, validation, and live preview within the editor.

Key features of LikeC4

  • Modeling language for software architecture as code
  • Generates live diagrams from the model
  • Customizable notation, element types, and nested levels
  • CLI server for instant preview (npx likec4 start)
  • VS Code extension for in-editor support
  • Open source under MIT license

Use cases of LikeC4

  • Documenting and visualizing software architecture for teams
  • Collaborating on architecture with always up-to-date diagrams
  • Evolving architecture models alongside code changes
  • Generating diagrams for presentations or documentation

FAQ from LikeC4

How is LikeC4 different from the C4 Model?

LikeC4 is inspired by the C4 Model but provides flexibility to customize notation, element types, and any number of nested levels, perfectly tailored to your needs.

How do I preview diagrams with LikeC4?

Run npx likec4 start in your project directory to start a local preview server that shows live diagrams from your model.

Is there a VS Code extension for LikeC4?

Yes, a VS Code extension is available on the marketplace (and Open VSX) that provides syntax highlighting, validation, and live preview.

What license does LikeC4 use?

LikeC4 is released under the MIT License.

コメント

「その他」の他のコンテンツ