Skip to content

Commit bbeeb65

Browse files
committed
refactor(@angular/cli): remove modernize tool and add instructions for schematic discovery
Remove the `modernize` tool from the Angular CLI MCP server, as it is largely redundant with the official Angular developer skill and direct usage of schematics. To compensate for this removal, add instructions to the server describing how agents can use `ng generate <package>: --help` to discover available modernization schematics. This simplifies the codebase while maintaining the ability for agents to perform code modernization.
1 parent e6d80aa commit bbeeb65

4 files changed

Lines changed: 10 additions & 333 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { DEVSERVER_STOP_TOOL } from './tools/devserver/devserver-stop';
2121
import { DEVSERVER_WAIT_FOR_BUILD_TOOL } from './tools/devserver/devserver-wait-for-build';
2222
import { DOC_SEARCH_TOOL } from './tools/doc-search';
2323
import { E2E_TOOL } from './tools/e2e';
24-
import { MODERNIZE_TOOL } from './tools/modernize';
24+
2525
import { ZONELESS_MIGRATION_TOOL } from './tools/onpush-zoneless-migration/zoneless-migration';
2626
import { LIST_PROJECTS_TOOL } from './tools/projects';
2727
import { TEST_TOOL } from './tools/test';
@@ -48,13 +48,7 @@ const STABLE_TOOLS = [
4848
* The set of tools that are available but not enabled by default.
4949
* These tools are considered experimental and may have limitations.
5050
*/
51-
export const EXPERIMENTAL_TOOLS = [
52-
BUILD_TOOL,
53-
E2E_TOOL,
54-
MODERNIZE_TOOL,
55-
TEST_TOOL,
56-
...DEVSERVER_TOOLS,
57-
] as const;
51+
export const EXPERIMENTAL_TOOLS = [BUILD_TOOL, E2E_TOOL, TEST_TOOL, ...DEVSERVER_TOOLS] as const;
5852

5953
/**
6054
* Experimental tools that are grouped together under a single name.
@@ -105,6 +99,12 @@ equivalent actions.
10599
106100
* **3. Answer User Questions:**
107101
- For conceptual questions ("what is..."), use \`search_documentation\`.
102+
103+
* **4. Discover Schematics for Modernization:** Since this server does not provide a
104+
specific tool for listing available schematics, you can use a shell command (if
105+
available) with \`ng generate <package-name>: --help\` to discover what migrations
106+
are available in a package (e.g., running \`ng generate @angular/core: --help\`
107+
will list migrations like \`control-flow\` and \`standalone\`).
108108
</Core Workflows & Tool Guide>
109109
110110
<Key Concepts>

packages/angular/cli/src/commands/mcp/tools/modernize.ts

Lines changed: 0 additions & 192 deletions
This file was deleted.

packages/angular/cli/src/commands/mcp/tools/modernize_spec.ts

Lines changed: 0 additions & 131 deletions
This file was deleted.

packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ most important action to take in the migration journey.
4444
* **Iterative Process:** The migration process is iterative. You must call this tool repeatedly,
4545
applying the suggested fix after each call, until the tool indicates that no more actions are
4646
needed.
47-
* **Relationship to \`modernize\`:** This tool is the specialized starting point for the zoneless/OnPush
48-
migration. For other migrations (like signal inputs), you should use the \`modernize\` tool first,
47+
* **Relationship to other migrations:** This tool is the specialized starting point for the zoneless/OnPush
48+
migration. For other migrations (like signal inputs), you should run the corresponding schematics first,
4949
as the zoneless migration may depend on them as prerequisites.
5050
* **Input:** The tool can operate on either a single file or an entire directory. Provide the
5151
absolute path.

0 commit comments

Comments
 (0)