From 1ca30a0ccfd89303d6272258c66096911f92a402 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Tue, 22 Sep 2026 12:56:14 +0200 Subject: [PATCH] Add a dependency-free service for the first run npm ci wants a lockfile, so an agent starting from an empty directory cannot use the example configuration until it has written a whole npm project. This one runs a server.js on node's own http module with no install step at all, which makes the shortest loop that exercises all three servers: write a file, start it, open it in the browser. It reads the port from PORT as well as from the argument. An agent writing a server from scratch reaches for process.env.PORT far more readily than for argv, and a preview listening on the wrong port fails its health check with nothing in the log to explain why. Co-Authored-By: Claude Opus 5 (1M context) --- dev-server-mcp/services.localhost.json | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dev-server-mcp/services.localhost.json diff --git a/dev-server-mcp/services.localhost.json b/dev-server-mcp/services.localhost.json new file mode 100644 index 0000000..70b2404 --- /dev/null +++ b/dev-server-mcp/services.localhost.json @@ -0,0 +1,28 @@ +{ + "_comment": [ + "A first end-to-end configuration, deliberately dependency-free.", + "", + "'node-app' runs whatever server.js the execution wrote, with node alone and no install step.", + "That is the point: npm ci needs a lockfile, so the shortest honest loop for an agent starting", + "from an empty directory is a server built on node's own http module. Once that works, move to", + "services.example.json, where execution-web installs a real dependency tree.", + "", + "The service reads its port from PORT as well as from the argument, because an agent writing a", + "server from scratch is more likely to reach for process.env.PORT than to parse argv." + ], + "services": { + "node-app": { + "command": "node", + "args": ["server.js", "${port}"], + "cwd": ".", + "workspaceMode": "execution", + "publicUrl": "http://dev-server-worker:${port}", + "healthUrl": "http://127.0.0.1:${port}/", + "startupTimeoutMs": 20000, + "shutdownTimeoutMs": 5000, + "env": { + "PORT": "${port}" + } + } + } +}