Skip to content

refactor(@angular/cli): restrict MCP host process spawning to Angular CLI executable#33132

Open
clydin wants to merge 1 commit intoangular:mainfrom
clydin:refactor/mcp-host-ng-restriction
Open

refactor(@angular/cli): restrict MCP host process spawning to Angular CLI executable#33132
clydin wants to merge 1 commit intoangular:mainfrom
clydin:refactor/mcp-host-ng-restriction

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented May 5, 2026

Update the Host abstraction inside the Model Context Protocol (MCP) layer to tighten the system shell surface and improve semantics. The generic spawn and execute methods are replaced with specialized counterparts that default to the Angular CLI, enabling stronger path security containment for developers while also clarifying the distinct control flows needed for buffered discrete commands and long-running background services.

@clydin clydin added the target: minor This PR is targeted for the next minor release label May 5, 2026
@clydin clydin force-pushed the refactor/mcp-host-ng-restriction branch from 78a278f to 352e6d4 Compare May 5, 2026 17:31
@clydin clydin marked this pull request as ready for review May 5, 2026 19:50
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 5, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Host interface by renaming runCommand to executeNgCommand and spawn to startNgProcess, while removing the redundant command parameter as these methods now specifically target the Angular CLI. These changes are consistently applied across the devserver, build, e2e, and test tools, as well as their mock implementations and unit tests. Feedback identifies that the options parameters in the createRootRestrictedHost implementation are typed too narrowly, which may cause properties like timeout, stdio, or env to be inaccessible or lost when delegating to the base host.

Comment thread packages/angular/cli/src/commands/mcp/host.ts Outdated
Comment thread packages/angular/cli/src/commands/mcp/host.ts Outdated
@clydin clydin force-pushed the refactor/mcp-host-ng-restriction branch from 352e6d4 to edde1be Compare May 5, 2026 20:10
… CLI executable

Update the Host abstraction inside the Model Context Protocol (MCP) layer to tighten the system shell surface and improve semantics. The generic spawn and execute methods are replaced with specialized counterparts that default to the Angular CLI, enabling stronger path security containment for developers while also clarifying the distinct control flows needed for buffered discrete commands and long-running background services.
@clydin clydin force-pushed the refactor/mcp-host-ng-restriction branch from edde1be to e1aaddd Compare May 5, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant