{"record":{"id":"62cb8a7fe82e8c9e","repo":"angular/angular-cli","slug":"dev-server-not-found-currently-running-servers-62cb8a","errorCode":null,"errorMessage":"Dev server not found. Currently running servers:\n${runningServers}\nPlease provide the correct workspace and project arguments.","messagePattern":"Dev server not found\\. Currently running servers:\n(.+?)\nPlease provide the correct workspace and project arguments\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/mcp/tools/devserver/devserver-wait-for-build.ts","lineNumber":71,"sourceCode":"  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport async function waitForDevserverBuild(\n  input: DevserverWaitForBuildToolInput,\n  context: McpToolContext,\n) {\n  const { workspacePath, projectName } = await resolveWorkspaceAndProject({\n    host: context.host,\n    server: context.server,\n    workspacePathInput: input.workspace,\n    projectNameInput: input.project,\n    mcpWorkspace: context.workspace,\n  });\n  const key = getDevserverKey(workspacePath, projectName);\n  const devserver = context.devservers.get(key);\n\n  if (!devserver) {\n    throw createDevServerNotFoundError(context.devservers);\n  }\n\n  return performWait(devserver, input.timeout);\n}\n\nasync function performWait(devserver: Devserver, timeout: number) {\n  const deadline = Date.now() + timeout;\n  await wait(WATCH_DELAY);\n  while (devserver.isBuilding()) {\n    if (Date.now() > deadline) {\n      return createStructuredContentOutput<DevserverWaitForBuildToolOutput>({\n        status: 'timeout',\n        logs: undefined,\n      });\n    }\n    await wait(WATCH_DELAY);\n  }\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/tools/devserver/devserver-wait-for-build.ts#L53-L89","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Call devserver-start first so the server is registered under this workspace/project.","Use the exact 'Currently running servers' entry from the error message for workspace and project.","Confirm the project name matches angular.json.","If the server was stopped, restart it before waiting on build results."],"exampleFix":"// before\nawait DEVSERVER_WAIT_FOR_BUILD_TOOL({ workspacePath, project: 'wrong-name' });\n// after\nawait DEVSERVER_START_TOOL({ workspacePath, project: 'my-app' });\nawait DEVSERVER_WAIT_FOR_BUILD_TOOL({ workspacePath, project: 'my-app' });","handlingStrategy":"validation","validationCode":"const key = getDevserverKey(workspacePath, projectName);\nif (!context.devservers.has(key)) {\n  await DEVSERVER_START_TOOL({ workspacePath, project: projectName });\n}","typeGuard":null,"tryCatchPattern":"try {\n  await DEVSERVER_WAIT_FOR_BUILD_TOOL({ workspacePath, project });\n} catch (err) {\n  if (!(err instanceof Error && err.message.includes('Dev server not found'))) throw err;\n  // start the server, then retry the wait\n}","preventionTips":["Always start the devserver before waiting on its build.","Use exact project names from angular.json.","Don't stop the server between start and wait calls.","Inspect the running-servers list in the error before retrying."],"tags":["dev-server","mcp","angular-cli","lookup-failed"],"backgroundTag":"dev-server-not-found","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}