Angular CLI's new MCP: AI just got way better at Angular
What if your AI assistant can actually understand your Angular app? I'm talking about its structure, style rules, and even its documentation, all to help you code faster.
Hello readers!
What if your AI assistant can actually understand your Angular project? I'm talking about its structure, style rules, and even its documentation.
All to help you code faster!
That’s exactly what Angular CLI's new MCP (Model Context Protocol) server does, and it’s available right now in Angular 20.1.
The release of Angular 20.1 introduces the Angular CLI Model Context Protocol (MCP) server, a significant feature designed to create a deeply integrated and context-aware development experience between AI assistants and Angular workspaces.
This protocol allows AI tools to securely interact with an Angular project’s structure, standards, and documentation, moving beyond simple code suggestion to become active participant in the development workflow.
What is MCP?
But first, what’s MCP?
The Model Context Protocol (MCP) is an open standard that establishes a universal communication layer for AI assistants to interface with development tools.
It can be compared to the standardization that USB-C brought to hardware connectivity.
Before MCP, connecting AI to development environments required custom, tool-specific integrations.
Now, MCP provides a standard interface using JSON-RPC, which enables any compliant AI assistant to communicate effectively with tools like the Angular CLI.
Beginning with version 20.1, the Angular CLI can function as an MCP server, facilitating a new level of advanced, AI-assisted development.
Key Advantages of MCP Integration
Integrating MCP into your Angular workflow provides several distinct benefits:
Increased Development Speed: AI assistants with full project context can accurately scaffold new features, perform complex code refactoring, and generate components that align with the existing application architecture.
Adherence to Best Practices: The protocol is designed to use Angular’s established best practices by default. This ensures that AI-generated code maintains high quality and consistency with project standards.
Extensible and Future-Proof: MCP is an evolving standard. Future releases are expected to add support for more tools and endpoints, further expanding its capabilities.
Implementation Guide: How to Enable the MCP Server
The configuration process is straightforward and involves a few simple steps:
Update Angular CLI: Ensure your project is using Angular CLI version 20.1 or later.
Run the MCP Command: In your project’s root directory, open the terminal and run the following command to start the server:
$ ng mcp
Finally, you need to configure Your IDE:
Follow the instructions depending on your IDE.
VS Code:
In your project's root, create a file named .vscode/mcp.json
and add the following configuration. Make sure to use of the servers
property.
{
"servers": {
"angular-cli": {
"command": "npx",
"args": ["-y", "@angular/cli", "mcp"]
}
}
}
Cursor:
Create a file named .cursor/mcp.json
in your project's root and add the following configuration. You can also configure it globally in ~/.cursor/mcp.json
.
{
"mcpServers": {
"angular-cli": {
"command": "npx",
"args": ["-y", "@angular/cli", "mcp"]
}
}
}
Firebase Studio:
Create a file named .idx/mcp.json
in your project's root and add the following configuration:
{
"mcpServers": {
"angular-cli": {
"command": "npx",
"args": ["-y", "@angular/cli", "mcp"]
}
}
}
Gemini CLI:
Create a file named .gemini/settings.json
in your project's root and add the following configuration:
{
"mcpServers": {
"angular-cli": {
"command": "npx",
"args": ["-y", "@angular/cli", "mcp"]
}
}
}
Other IDEs:
For other IDEs, consult your IDE's documentation for the location of the MCP configuration file (usually named mcp.json
) and add:
{
"mcpServers": {
"angular-cli": {
"command": "npx",
"args": ["-y", "@angular/cli", "mcp"]
}
}
}
After configuration, your IDE should indicate a successful connection, often with a status indicator.
Core Functionality and Use Cases
The current implementation of the MCP server exposes several key endpoints:
get_best_practices
: Retrieves the defined coding standards for both Angular and the specific team.list_projects
: Provides the AI with a complete overview of the workspace structure, including applications, libraries, and build targets.search_documentation
: Allows the AI to perform direct queries against Angular’s official documentation.
Example Usage:
A developer can leverage these capabilities with a natural language prompt. For instance, you can instruct your assistant as follows:
Using the Angular CLI MCP, add a new
Auth
service inside the@users
directory
In response, your coding assistant will first analyze the project structure and consult best practices, then execute the correct ng generate
command automatically.
Best Practices and Important Considerations
To maximize the effectiveness of the MCP server, consider the following recommendations:
Provide Precise Context: Use the
@
symbol to tag specific files or folders (e.g.,@users
) in your prompts. This helps the AI assistant pinpoint the exact context for its task.Automate with IDE Rules: For a more seamless workflow, configure your IDE to always use the Angular CLI MCP for Angular-related tasks, eliminating the need to specify it in every prompt.
Avoid Rule Conflicts: Be aware that custom instruction rules in your IDE may conflict with the best practices enforced by the MCP server. It is generally recommended to allow MCP to manage code generation and styling by default, using custom overrides only when necessary.
Conclusion
The MCP server in Angular CLI marks a pivotal evolution in AI-assisted development. It transforms AI from a passive code-completion tool into an intelligent partner capable of understanding and contributing to complex software projects.
Free PDF Roadmaps:
You can get these free PDFs that contain detailed roadmaps with recommended learning periods for each language or field, along with links to free resources such as books, YouTube tutorials, and courses with certificates: