angular/angular-cli · error · Error

Dev server not found. Currently running servers: ${runningSe

Error message

Dev server not found. Currently running servers:
${runningServers}
Please provide the correct workspace and project arguments.

What it means

The devserver-wait-for-build MCP tool throws this when no Devserver is registered under the (workspacePath, projectName) key in context.devservers, so there is no server whose build can be awaited. The message lists running servers to help pick correct arguments. It wraps createDevServerNotFoundError.

Source

Thrown at packages/angular/cli/src/commands/mcp/tools/devserver/devserver-wait-for-build.ts:71

  return new Promise((resolve) => setTimeout(resolve, ms));
}

export async function waitForDevserverBuild(
  input: DevserverWaitForBuildToolInput,
  context: McpToolContext,
) {
  const { workspacePath, projectName } = await resolveWorkspaceAndProject({
    host: context.host,
    server: context.server,
    workspacePathInput: input.workspace,
    projectNameInput: input.project,
    mcpWorkspace: context.workspace,
  });
  const key = getDevserverKey(workspacePath, projectName);
  const devserver = context.devservers.get(key);

  if (!devserver) {
    throw createDevServerNotFoundError(context.devservers);
  }

  return performWait(devserver, input.timeout);
}

async function performWait(devserver: Devserver, timeout: number) {
  const deadline = Date.now() + timeout;
  await wait(WATCH_DELAY);
  while (devserver.isBuilding()) {
    if (Date.now() > deadline) {
      return createStructuredContentOutput<DevserverWaitForBuildToolOutput>({
        status: 'timeout',
        logs: undefined,
      });
    }
    await wait(WATCH_DELAY);
  }

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Call devserver-start first so the server is registered under this workspace/project.
  2. Use the exact 'Currently running servers' entry from the error message for workspace and project.
  3. Confirm the project name matches angular.json.
  4. If the server was stopped, restart it before waiting on build results.

Example fix

// before
await DEVSERVER_WAIT_FOR_BUILD_TOOL({ workspacePath, project: 'wrong-name' });
// after
await DEVSERVER_START_TOOL({ workspacePath, project: 'my-app' });
await DEVSERVER_WAIT_FOR_BUILD_TOOL({ workspacePath, project: 'my-app' });
Defensive patterns

Strategy: validation

Validate before calling

const key = getDevserverKey(workspacePath, projectName);
if (!context.devservers.has(key)) {
  await DEVSERVER_START_TOOL({ workspacePath, project: projectName });
}

Try / catch

try {
  await DEVSERVER_WAIT_FOR_BUILD_TOOL({ workspacePath, project });
} catch (err) {
  if (!(err instanceof Error && err.message.includes('Dev server not found'))) throw err;
  // start the server, then retry the wait
}

Prevention

When it happens

Trigger: Calling devserver-wait-for-build before devserver-start, with a mismatched workspace/project key, or after the server was stopped and removed from the map.

Common situations: Agent waits on a build but the start tool ran in a different MCP session; wrong project name (name differs from directory name); server crashed or was stopped, removing it from the registry.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/62cb8a7fe82e8c9e. Report an issue: GitHub.