Skip to content

Commit 193b394

Browse files
committed
fix(@angular/cli): skip workspace-specific tools when outside a workspace
When the MCP server is initialized outside of an Angular workspace, workspace-specific tools such as should not be registered as they will not function correctly.
1 parent 13b6223 commit 193b394

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/angular/cli/src/commands/mcp/mcp-server.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export async function createMcpServer(
5454
);
5555

5656
registerBestPracticesTool(server);
57-
registerListProjectsTool(server, context);
57+
58+
// If run outside an Angular workspace (e.g., globally) skip the workspace specific tools.
59+
// Currently only the `list_projects` tool.
60+
if (!context.workspace) {
61+
registerListProjectsTool(server, context);
62+
}
5863

5964
await registerDocSearchTool(server);
6065

0 commit comments

Comments
 (0)