Compiler-backed Angular template answers, component contracts and version facts for AI agents
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
An MCP server that lets an AI agent understand Angular templates by asking the same compiler that builds the project, instead of guessing from file text. The token saving is measured, not promised.
Angular ships a first-class language server, but no official AI integration exposes it β the
Angular CLI MCP (ng mcp) works at the docs-and-build level and does not touch templates.
This server is that missing layer, and it answers for the Angular version the project
actually runs.
Everything below marked as measured was produced by running code against six real Angular workspaces (17.3.12, 18.2.14, 19.2.25, 20.3.26, 21.2.18, 22.0.8) and two production projects. Every number can be reproduced with the commands in Reproducing the measurements.
The language server ships as a regular dependency β nothing to install besides the package:
Claude Code:
Codex CLI:
Any other MCP client:
Or skip the install and let the client fetch it through npx:
In Cursor that npx form is one click:
The npm and npx paths are verified by running: the packed tarball (79 kB, dist only) was installed into a clean prefix and all four tool kinds answered through a real MCP client, and the npx form connects in 1.2β2.0 s from a warm npm cache (the very first run on a machine also downloads the dependency tree β the language server alone unpacks to 13.6 MB).
A first question to ask it β the contract of a component whose members are scattered across
an extends chain. Asked for fixtures/v17/src/app/derived-card.component.ts (a fixture in
this repository), ng_component_info answers, verbatim:
624 characters, 305 ms on the session's first call (it loads the project's own TypeScript),
single-digit milliseconds after. The asked file declares one input and an extends clause;
heading, disabled, the output and both methods live in BasePanel and BaseWidget and
are resolved statically, and "noop": true on focus() is the subclass shadowing it with
an empty body β the kind of fact that otherwise costs a whole file read per ancestor.
Configs for Cursor, VS Code, Windsurf, Codex CLI and JetBrains, the Node floor, and running from source are in Requirements and setup.
1. No template awareness. grep over an .html file cannot tell you where
{{ user().fullName }} is declared, and no amount of reading gives you NG2339 Property 'emailAddress' does not exist on type 'UserVm'. That is compiler output, not text.
2. Version drift. The AI context files on angular.dev (llms.txt) describe only the
newest major and carry no version markers; the versioned archive sites serve none at all.
On v17βv21 they hand the agent instructions that produce APIs which do not exist. Measured
examples are in Version facts.
Six tools, 1001 characters of descriptions in total. Answers are dense JSON with no markdown.
| Tool | What it answers | Needs the language server |
|---|---|---|
ng_template_definition | where a symbol under this template position is declared | yes |
ng_template_diagnostics | Angular compiler errors for a template, or for a files batch; an entry anchored in the companion .ts carries file | yes |
ng_component_info | the public contract of a component or directive | no |
ng_workspace_map | projects, versions, strictTemplates and zone.js per project | no |
ng_version_rules | what exists and what does not in this project's Angular version | no |
ng_find_usages | where a component, directive, pipe or service is used; with input β where that input is bound | no |
Four of the six never start the language server, so they answer in milliseconds and keep working on workspaces where the server refuses to load.
ng_component_info returns the public contract of a component rather than its source.
Measured across two production codebases through a real MCP client:
| Nx monorepo | CLI workspace* | |
|---|---|---|
| Angular / TypeScript | 19.2.18 / 5.8.3 | 17.3.8 / 5.3.3 |
| Components in the tally | 1298 | 407 |
| Parse errors | 0 | 0 |
| Sources | 5 404 708 chars | 1 735 223 chars |
| Contracts (base-class members included) | 1 759 331 chars | 463 563 chars |
| Saved | 67% | 73% |
| Saved in tokens (o200k_base proxy) | 67% | 71% |
| Contract shorter than source | 1201 of 1298 (93%) | 386 of 407 (95%) |
| Flagged as partial | 1 of 1298 | 3 of 407 |
| First call (loads the project's TypeScript) | 306 ms | 564 ms |
* measured with the pre-0.1.2 wire format; the current format is leaner, so this saving is a floor.
The largest component in the monorepo shrinks from 177 863 to 10 770 characters while listing 117 contract members. Contracts include members inherited from base classes β the extends chain is resolved through relative imports, tsconfig path aliases and barrels. Before that resolver, 91 of 1298 monorepo contracts were flagged as partial; now 1 is.
Three caveats that travel with these numbers:
o200k_base, since Claude's tokenizer
is not public; cl100k_base agrees within one point on this data. Characters are exact.On small components there is no saving at all: a 17-line component produces a 578-character contract against a 315-character source. The contract grows with the number of members, the source with method bodies β and on production code the second wins almost always.
Renaming an input across usages. The grep path an agent actually takes β read the
component file to learn the selector, then grep the selector and the binding spellings
repo-wide β against ng_component_info plus ng_find_usages with its input filter,
which returns only the tags that bind the name, each entry pointing at the binding itself.
On the production monorepo, 6243 files scanned:
| Component | grep path | bridge | saved (o200k) |
|---|---|---|---|
577 usages, mask bound on 5 tags | 50 527 tokens | 1 035 tokens | 98% |
466 usages, icon bound on 463 tags | 41 698 tokens | 22 566 tokens | 46% |
1211 usages, name bound on 1134 tags | 129 227 tokens | 30 650 tokens | 76%* |
* the tool returns at most 500 entries per answer, and the answer says so.
The saving is decided by how many of the usages actually bind the input: mask is bound on
5 of 568 tags, and grep still prints every selector line plus 67 binding-shaped lines from
across the repo β 62 of them somebody else's mask β while the bridge answers with exactly
those five sites.
Diagnosing a template that will not compile. A whole-project compiler listing costs
395 tokens and 1321 ms; one ng_template_diagnostics call answers with the asked
file's diagnostics in 81 tokens, 1 ms warm. The gap only widens with project size: the
listing grows with the project, the answer does not. After an edit, fresh diagnostics
arrive as a 340β400 ms push β against a rebuild.
ng_version_rules contains no rule taken from documentation: the data comes from importing
the packages actually installed in each fixture and from running the compiler.
The zoneless provider is renamed between v19 and v20.
| API | v17 | v18 | v19 | v20 | v21 | v22 |
|---|---|---|---|---|---|---|
provideExperimentalZonelessChangeDetection | β | yes | yes | β | β | β |
provideZonelessChangeDetection | β | β | β | yes | yes | yes |
Advice to "enable zoneless" without a version breaks on three majors out of six.
Existing is not the same as ready. The @experimental and @developerPreview tags live
only in declaration JSDoc and are invisible at runtime:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/angular-token-saver)<a href="https://allmcps.com/mcp/angular-token-saver"><img src="https://allmcps.com/api/badge/angular-token-saver?style=directory" alt="Angular token saver on AllMCPs" /></a>