Angular Signal Forms Migration Mcp

io.github.Alvi97由 GitHub 帳號 Alvi97 發布v0.9.1更新於 Oct 24, 2026

Finds Angular Reactive Forms and returns verified Signal Forms recipes. Never edits code.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,在程式碼庫中找出 Angular Reactive Forms,並回傳經核實的 Signal Forms 前後對照改寫方案,不會修改任何檔案。

可以做什麼
  • 在指定路徑中找出 Reactive Forms 結構,並區分機械式改名與需要人工判斷的部分
  • 查詢某個結構經核實的前後對照改寫方案,附帶注意事項與來源資訊
  • 評估遷移工作量並建議從哪個檔案開始,或把整份報告輸出成一份 markdown 文件
  • 檢查已遷移的檔案中那些能編譯但實際仍有問題的陷阱
  • 當專案低於 v21 時提供 Angular 升級方案
適用情境
適合在把 Angular 應用程式從 Reactive Forms 遷移到 Signal Forms 時使用,讓編碼助理依據對照真實 Angular 版本核實過的方案工作,而不是憑模型記憶。也適合評估遷移規模或複核已完成的遷移。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 20 或更新版本。不需要帳號、API 金鑰或環境變數。要取得遷移建議,專案應為 Angular 21+ 且 moduleResolution 支援 exports(bundler、node16 或 nodenext);低於 v21 時只會回傳升級方案。選用環境變數 SIGNAL_FORMS_MCP_NO_UPDATE_CHECK 可關閉每日版本檢查。
安裝前請注意
它只做偵測與建議,從不寫入原始碼檔案,變更由助理執行、由你審閱 diff。verify_migration 只能證明不存在已知缺陷,並不證明遷移正確,應在 tsc 之後執行。它不處理樣板驅動的 ngModel 表單、含替換運算式的樣板字串、CSS/SCSS,也不做跨檔案型別解析。標示 UNVERIFIED 或 VERSION-SENSITIVE 的方案應到 Angular 文件確認。除非關閉,伺服器每天會發出一次限流的連線版本檢查。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Angular Signal Forms Migration Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

angular-signal-forms-migration-mcp

[npm] [node] [license]

An MCP server that helps an AI coding agent migrate Angular Reactive Forms to Angular Signal Forms.

It finds the Reactive Forms constructs in your codebase, separates the safe mechanical renames from the ones that need a human decision, and hands back before→after recipes that are verified against a real Angular release rather than written from memory.

Install

Requires Node.js 20+. Nothing to clone — npx fetches it on demand.

bash
claude mcp add signal-forms-migration -- npx -y angular-signal-forms-migration-mcp@latest

Or add it to any MCP client config:

json
{  "mcpServers": {    "signal-forms-migration": {      "command": "npx",      "args": ["-y", "angular-signal-forms-migration-mcp@latest"]    }  }}

@latest makes npx re-resolve on every launch, so restarting your editor picks up new releases. Without it, npx keeps serving whichever version it cached first — repoint the config at @latest, or clear the cache with npm cache clean --force.

The server also checks for a newer version once a day and writes a one-line notice to stderr. It is throttled, times out after 2 seconds, never touches stdout, and stays silent on any failure. To turn it off, add "env": { "SIGNAL_FORMS_MCP_NO_UPDATE_CHECK": "1" } to the config block above. To see what is actually running:

bash
npx angular-signal-forms-migration-mcp@latest --version

[!IMPORTANT] Do not npm install this into your Angular app. It is a standalone process your editor spawns, not a library your project depends on. npx keeps it in a cache outside your project entirely.

[!NOTE] It detects and advises. It never edits your code. There is no tool here that writes to your source files, and there never will be. The server returns findings and recipes; your agent decides what to change and makes the edits, so every change still goes through your normal review and version control.

What it looks like

> Migrate the forms in src/app/checkout to Signal Forms.
  1. find_form_candidates { path: ".../src/app/checkout" }     → 9 findings across 2 files: 6 mechanical, 3 judgment       (the FormArray of line items is judgment — its shape changes)  2. get_signalforms_recipe { construct: "FormBuilder.group" }     → before/after + caveats  3. the agent applies the edits, you review the diff  4. verify_migration { path: ".../checkout.component.ts" }     → traps that compile and are still wrong

Prerequisites it checks before advising anything

A migration report leads with the things that make migration impossible, because a plan you cannot execute is worse than no plan:

  1. Angular 21+. @angular/forms/signals does not exist before v21. Below that the server returns an upgrade plan instead of a migration plan.
  2. Declared and installed versions agree. An old branch checked out over newer node_modules straddles the v21 line. Migrating against what is installed means the next npm ci reverts you to a version where the target API is absent — so the server refuses to pick a side and says so.
  3. moduleResolution is exports-aware (bundler, node16, or nodenext). @angular/forms/signals is a package-exports subpath; legacy node resolution cannot see it, and the import fails with an error that looks like a missing dependency.

