View a markdown version of this page

使用 AWS Transform MCP 伺服器執行遷移 - AWS 轉換

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用 AWS Transform MCP 伺服器執行遷移

AWS 轉換模型內容通訊協定 (MCP) 伺服器可讓您從任何 MCP 相容用戶端規劃和執行遷移,例如 Kiro、Claude Code、Cursor 或 Cline,而無需離開您的開發環境。MCP 是一種標準化界面,可讓用戶端中的 AI 助理即時存取 AWS 您的轉換工作區和任務。使用它,您可以建立工作區、啟動遷移任務、回應human-in-the-loop任務,以及透過自然語言下載成品。

MCP 伺服器會公開完整的遷移生命週期:探索您的來源環境、遷移規劃、連接目標 AWS 帳戶、網路遷移、登陸區域設定和伺服器重新託管。它以 MCP 用戶端啟動的本機程序執行,並透過傳出 HTTPS 與 AWS Transform 通訊。MCP 用戶端是執行伺服器的程序,例如 Kiro 或 Claude Code。AI 助理是您傳送提示的目標用戶端中的模型體驗。如需 AWS 轉換開發人員工具的一般簡介,包括 Kiro Power、代理程式外掛程式和 IDE 外掛程式,請參閱 開發人員工具。

安裝 MCP 伺服器

Kiro Power 和代理程式外掛程式會自動安裝 MCP 伺服器。只有在您想要在沒有 Kiro Power 或代理程式外掛程式的情況下使用 MCP 伺服器時,才能手動安裝 MCP 伺服器。

設定 AWS Transform MCP 伺服器

開始前,請確定您具有下列項目:

  • Python 3.10 或更新版本。

  • 具有租戶存取權的 AWS 轉換帳戶。如需設定 AWS 轉換的資訊,請參閱 AWS 轉換入門。

  • 與 MCP 相容的用戶端,例如 Kiro、Claude Code、Claude Desktop、Cursor 或 Cline。

安裝 MCP 伺服器

您可以從 PyPI 安裝 AWS Transform MCP 伺服器做為 awslabs.aws-transform-mcp-server。下列範例會使用 執行伺服器uvx。

Claude 程式碼

claude mcp add awslabs.aws-transform-mcp-server -- uvx awslabs.aws-transform-mcp-server@latest

Kiro、游標、VS Code、Cline 和 Claude Desktop (macOS/Linux)

將下列項目新增至用戶端的 MCP 組態檔案。對於 Kiro,請使用 ~/.kiro/settings/mcp.json。

{ "mcpServers": { "awslabs.aws-transform-mcp-server": { "command": "uvx", "args": ["awslabs.aws-transform-mcp-server@latest"], "env": { "AWS_REGION": "us-east-1", "FASTMCP_LOG_LEVEL": "ERROR" } } } }

Windows

{ "mcpServers": { "awslabs.aws-transform-mcp-server": { "command": "uvx", "args": [ "--from", "awslabs.aws-transform-mcp-server@latest", "awslabs.aws-transform-mcp-server.exe" ], "env": { "FASTMCP_LOG_LEVEL": "ERROR", "AWS_REGION": "us-east-1" }, "disabled": false } } }

如需特定 MCP 用戶端的組態詳細資訊,請參閱 GitHub 上的 aws-transform-mcp-server README。

設定環境變數

您可以在 MCP 用戶端組態的 env區塊中設定下列環境變數。

變數 說明
AWS_REGION AWS 區域 用於控制平面 API 呼叫的 。預設為設定檔區域,然後預設為美國東部 (維吉尼亞北部)。
AWS_PROFILE 用於控制平面工具的登入資料描述檔。如果未設定,則會透過標準登入資料鏈結回復。
FASTMCP_LOG_LEVEL 日誌層級 (DEBUG、WARNING、 INFO或 ERROR)。預設為 INFO。
AWS_TRANSFORM_MCP_WRITE_DIR 成品下載受到限制的基本目錄。下載路徑必須在此目錄中解析。如果您的用戶端在 shell 外部啟動伺服器,請設定此變數,讓成品下載具有有效的目的地。
驗證

大多數 MCP 工具使用 Web API 身分驗證 (瀏覽器登入)。此accept_connector工具也需要 AWS 登入資料,伺服器會自動偵測。 AWS Transform 支援下列身分驗證方法。

IAM Identity Center (SSO)

請 AI 助理「使用 SSO 設定 AWS 轉換」。助理會提示您的 IAM Identity Center 啟動 URL,並開啟您的瀏覽器以登入。然後,伺服器會在本機儲存您的登入資料,並在您重新啟動時自動載入。當工具傳回身分驗證錯誤時,請重新執行此組態。

IAM 角色

您的環境會自動提供 AWS 登入資料。在 MCP 用戶端組態AWS_PROFILE中設定 以選取特定設定檔。

如需設定 AWS 轉換身分驗證的詳細資訊,請參閱本主題稍早的先決條件。

驗證連線

安裝和設定伺服器之後,請重新啟動 MCP 用戶端。然後要求 AI 助理「檢查我的 AWS 轉換連線狀態」。成功的回應會確認已安裝、設定和驗證伺服器。

透過 MCP 使用 AWS 轉換進行遷移

連接 MCP 伺服器後,您可以使用自然語言與 AI 助理交談,以推動遷移。助理會代表您呼叫 AWS Transform MCP 工具,以管理工作區、啟動遷移任務、回應human-in-the-loop任務,以及擷取成品。典型的遷移遵循這些階段。

透過 MCP 伺服器執行遷移
  1. 建立或選取工作區。工作區是一或多個遷移任務的邏輯容器。工作區會決定 AWS 區域 您的任務、探索資料和 AWS 轉換建議所在的 。要求助理建立工作區或列出現有的工作區。

  2. 建立和啟動遷移任務。要求助理建立遷移任務。助理探索可用的客服人員並啟動任務。如需遷移任務類型和每個 包含的步驟的相關資訊,請參閱 任務類型。

  3. 執行探索。上傳您的內部部署伺服器庫存,讓 AWS Transform 可以剖析、取消複製和驗證它。如需支援的探索資料來源和格式,請參閱 探索來源資料。

  4. 建置遷移計畫。與助理合作,將庫存範圍和分析、將伺服器分組到應用程式、產生移動群組,以及建置遷移波紋。您可以隨時詢問有關環境的問題,並在計畫上反覆執行。如需詳細資訊,請參閱建置遷移計劃。

  5. 連接您的目標帳戶。建立連接器,並讓目標的管理員 AWS 帳戶 核准該連接器,讓 AWS Transform 可以部署基礎設施、遷移網路和重新託管伺服器。如需詳細資訊,請參閱連接目標 AWS 帳戶和區域。

  6. 遷移網路、建置登陸區域,以及重新託管伺服器。要求助理執行任務計畫中剩餘的執行步驟。

  7. 回應human-in-the-loop任務。 AWS 轉換會在審核和核准點暫停。助理顯示任務及其成品供您檢閱。在您決定之後,助理會提交您的回應 (核准、拒絕或傳送以供核准)。在核准之前,請務必檢閱任務詳細資訊和客服人員成品。

  8. 追蹤狀態和下載成品。隨時向助理詢問任務狀態,並讓其下載成品,例如報告、圖表和工作區摘要到本機環境。

由於您以對話方式與 AWS 轉換互動,因此您可以反覆在這些階段之間移動、詢問釐清問題,以及精簡您的計劃,而無需切換工具。

最佳實務

當您透過 AWS Transform MCP 伺服器執行遷移時,請遵循這些最佳實務。

  • 核准前請檢閱 。在核准human-in-the-loop任務之前,請務必檢查任務詳細資訊和代理程式成品。請勿讓助理針對建立或修改 AWS 資源的遷移步驟自動提交核准。

  • 使用最低權限憑證。設定AWS_PROFILE環境變數以指向範圍限定為僅遷移所需許可的設定檔。對於多帳戶遷移,相較於組織管理帳戶,偏好委派管理員帳戶。如需詳細資訊,請參閱使用委派管理員帳戶。

  • 限制成品下載。將AWS_TRANSFORM_MCP_WRITE_DIR環境變數設定為專用目錄,讓下載的成品落入已知的包含位置。當桌面或 IDE 用戶端在 shell 外部啟動伺服器時,這尤其重要。

  • 保持對工作階段進行身分驗證。SSO 權杖過期。當工具開始傳回身分驗證錯誤時,請重新執行 SSO 組態,並在開始長時間執行步驟之前,透過狀態檢查驗證您的連線。

  • 設定正確的區域。將 AWS_REGION設定為 AWS 區域 工作區和探索資料所在的 。如果您的遷移目標區域與探索區域不同,則會傳輸一些資料 AWS 區域。如需詳細資訊,請參閱支援的目標區域。

  • 上傳完整的目前探索資料。遷移計劃的品質取決於庫存的品質。上傳最詳細的可用資料,並在建置波浪之前驗證其反映您目前的環境。

  • 考慮大型遷移的專家模式。當您想要將back-and-forth最小化時,請預先提供您的輸入,並讓客服人員自動套用輸入。如需詳細資訊,請參閱使用專家模式。

範例提示

透過 MCP 伺服器執行 AWS 轉換不僅會將 Web 體驗移至 IDE。AI 助理會鏈結多個工具呼叫、讀取和寫入本機工作區中的檔案,並套用條件式邏輯。因此,您可以表達超出單一 Web 應用程式互動的多步驟、反覆和批次工作流程。下列範例顯示複雜的提示。根據您的環境進行調整。

驗證和監控迴圈

讓助理輪詢執行中步驟、對找到的內容做出反應,並只在需要決策時為您暫停。像這樣的自主迴圈是由助理驅動,而不是 Web 應用程式。

Start network migration for wave 1, then poll the job status every two minutes until it completes or needs my input. If a human-in-the-loop task appears, stop polling, summarize the task and its artifact for me, and wait for my decision before doing anything else.
Check every active job across all my workspaces. For each one, give me a one-line status, and flag any job that has been waiting on an approval for more than 24 hours or has reported an error. Repeat this check every 15 minutes and only message me when something changes.
Re-run the inventory readiness check after my latest upload. If there are any data-quality errors, list the affected servers grouped by issue and stop. If it validates cleanly, proceed to application grouping using the rules in ./planning/grouping-rules.md.
結合評估和規劃資料的報告

要求助理交叉參考來自不同階段的成品,並合成合併的報告。然後,助理可以將其儲存到本機工作區以供檢閱或版本控制。

Pull my migration strategy (7Rs) recommendations and my current wave plan. Cross-reference them and produce a consolidated readiness report that highlights every application whose recommended strategy conflicts with the strategy assigned to its wave. Include the confidence score and reasoning for each conflict, and save the report to ./reports/readiness.md.
Build an executive migration report that combines my risk assessment scores, the 7Rs recommendations, and the wave schedule. Rank waves by combined risk, call out the top five applications that need attention before cutover, and export it as both a PDF for stakeholders and a PPTX deck for my review.
Compare the assessment I ran last month with my current plan. Tell me which servers were newly discovered, which changed operating system or strategy, and which moved between waves. Write the diff to ./reports/plan-change-log.md.
每個應用程式圖表和批次產生

反覆查看您計劃中的應用程式或波浪,並產生每個應用程式或波浪的成品,將其儲存在本機的一次傳遞中。

For each application in my plan, generate an application dependency diagram and save it to ./diagrams/APP_NAME.html. When you finish, give me a table of every application with the number of dependencies found, and list any applications you could not generate a diagram for and why.
For each wave, generate a network topology diagram scoped to that wave's servers plus their cross-wave dependencies, and save each one to ./diagrams/waves/wave-N.html. Highlight any dependency that crosses a wave boundary, since those need sequencing attention.
本機環境整合

將 AWS Transform 與本機開發環境中的檔案和工具結合,這是 Web 應用程式無法執行的動作。

Read the decommissioning list in ./exclusions.csv, remove every matching server from migration scope, then rebuild my waves and show me what changed in the plan as a result.
Read the tagging standard in ./standards/tagging.md and apply it as the resource tagging configuration for network migration and server rehost. Show me the resulting tag set and flag any required tag the standard does not specify a value for.
Download the workspace summary and the 7Rs report, commit them to the migration-artifacts git repo in this workspace under ./artifacts/$(date +%F)/, and write a short changelog entry describing what changed since the last snapshot.
條件式和門控自動化

快速核准閘道和分支,讓助理只有在滿足條件時才會推進遷移。

Walk my end-to-end job through discovery and planning in expert mode using the inputs in ./planning/inputs.txt. Pause for my review after wave planning completes. Do not connect any target account or start execution until I explicitly approve.
For wave 1 only, connect the target account, migrate the network, and rehost the servers. After each step, verify it succeeded before starting the next. If any step fails or produces a warning, stop immediately, show me the details, and do not touch waves 2 or 3.