{"record":{"id":"096b95dc8a7ca693","repo":"angular/angular-cli","slug":"dev-server-not-found-currently-running-servers","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-stop.ts","lineNumber":41,"sourceCode":"  message: z.string().describe('A message indicating the result of the operation.'),\n  logs: z.array(z.string()).optional().describe('The full logs from the dev server.'),\n});\n\nexport type DevserverStopToolOutput = z.infer<typeof devserverStopToolOutputSchema>;\n\nexport async function stopDevserver(input: DevserverStopToolInput, context: McpToolContext) {\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  devserver.stop();\n  context.devservers.delete(key);\n\n  return createStructuredContentOutput({\n    message: `Development server for project '${projectName}' stopped.`,\n    logs: devserver.getServerLogs(),\n  });\n}\n\nexport const DEVSERVER_STOP_TOOL: McpToolDeclaration<\n  typeof devserverStopToolInputSchema.shape,\n  typeof devserverStopToolOutputSchema.shape\n> = declareTool({\n  name: 'devserver_stop',\n  title: 'Stop Development Server',\n  description: `","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/mcp/tools/devserver/devserver-stop.ts#L23-L59","documentation":"The devserver-stop MCP tool throws this when context.devservers has no entry for the key derived from (workspacePath, projectName). The message enumerates the currently running servers to help the caller supply the correct arguments. It wraps createDevServerNotFoundError from packages/angular/cli/src/commands/mcp/devserver.ts.","triggerScenarios":"Calling the devserver-stop tool with a workspace path or project name that does not exactly match the key under which the server was registered at start time, or stopping a server that was never started or already stopped (it was deleted from the map).","commonSituations":"Case or trailing-slash differences in the workspace path; project name omitted or misspelled relative to angular.json; the server already stopped in a previous tool call; MCP session restarted so the in-memory devservers map is empty.","solutions":["Read the 'Currently running servers:' list in the message and re-issue stop with the exact workspace/project pair shown.","Verify the project name matches an entry in angular.json exactly.","Check the server has not already been stopped (stopping removes it from the map).","Restart the server with devserver-start if it should be running but the map is empty."],"exampleFix":"// before\nawait DEVSERVER_STOP_TOOL({ workspacePath: '/repo/my-app ', project: 'MyApp' }); // not found\n// after\nawait DEVSERVER_STOP_TOOL({ workspacePath: '/repo/my-app', project: 'my-app' });","handlingStrategy":"validation","validationCode":"const key = getDevserverKey(workspacePath, projectName);\nif (!context.devservers.has(key)) {\n  throw new Error(`No devserver for ${key}; running: ${[...context.devservers.keys()].join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await DEVSERVER_STOP_TOOL({ workspacePath, project });\n} catch (err) {\n  if (!(err instanceof Error && err.message.includes('Dev server not found'))) throw err;\n  // fall back to the listed running servers\n}","preventionTips":["Copy workspace/project values exactly from the 'Currently running servers' list.","Use the same workspacePath string that was passed to devserver-start.","Remember stop removes the server; don't stop twice.","Keep devserver start/stop within one MCP session."],"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"}