Skip to content

Commit 6b1bf8e

Browse files
committed
docs: add MCP server setup instructions
Adds a new section to the "Develop with AI" documentation page that details how to configure the Angular CLI's Model Context Protocol (MCP) server. This section includes: - Instructions on how to use the command. - IDE-specific JSON configurations for VS Code, JetBrains, Firebase Studio, and Cursor. - Clarification on the different JSON structures required by each IDE.
1 parent 6953166 commit 6b1bf8e

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

adev/src/content/ai/develop-with-ai.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,62 @@ Several editors, such as <a href="https://studio.firebase.google.com?utm_source=
2626
| VS Code | <a download=".instructions.md" href="/assets/context/guidelines.md" target="_blank">.instructions.md</a> | <a href="https://code.visualstudio.com/docs/copilot/copilot-customization#_custom-instructions" target="_blank">Configure `.instructions.md`</a> |
2727
| Windsurf | <a download href="/assets/context/guidelines.md" target="_blank">guidelines.md</a> | <a href="https://docs.windsurf.com/windsurf/cascade/memories#rules" target="_blank">Configure `guidelines.md`</a> |
2828

29+
## Angular CLI MCP Server setup
30+
The Angular CLI includes a Model Context Protocol (MCP) server. This allows AI assistants in your IDE to interact with the Angular CLI, enabling them to generate code, add packages, and more.
31+
32+
The recommended first step is to run the following command in your terminal:
33+
34+
```bash
35+
ng mcp
36+
```
37+
38+
This command can provide a JSON configuration snippet for your IDE. However, the exact structure of this JSON file can vary between different IDEs. Below are the configuration details for several editors.
39+
40+
### VS Code
41+
In your project's root, create a file named `.vscode/mcp.json` and add the following configuration. Note the use of the `servers` property.
42+
43+
```json
44+
{
45+
"servers": {
46+
"angular-cli": {
47+
"command": "npx",
48+
"args": ["@angular/cli", "mcp"]
49+
}
50+
}
51+
}
52+
```
53+
54+
### JetBrains IDEs
55+
In JetBrains IDEs (like IntelliJ IDEA or WebStorm), after installing the MCP Server plugin, go to `Settings | Tools | AI Assistant | Model Context Protocol (MCP)`. Add a new server and select `As JSON`. Paste the following configuration, which does not use a top-level property for the server list.
56+
57+
```json
58+
{
59+
"name": "Angular CLI",
60+
"command": "npx",
61+
"args": [
62+
"@angular/cli",
63+
"mcp"
64+
]
65+
}
66+
```
67+
68+
### Firebase Studio, Cursor, and Other IDEs
69+
For these IDEs, create a configuration file and add the following snippet. Note the use of the `mcpServers` property.
70+
* **Firebase Studio:** Create a file named `.idx/mcp.json` in your project's root.
71+
* **Cursor:** Create a file named `.cursor/mcp.json` in your project's root. You can also configure it globally in `~/.cursor/mcp.json`.
72+
* **Other IDEs:** Check your IDE's documentation for the proper location of the MCP configuration file (often `mcp.json`).
73+
74+
```json
75+
{
76+
"mcpServers": {
77+
"angular-cli": {
78+
"command": "npx",
79+
"args": ["@angular/cli", "mcp"]
80+
}
81+
}
82+
}
83+
```
84+
2985
## Providing Context with `llms.txt`
3086
`llms.txt` is a proposed standard for websites designed to help LLMs better understand and process their content. The Angular team has developed two versions of this file to help LLMs and tools that use LLMs for code generation to create better modern Angular code.
3187

0 commit comments

Comments
 (0)