Skip to content

Commit ab93b81

Browse files
committed
refactor(@angular/cli): promote experimental MCP tools to stable
Promote `run_target` and `devserver` tools (which includes `devserver.start`, `devserver.stop`, and `devserver.wait_for_build`) from experimental to stable so they are registered and available by default on the MCP server. Update the tool assembly and warning logic to allow enabling these now-stable tools via `-E` or `--experimental-tool` without generating "Unknown experimental tool" warnings, preserving backward compatibility. Update run-target e2e tests accordingly.
1 parent 2fd0530 commit ab93b81

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ const STABLE_TOOLS = [
4141
DOC_SEARCH_TOOL,
4242
LIST_PROJECTS_TOOL,
4343
ZONELESS_MIGRATION_TOOL,
44+
RUN_TARGET_TOOL,
45+
...DEVSERVER_TOOLS,
4446
] as const;
4547

4648
/**
4749
* The set of tools that are available but not enabled by default.
4850
* These tools are considered experimental and may have limitations.
4951
*/
50-
export const EXPERIMENTAL_TOOLS = [RUN_TARGET_TOOL, ...DEVSERVER_TOOLS] as const;
52+
export const EXPERIMENTAL_TOOLS: readonly AnyMcpToolDeclaration[] = [] as const;
5153

5254
/**
5355
* Experimental tools that are grouped together under a single name.
@@ -56,7 +58,6 @@ export const EXPERIMENTAL_TOOLS = [RUN_TARGET_TOOL, ...DEVSERVER_TOOLS] as const
5658
*/
5759
export const EXPERIMENTAL_TOOL_GROUPS = {
5860
'all': EXPERIMENTAL_TOOLS,
59-
'devserver': DEVSERVER_TOOLS,
6061
};
6162

6263
export async function createMcpServer(
@@ -205,7 +206,7 @@ export function assembleToolDeclarations(
205206
const tool = experimentalToolsMap.get(toolName);
206207
if (tool) {
207208
toolDeclarations.push(tool);
208-
} else {
209+
} else if (!stableDeclarations.some((t) => t.name === toolName)) {
209210
options.logger.warn(`Unknown experimental tool: ${toolName}`);
210211
}
211212
}

tests/e2e/tests/mcp/run-target.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ export default async function () {
2929
);
3030

3131
try {
32-
// 1. Ensure `run_target` is NOT registered by default (stable-only tools registered)
32+
// 1. Ensure `run_target` is registered by default (now stable)
3333
const { stdout: stdoutDefault } = await runInspector('--method', 'tools/list');
34-
assert.doesNotMatch(stdoutDefault, /"run_target"/);
34+
assert.match(stdoutDefault, /"run_target"/);
3535

36-
// 2. Ensure `run_target` is registered when explicitly enabled via experimental-tool flag
36+
// 2. Ensure `run_target` is also registered when using the deprecated experimental-tool flag
3737
const { stdout: stdoutEnabled } = await runInspector(
3838
'-E',
3939
'run_target',
@@ -44,8 +44,6 @@ export default async function () {
4444

4545
// 3. Call run_target with build target
4646
const { stdout: stdoutCall } = await runInspector(
47-
'-E',
48-
'run_target',
4947
'--method',
5048
'tools/call',
5149
'--tool-name',
@@ -66,8 +64,6 @@ export default async function () {
6664
// 4. Call run_target with test target (only for esbuild/Vite test runner, as webpack-based Karma fails on this bazel CI headless runner)
6765
if (esbuild) {
6866
const { stdout: stdoutTestCall } = await runInspector(
69-
'-E',
70-
'run_target',
7167
'--method',
7268
'tools/call',
7369
'--tool-name',

0 commit comments

Comments
 (0)