Skip to content

refactor(@angular/cli): integrate MCP roots into Host abstraction#33090

Merged
dgp1130 merged 1 commit intoangular:mainfrom
clydin:refactor/mcp-roots-integration
Apr 30, 2026
Merged

refactor(@angular/cli): integrate MCP roots into Host abstraction#33090
dgp1130 merged 1 commit intoangular:mainfrom
clydin:refactor/mcp-roots-integration

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Apr 29, 2026

Update the Host abstraction to be aware of allowed roots provided by the MCP client. A new createRootRestrictedHost wrapper enforces that file operations and command executions stay within these roots. The server is updated to initialize roots on connection and listen for changes.

@clydin clydin force-pushed the refactor/mcp-roots-integration branch from 960270e to 08b674d Compare April 29, 2026 17:16
@clydin clydin marked this pull request as ready for review April 29, 2026 17:42
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 implements path restriction for the MCP host by introducing a createRootRestrictedHost wrapper and updating the Host interface with a setRoots method. The MCP server now dynamically manages these roots based on client capabilities and notifications. Review feedback suggests enhancing the security of the path validation logic to prevent bypasses via glob patterns or command paths and recommends refactoring the server initialization to use an async handler instead of an IIFE.

Comment thread packages/angular/cli/src/commands/mcp/host.ts
Comment thread packages/angular/cli/src/commands/mcp/mcp-server.ts
@clydin clydin force-pushed the refactor/mcp-roots-integration branch 6 times, most recently from e11994e to 6ff5f8b Compare April 29, 2026 19:59
Update the `Host` abstraction to be aware of allowed roots provided by the MCP client. A new `createRootRestrictedHost` wrapper enforces that file operations and command executions stay within these roots. The server is updated to initialize roots on connection and listen for changes.
@clydin clydin force-pushed the refactor/mcp-roots-integration branch from 6ff5f8b to d4cdb0c Compare April 29, 2026 20:16
@clydin clydin added target: patch This PR is targeted for the next patch release action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 30, 2026
@clydin clydin requested a review from alan-agius4 April 30, 2026 13:36
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 30, 2026
@dgp1130 dgp1130 merged commit 443dc3a into angular:main Apr 30, 2026
37 checks passed
@dgp1130
Copy link
Copy Markdown
Collaborator

dgp1130 commented Apr 30, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the refactor/mcp-roots-integration branch April 30, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants