MCP Server
LikeC4 MCP Server provides knowledge of your LikeC4 model to LLMs.
This enables you to query your model in natural language:
“Lookup LikeC4 model and list all incoming relationships of the backend api”
“What nested elements of the ‘Backend’ have relations with the legacy api”
“List all elements tagged legacy from team1 project”
“What technologies are used for ui (consider all elements with browser shape)”
“Export to CSV all relationships between Backend and Amazon SQS”
Three options are available:
- Use extension’s built-in MCP Server
- Use
likec4 mcpCLI - Use
@likec4/mcppackage
Using extension
Section titled “Using extension”When LikeC4 extension is installed, MCP Server can be enabled from the extension settings.
To configure MCP Server:
Create .vscode/mcp.json:
{ "servers": { "likec4": { "type": "sse", "url": "http://localhost:33335/mcp" } }}Create .cursor/mcp.json:
{ "mcpServers": { "likec4": { "url": "http://localhost:33335/mcp" } }}See Windsurf documentation for details:
{ "mcpServers": { "likec4": { "serverUrl": "http://localhost:33335/mcp" } }}You can change port in the settings.
Using CLI
Section titled “Using CLI”If you have installed likec4 CLI, you can start MCP server with stdio transport:
likec4 mcp# orlikec4 mcp --stdioStart MCP server with http transport on port 33335 (default) at ./src folder:
likec4 mcp --http ./srcStart MCP server with http transport on port 1234:
likec4 mcp -p 1234Using @likec4/mcp package
Section titled “Using @likec4/mcp package”Example configuration:
{ "mcpServers": { "likec4": { "command": "npx", "args": [ "-y", "@likec4/mcp" ], "env": { "LIKEC4_WORKSPACE": "${workspaceFolder}" } } }}This package starts MCP server using stdio transport.
If LIKEC4_WORKSPACE environment variable is not set, the current directory will be used as workspace.
Check out README for more details.