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-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.
Source
Thrown at packages/angular/cli/src/commands/mcp/tools/devserver/devserver-stop.ts:41
message: z.string().describe('A message indicating the result of the operation.'),
logs: z.array(z.string()).optional().describe('The full logs from the dev server.'),
});
export type DevserverStopToolOutput = z.infer<typeof devserverStopToolOutputSchema>;
export async function stopDevserver(input: DevserverStopToolInput, 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);
}
devserver.stop();
context.devservers.delete(key);
return createStructuredContentOutput({
message: `Development server for project '${projectName}' stopped.`,
logs: devserver.getServerLogs(),
});
}
export const DEVSERVER_STOP_TOOL: McpToolDeclaration<
typeof devserverStopToolInputSchema.shape,
typeof devserverStopToolOutputSchema.shape
> = declareTool({
name: 'devserver_stop',
title: 'Stop Development Server',
description: `View on GitHub (pinned to bb72145f9a)
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.
Example fix
// before
await DEVSERVER_STOP_TOOL({ workspacePath: '/repo/my-app ', project: 'MyApp' }); // not found
// after
await DEVSERVER_STOP_TOOL({ workspacePath: '/repo/my-app', project: 'my-app' }); Defensive patterns
Strategy: validation
Validate before calling
const key = getDevserverKey(workspacePath, projectName);
if (!context.devservers.has(key)) {
throw new Error(`No devserver for ${key}; running: ${[...context.devservers.keys()].join(', ')}`);
} Try / catch
try {
await DEVSERVER_STOP_TOOL({ workspacePath, project });
} catch (err) {
if (!(err instanceof Error && err.message.includes('Dev server not found'))) throw err;
// fall back to the listed running servers
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Dev server not found. Currently running servers: ${runningSe
- Dev server already started.
- Workspace path is outside the allowed MCP roots: ${workspace
- Watch mode execution (serve target or watch option) is not y
- Workspace path is outside the allowed MCP roots: ${workspace
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/096b95dc8a7ca693.
Report an issue: GitHub.