Skip to content

MCP server

The MCP (Model Context Protocol) server publishes MicroLab engine operations as tools for AI clients (Claude Code, Claude Desktop, Cursor…). It’s the same surface the app’s copilot uses. The tools are generated from the operations registry, so MCP and CLI don’t diverge.

Today it publishes 42 tools, 2 resources and 3 flow prompts.

It’s not a dump of the registry (92 operations): the AI operates the lab —launch, test, mock, debug—, while the catalog authoring (create micros and scenarios, edit machine settings, import/export by file) stays in the app and the CLI. A model chooses worse the longer the list. Nothing is lost: what’s hidden is still in microlab ops, the CLI and the control server.

The client launches microlab mcp as a child process. It requires the compiled engine (npm run build:electron) and it’s advisable to use absolute paths and an explicit -p (the project folder with .microlab/).

Claude Code:

Ventana de terminal
claude mcp add microlab -- node C:\tools\micro-lab\bin\microlab.js mcp -p C:\projects\my-project

Claude Desktop / Cursor (claude_desktop_config.json or .cursor/mcp.json):

{
"mcpServers": {
"microlab": {
"command": "node",
"args": ["C:\\tools\\micro-lab\\bin\\microlab.js", "mcp", "-p", "C:\\projects\\my-project"]
}
}
}

With the global executable (npm link), "command": "microlab", "args": ["mcp", "-p", "..."] is enough.

With a live engine (the app open or the daemon), the same server is available over Streamable HTTP at the /mcp route of the control server, for clients that don’t launch processes. The URL and the token come from control.json; every request carries Authorization: Bearer <token>.

  • Tools — 42, grouped by domain (scenario lifecycle, debugging, Docker, read-only catalog, mocks…). Each carries readOnlyHint or destructiveHint annotations where it applies, so the client decides what to run without confirmation.
  • Resourcesmicrolab://guide (operation guide for AIs, in markdown) and microlab://status (JSON snapshot: version, paths, live engine, active scenario and its micros’ status).
  • Prompts — three flow recipes: levantar-y-probar, mockear-dependencia and depurar-micro.

Same as the CLI: if there is a live engine, the tool runs against it (same state as the UI); if not, the stateless tools run in-proc. scenario_start and scenario_up_and_wait launch the daemon if it’s missing; the micros survive the MCP session (closing the AI client doesn’t stop them; to stop them, scenario_stop).

In projects with login, the MCP requires the mcp capability (independent of cli). Without it, stdio exits with 5 and HTTP responds 403. See Capabilities.