Tools

ToolWhat it answers
find_form_candidatesWhere are the Reactive Forms constructs, and which need a person?
get_signalforms_recipeWhat is the verified before→after for this construct?
analyze_migration_complexityHow big is this job, and which file should I start with?
get_migration_reportGive me the whole thing as one markdown document.
verify_migrationI already migrated this — what compiles but is still wrong?
get_angular_upgrade_planI am below v21. How do I get to a version that supports this?

Full parameters, response shapes and scope limits: docs/TOOLS.md.

How the recipes are verified

Signal Forms is new and is not reliably present in any model's training data — recipes written from memory are wrong in ways that look right. So none of these are.

Recipes are verified against Angular v22 using the official Angular CLI MCP server, cross-checked against angular.dev, and carry structured provenance (verifiedAgainstVersion, retrievedISO, sources) that ships in the tool response so your agent can judge how current the advice is. A recipe with an empty sources list fails CI.

Where the docs do not answer the question, the recipe says so in its caveats rather than inventing an answer — UNVERIFIED — confirm on <url>, or UNVERIFIED — tool-authored guidance where Angular documents no migration path at all (the RxJS stream tiers are the main case: the primitives are documented and compile, but choosing between them is this tool's judgement, not Angular's). 14 of 37 recipes currently carry such a marker. That is the honest part of the output, not an oversight — and a test keeps this number true.

The recipes also compile. CI installs a real @angular/forms@22 and typechecks fixtures exercising every API the recipes use, so a recipe naming a function that does not exist — or calling it with the wrong argument shape — fails the build. That is what established disabled(path, { when }) as the v22 signature; the docs demonstrate neither it nor the nested schema() + apply() composition.

Two things this caught that memory gets wrong:

  • The binding directive is [formField] / FormField — not [control] / Control, which appeared in pre-release v21 material and is what models reproduce.
  • disabled() / hidden() gained an options-object form on v22 and marked the bare callback @deprecated rather than removing it — so a v21-shaped rule still compiles, with a warning. Established by diffing the shipped overloads, not the guides.

Recipes whose behaviour genuinely differs across releases carry a VERSION-SENSITIVE caveat naming the form each version takes, and the server resolves them against your project's detected version. Read the caveats array — that is where the sharp edges live.

The re-verification procedure for a new Angular release is REVERIFICATION.md.

It tells you when there is no clean answer

Not every Reactive Forms pattern has a Signal Forms equivalent, and a migration tool that pretends otherwise is worse than none. Form streams are graded by the RxJS operators in their .pipe() chain:

TierOperatorsAnswer
trivialnone / bare subscribecomputed(), or effect() for a real side effect
moderatemap, filter, debounceTime, distinctUntilChanged, …computed() + the debounce() schema rule
hardswitchMap, combineLatest, withLatestFrom, forkJoin, …no direct equivalent

For the hard tier the recipe says so outright and offers three real strategies — async validation rules, rxResource, or keeping RxJS behind toObservable/toSignal — rather than inventing a one-liner that does not exist.

Likewise addControl() / removeControl() have no counterpart at all: the field tree is derived from the model signal's type. The recipe explains the three actual answers instead of implying an API that would not compile.

What it will not do

  • Edit your files. By design, permanently.
  • Prove your migration is correct. verify_migration proves the absence of known defects. Run it after tsc, not instead of it.
  • Migrate template-driven forms. ngModel migration is undocumented upstream; guessing it would be the exact failure mode this project exists to avoid.
  • Read template literals with ${...} substitutions, because their text is not what the Angular compiler sees. Inline template: strings without substitutions are scanned.
  • Scan CSS/SCSS, or resolve types across files — detection is a single-file syntactic pass, not a ts.Program.

ROADMAP.md tracks these; the migration report repeats them in its own "Scope" section rather than letting the totals imply completeness.

Why not just the official Angular MCP server?

Use both. The official @angular/cli MCP server knows about Angular; this one knows about migration — which constructs exist in your code, which are mechanical, which need a decision, and what the verified replacement is. Your agent can pull findings and recipes from here, then confirm anything current or project-specific there before it edits.

Status

Feature-complete through M16. Six tools ship, with doc-verified recipes covering basic constructs, arrays, runtime shape mutation, async validators, custom controls, the three RxJS stream tiers, reading and writing form state, submission, model-shape constraints, CSS status classes, spec-file migration, and the .html template layer — bindings, state reads, the <select multiple> blocker, and the silent error-key rename.

The transport is stdio, so stdout is reserved for the protocol and all logging goes to stderr.

Contributions and local development: CONTRIBUTING.md.

License

MIT

來源:README.md,提交 5d71d9f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.9.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分