【AWS MCP Servers】 Frontend MCP ServerをClaude Codeで使ってみた

【AWS MCP Servers】 Frontend MCP ServerをClaude Codeで使ってみた

2025.07.28

こんにちは、歯を大切にしているコンサルティング部の神野です。

皆さんはMCP(Model Context Protocol)サーバーを使っていますか? 私は最近AWS MCP Servers一覧を眺めていたところ、Frontend MCP Serverという面白そうなMCPサーバーを見つけました!

https://awslabs.github.io/mcp/servers/frontend-mcp-server/

特に気になったのが「React + Tailwind CSS + shadcn/uiの環境構築をサポートする」という点です。環境構築も爆速でできて、良い感じのUIを提供するアプリケーションが作成できたら嬉しいですよね。気になったので、実際に試してみることにしました!

今回は、Frontend MCP Serverを使って歯磨き習慣管理アプリを作ってみたいと思います。歯を失ったら二度と取り戻せないですからね・・・しっかりと歯磨きの習慣を身につけて予防をするようなアプリを作りましょう!

Frontend MCP Serverとは

Frontend MCP Serverは、AWS Labsが提供するMCPサーバーの一つで、React開発のためのガイドラインとスターターキットを提供してくれます。

主な機能

  • React + Tailwind CSS + shadcn/uiのスターターキット提供
  • 開発ガイドラインの参照
  • トラブルシューティング情報の提供
  • AWS Amplifyとの統合

とありますが、はじめに結論を書いてしまうと現時点では提供されている具体的な機能は2つです。

  • essential-knowledge: Foundational concepts for building React applications with AWS services
  • troubleshooting: Common issues and solutions for React development with AWS integrations

下記のように呼び出されて固定の文言ガイドが返される形となります。

MCPサーバーを呼び出すイメージ

result = await get_react_docs_by_topic('essential-knowledge')

説明を見たときはワクワクしたのですが、動的に返せないのはちょっと寂しいですね・・・ 今後さらに機能が拡張されて、できることが増えるのを楽しみにしています!!

今回は現時点でできることを確認していきましょう。

環境構築

それでは、実際に環境を構築していきましょう!

前提

今回は下記バージョンを前提としています。
Claude Codeを活用して開発を進めていきます。

  • Node.js v20.16.0
  • npm v10.8.1
  • Claude Code v1.0.31

1. MCPサーバーの設定

MCP Serverの設定である、.mcp.jsonファイルを作成します。

.mcp.json
{
  "mcpServers": {
    "awslabs.frontend-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.frontend-mcp-server@latest"],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

この状態でclaudeコマンドを実行すると、MCPサーバーを使用するかと質問されるので、使用する1を回答します。

MCPサーバーの信頼確認ダイアログ

2. Claude Codeでプロジェクト作成

Claude Codeに以下のプロンプトでPlanモードで計画を立ててもらいます。

プロンプト
Frontend MCP Serverを使って、React + Tailwind CSS + shadcn/uiの環境構築方法を実施して、歯磨き管理アプリケーションを作成してください。

すると、MCPサーバーが固定のガイドラインを返し、それを基にClaudeが計画を立ててくれました!!

以下のような詳細な計画が提示されました。

アプリケーション作成計画
**歯磨き管理アプリケーション作成計画**

## アプリケーション分析

### 基本情報
- アプリ名: BrushTrack
- 説明: 歯磨き習慣を楽しく管理・改善するためのWebアプリケーション
- フォルダ名: brush-track
- 対象ユーザー: 歯磨き習慣を改善したい個人、子供の歯磨きを管理したい親
- 主要目的: 毎日の歯磨きを記録し、習慣化を促進

### コア機能(優先順)

1. **歯磨き記録**
   - 朝・夜の歯磨き完了をワンタップで記録
   - 歯磨き時間の記録(タイマー機能)
   - 成功基準:ユーザーが簡単に毎日の記録を残せる

2. **進捗トラッキング**
   - 連続記録日数(ストリーク)表示
   - カレンダービューで履歴確認
   - 月間・週間の達成率表示
   - 成功基準:視覚的に進捗が確認できる

3. **リマインダー機能**
   - 朝・夜の歯磨き時間にプッシュ通知
   - カスタマイズ可能な通知時間
   - 成功基準:設定した時間に通知が届く

4. **歯磨きアドバイス**
   - 正しい歯磨き方法のガイド
   - 2分間タイマーと音声ガイド
   - 成功基準:ユーザーが適切な歯磨き方法を学べる

### ページ構成

1. **ダッシュボード**
   - 今日の歯磨き状況(朝・夜)
   - 現在のストリーク
   - 週間達成率グラフ
   - クイック記録ボタン

2. **記録ページ**
   - 歯磨きタイマー(2分カウントダウン)
   - 完了記録ボタン
   - メモ追加機能

3. **履歴ページ**
   - カレンダービュー(記録済み日をマーク)
   - 月間統計情報
   - 詳細履歴リスト

4. **進捗ページ**
   - ストリーク表示
   - 達成バッジ
   - 統計グラフ(週別・月別)

5. **設定ページ**
   - リマインダー時間設定
   - 通知設定
   - プロフィール管理

### UIコンポーネント
- shadcn: Card, Button, Calendar, Progress, Badge, Dialog, Form, Input, Switch, Tabs, Avatar
- カスタム: BrushingTimer, StreakDisplay, ProgressChart, ReminderSettings

### 実装計画

**フェーズ1: 環境構築**
1. Frontendスターターキットをclone(brush-trackフォルダ)
2. 依存関係インストール
3. README.md更新

**フェーズ2: ブランディング**
1. package.json更新
2. アプリ名・説明文の更新
3. favicon.png(歯ブラシアイコン)生成
4. splash.png(歯磨きコンセプトイラスト)生成

**フェーズ3: UI開発**
1. ダッシュボードページ作成
2. 記録ページ(タイマー機能付き)
3. 履歴ページ(カレンダービュー)
4. 進捗ページ(グラフ・統計)
5. 設定ページ更新
6. ナビゲーション更新

**フェーズ4: 状態管理**
1. Zustandストアにサンプルデータ追加
2. 歯磨き記録の状態管理
3. ユーザー設定の状態管理

**フェーズ5: バックエンド設定**
1. モックamplify_outputs.json作成
2. 将来的なAPI構造の定義

この計画に従って、React + Tailwind CSS + shadcn/uiを使用した歯磨き管理アプリケーションを作成します。

BrushTrackアプリケーションと言った名前で良いですね。 Frontendスターターキットをcloneといったフェーズもガイドには存在し、下記のようにスターターキットのクローン方法も含まれていてセットアップ手順はこれを解釈してくれたのですね。

# Clone repository into [app-name] folder
git clone -b starterkits https://github.com/awslabs/mcp.git [app-name]
# navigate to the frontend folder
cd [app-name]/frontend
# install packages
npm install

Planモードだったので承認して、実際に計画通り作成してもらいます。
ただフェーズ5にモックamplify_outputs.json作成とあり、おや・・・と気になりました。
もしかしてAmplify Gen2を前提としたスターターキットなのかなと思いました。

とりあえず作成してもらいましょう!
承認後は実装までに必要なTodoリストを下記のように洗い出して、作業してくれました。

Todoリスト
- Clone frontend starter kit to brush-track folder   
- Install dependencies and analyze codebase structure
- Create CHECKLIST.md with application analysis
- Update README.md with app overview and tech stack
- Create Dashboard page with brushing status
- Create Record page with timer functionality
- Create History page with calendar view
- Create Progress page with charts and stats
- Set up Zustand store with sample data
- Update navigation and routing
- Final verification and testing
- Update package.json with BrushTrack name
- Update app name and description in login page
- Generate favicon.png (tooth brush icon)
- Generate splash.png (tooth brushing concept)
- Create mock amplify_outputs.json
- Update Settings page for app preferences

かなりやることがありますね・・・実装が完了するまで少し気長に待ちましょう。
また面白いなと思ったのがCHECKLIST.mdですね。
チェックリストを作成して、それに従ってタスクをこなすようにガイドされたのですね。自律性があって良いですね。

CHECKLIST.md
CHECKLIST.md
# BrushTrack Application Analysis

## Application Overview
- **Name**: BrushTrack
- **Description**: 歯磨き習慣を楽しく管理・改善するためのWebアプリケーション
- **Target Users**: 歯磨き習慣を改善したい個人、子供の歯磨きを管理したい親
- **Primary Purpose**: 毎日の歯磨きを記録し、習慣化を促進

## Core Features (Prioritized)
1. **歯磨き記録機能**
   - 朝・夜の歯磨き完了をワンタップで記録
   - 歯磨き時間の記録(2分タイマー機能)
   - 記録時にメモを追加可能
   - Success criteria: ユーザーが簡単に毎日の記録を残せる
   - Backend integration: 記録データの永続化に必要

2. **進捗トラッキング**
   - 連続記録日数(ストリーク)表示
   - カレンダービューで履歴確認
   - 月間・週間の達成率表示
   - Success criteria: 視覚的に進捗が確認できる
   - Backend integration: 履歴データの保存・取得に必要

3. **リマインダー機能**
   - 朝・夜の歯磨き時間にプッシュ通知
   - カスタマイズ可能な通知時間設定
   - Success criteria: 設定した時間に通知が届く
   - Backend integration: 通知設定の保存に必要

4. **歯磨きアドバイス・ガイダンス**
   - 正しい歯磨き方法のガイド表示
   - 2分間タイマーと音声ガイド
   - 歯磨きのコツやアドバイス表示
   - Success criteria: ユーザーが適切な歯磨き方法を学べる
   - Backend integration: コンテンツ管理に必要

## Page List
1. **Dashboard (ダッシュボード)**
   - Purpose: 今日の歯磨き状況確認と全体的な進捗の可視化
   - Components: 
     - 今日の歯磨きステータスカード(朝・夜)
     - 現在のストリーク表示
     - 週間達成率チャート
     - クイック記録ボタン
     - 最近の記録リスト
   - Data: 本日の記録、ストリーク数、週間達成率、最近の記録履歴

2. **Record (記録)**
   - Purpose: 歯磨きの実行と記録
   - Components:
     - 2分カウントダウンタイマー
     - 進捗バー
     - 一時停止/再開ボタン
     - 完了記録ボタン
     - メモ入力フィールド
     - 歯磨きガイド表示
   - Data: タイマー状態、記録データ、ガイダンステキスト

3. **History (履歴)**
   - Purpose: 過去の歯磨き記録の確認
   - Components:
     - カレンダービュー(記録済み日をマーク)
     - 月間統計サマリー
     - 日付選択機能
     - 詳細履歴リスト
     - フィルター機能(朝/夜)
   - Data: 全記録履歴、月間統計、選択日の詳細

4. **Progress (進捗)**
   - Purpose: 長期的な進捗と達成状況の可視化
   - Components:
     - 現在のストリーク表示(大きなカード)
     - 最長ストリーク記録
     - 達成バッジ一覧
     - 月別達成率グラフ
     - 週別トレンドチャート
     - 統計サマリー(総記録日数など)
   - Data: ストリーク情報、達成バッジ、統計データ

5. **Settings (設定)**
   - Purpose: アプリケーションの設定とカスタマイズ
   - Components:
     - リマインダー時間設定(朝・夜)
     - 通知のオン/オフスイッチ
     - 目標設定(1日の歯磨き回数)
     - テーマ選択
     - プロフィール管理
   - Data: ユーザー設定、通知設定、プロフィール情報

## Data Models
1. **BrushingRecord**
   - id: string
   - userId: string
   - timestamp: Date
   - timeOfDay: 'morning' | 'night'
   - duration: number (seconds)
   - notes: string (optional)
   - completed: boolean

2. **UserProfile**
   - id: string
   - name: string
   - email: string
   - avatar: string (optional)
   - createdAt: Date

3. **UserSettings**
   - userId: string
   - morningReminder: string (time)
   - nightReminder: string (time)
   - notificationsEnabled: boolean
   - dailyGoal: number
   - theme: 'light' | 'dark'

4. **StreakInfo**
   - userId: string
   - currentStreak: number
   - longestStreak: number
   - lastBrushingDate: Date

5. **Achievement**
   - id: string
   - title: string
   - description: string
   - icon: string
   - unlockedAt: Date (optional)

## UI Components
1. **Dashboard Page**
   - shadcn: Card, Button, Progress, Badge, Tabs, Avatar
   - Custom: BrushingStatusCard, StreakDisplay, QuickRecordButton, RecentActivityList

2. **Record Page**
   - shadcn: Card, Button, Progress, Textarea, Dialog
   - Custom: BrushingTimer, TimerControls, BrushingGuide

3. **History Page**
   - shadcn: Card, Calendar, Select, Badge, Tabs, ScrollArea
   - Custom: BrushingCalendar, DailyDetailCard, MonthlyStats

4. **Progress Page**
   - shadcn: Card, Badge, Progress, Tabs
   - Recharts: LineChart, BarChart, RadialChart
   - Custom: StreakCard, AchievementGrid, ProgressChart

5. **Settings Page**
   - shadcn: Form, Input, Switch, Select, Button, Separator, Card
   - Custom: ReminderTimeInput, NotificationSettings

# Implementation Checklist

## Phase 1: Setup & Configuration
- [x] Generate a modern app name/description and a project folder name [brush-track] based on the app name
- [x] Clone repo to [brush-track] folder and install dependencies
- [ ] Update the README.md based on your analysis of the codebase and frontend stack
- [ ] Update package.json name and app name references
- [ ] Update app name and description on the login page

## Phase 2: Branding & Assets
- [ ] Generate favicon.png (歯ブラシアイコン、320x320)
- [ ] Generate splash.png (歯磨きコンセプトイラスト、1024x1024)

## Phase 3: Backend Configuration
- [ ] Create mock amplify_outputs.json file

## Phase 4: State Management
- [ ] Extend Zustand store with BrushingRecord data model
- [ ] Add UserSettings to store
- [ ] Add StreakInfo to store
- [ ] Add sample brushing records data
- [ ] Add achievements data

## Phase 5: UI Development - Core Pages
- [ ] Create Dashboard page with brushing status cards
- [ ] Create Record page with timer functionality
- [ ] Create History page with calendar view
- [ ] Create Progress page with charts and stats
- [ ] Update Settings page for app-specific preferences

## Phase 6: UI Development - Components
- [ ] Create BrushingTimer component
- [ ] Create StreakDisplay component
- [ ] Create BrushingCalendar component
- [ ] Create QuickRecordButton component
- [ ] Create AchievementGrid component
- [ ] Install additional shadcn components as needed

## Phase 7: Navigation & Routing
- [ ] Add new routes for Record, History, Progress pages
- [ ] Update app-sidebar.tsx with new navigation items
- [ ] Update navigation icons to match functionality
- [ ] Ensure proper route protection for authenticated users

## Phase 8: Final Polish
- [ ] Add loading states and error handling
- [ ] Test all features and navigation
- [ ] Verify responsive design on mobile
- [ ] Ensure all required pages are created and wired up
- [ ] Run lint and typecheck commands

最後まで実行したのものをコピーしてきたのですが、チェック率は中途半端でした。この辺りはCLAUDE.mdで実装が完了したら更新をするよう指示したり、hooksコマンドで更新するよう指示しておくのがいいかもしれませんね。

そうこうしているうちに画面ができたので、起動してみます。

開発サーバーの起動コマンド

npm run dev

Auth UserPool not configuredエラー画面

Auth UserPool not configuredと表示されました。作られたコードベースを見ると計画にあったようにダミーの amplify_output.jsonが作成されていました。

なるほど、スターターキットはAmplify Gen2によるバックエンドの作成を前提としているのですね・・・
ここもシームレスにテンプレートとして作成してくれるとありがたいですよね・・・

手動でバックエンドを作成していきます。

3. Amplify Gen2のセットアップ

テンプレートからAmplify Gen2のバックエンドは作成可能なので、下記コマンドを実行してみます。

npm create amplify@latest

これだけで、ある程度自動で作ってくれるのでありがたいですね。バックエンドの実装を行っていきたい場合はamplifyフォルダに処理を追記していきましょう。

サンドボックス環境を作成して、今回作った画面でログイン機能を実現できるようにリソースをデプロイしていきます。

npx ampx sandbox

File written: amplify_outputs.jsonと表示されて、amplify_outputs.jsonにデプロイされたリソース情報が書かれていれば完了です!
この状態でログイン画面を表示して、ユーザー登録処理を行なってログインしてみます。

CleanShot 2025-07-26 at 16.49.48@2x 1

認証コードが要求されるので、登録するメールアドレスに届けられている認証コードを入力します。

認証コード入力画面

サインアップを完了すると、サンプル画面が表示されます!

BrushTrackのダッシュボード画面

おおお、しっかりと作られていますね。
何画面か作成されているのでそれぞれ確認してみます。

記録画面

歯磨き記録画面(タイマー機能付き)

履歴画面

歯磨き履歴画面(カレンダービュー)

進捗画面

進捗画面(ストリークとグラフ表示)

設定画面

設定画面(リマインダー時間設定)

テンプレートやガイドに従って複数画面作ってくれますね!日本語が若干変であったり、 若干の無機質さはあるものの爆速でモックとして何か作りたい!というレベルなら試してみるのもいいかもしれませんね。

AIに作り込んでもらう場合は、もう少し指示を丁寧にしていく必要があるのかなと思いました。

コードの最適化とトラブルシューティング

Frontend MCP Serverを活用してコードを最適化してと依頼すると、今度はMCPサーバーのtroubleshootingトピックを参照してくれました。

MCPサーバーのtroubleshootingトピックの内容

中身はこんな感じです。こちらも固定文言です。詳細は補足セクションをご覧ください。

トラブルシューティングガイドの内容(抜粋)

# Solutions to common issues when generating code for the application

- Always check for guidance from the awslabs.frontend-mcp-server MCP server when implementing new features or adding new pages
- Routing - always the already installed react-router v7 in Declarative mode for routing. Do not use the outdated react-router-dom package
- Components - always look for existing shadcn components before attempting to create new custom components
- Copying/Moving files - the user might be on Windows, try cross-platform commands
- Generating Images - a minimum resolution of 320x320 is required for Nova Canvas MCP server to generate images
- Creating Charts - Use shadcn charts for any charting https://ui.shadcn.com/charts
...

essential-knowledgeで定義されたルールに沿って、React Router v7を使うとか、カスタムコンポーネントを作成するのではなく、shadcn/uiコンポーネントを優先するとか、より具体的な実装上の注意点がまとまっていますね。

上記ガイドと実際のコードを見て、以下のような最適化計画が提示されました。

## BrushTrack コード最適化計画

Frontend MCP Serverのガイダンスに基づいて、以下の最適化を実施します:

### フェーズ1: コンポーネント再利用性の向上

**1.1 BrushTrack専用コンポーネントの作成**
- BrushingStatusCard: ダッシュボードの歯磨きステータス表示用
- StreakDisplay: ストリーク情報表示用
- ProgressCard: 進捗表示用統一コンポーネント
- BrushingTimer: タイマー機能を独立したコンポーネントに
- QuickRecordButton: 簡単記録ボタンの再利用可能版

**1.2 カスタムフックの作成**
- useBrushingTimer: タイマーロジックを分離
- useBrushingStats: 統計計算ロジックの共通化
- useDateUtils: 日付計算の共通化

### フェーズ2: パフォーマンス最適化

**2.1 メモ化とキャッシング**
- React.memoによるコンポーネント最適化
- useMemoで重い計算のキャッシング
- useCallbackでイベントハンドラー最適化

**2.2 遅延読み込み**
- ページコンポーネントのReact.lazy化
- Suspenseによるローディング状態の改善

**2.3 Zustandストアの最適化**
- ストアを機能別に分割(auth, brushing, settings)
- セレクターの最適化
- 楽観的更新の実装

### フェーズ3: UI/UX改善

**3.1 ローディング・エラー状態**
- Skeletonコンポーネントの追加
- Error Boundaryの実装
- 楽観的更新によるUX向上

**3.2 アニメーション・トランジション**
- Framer Motionまたは純CSS での smooth transitions
- ページ遷移アニメーション
- マイクロインタラクションの追加

**3.3 レスポンシブ改善**
- より細かいブレークポイント対応
- モバイルファーストの改善

### フェーズ4: データ処理とチャートの最適化

**4.1 チャートパフォーマンス**
- データ変換の最適化
- Chart設定の中央管理
- リアルタイム更新の効率化

**4.2 日付処理の統一**
- date-fnsを活用した共通ユーティリティ
- タイムゾーン対応の改善

### フェーズ5: コード品質向上

**5.1 型安全性の強化**
- より厳密なTypeScript設定
- カスタム型ガードの追加
- Runtime validation

**5.2 エラーハンドリング**
- 統一的なエラー処理
- ユーザーフレンドリーなエラーメッセージ
- ログ記録の改善

**5.3 テスト追加**
- 単体テストの追加
- インテグレーションテストの準備

### フェーズ6: アクセシビリティ・国際化

**6.1 アクセシビリティ改善**
- ARIA属性の追加
- キーボードナビゲーション改善
- スクリーンリーダー対応

**6.2 国際化準備**
- 文字列リソースの外部化
- 多言語対応の基盤作り

### 実装順序
1. まず再利用可能コンポーネントとカスタムフックを作成
2. パフォーマンス最適化を適用
3. UI/UX改善を段階的に実装
4. 最後にアクセシビリティと国際化対応

この計画により、shadcn/uiの最適活用、パフォーマンス向上、保守性の改善、ユーザー体験の向上が期待できます。

カスタムフックや、メモ化、Zustandストアの最適化など順当なポイントを言っている気がします。

Frontend MCP Serverの仕組みを理解する

開発を進める中で、Frontend MCP Serverの特徴が見えてきました。

固定ドキュメントの返却

MCPサーバーに「コンポーネントの再レンダリング最適化について教えて」と聞いても、返ってくるのは同じtroubleshootingドキュメントです。

つまり、このMCPサーバーは

  1. 事前定義されたトピック別の静的コンテンツを返却
  2. 動的な回答は生成しない
  3. プロジェクト全体の開発方針を統一するためのリファレンスとして機能

という特徴を持っているということがわかりました!
冒頭でも先に言ったように固定文言を返すMCPサーバーというわけですね・・・

感想

Frontend MCP Serverを使ってみて感じたことをまとめます。

メリット

  • 統一された開発パターンに従える
  • スターターキットですぐに開発を始められる
  • ベストプラクティスが組み込まれたガイドが提示される

課題

  • Amplify Gen2がスターターキットに組み込まれているため、Amplify Gen2の知識が若干必要
  • 固定ガイドラインなので、個別の技術的質問には対応できない
  • バックエンド作成を依頼してもMCPサーバーでは対応できない

現時点では固定文言を返すだけのMCPサーバーですが、これはこれで価値があると思います!
ベストプラクティスに基づいたガイドに従って、ある程度LLMが実装を進めてくれるためです。

ただ、無理に活用しなくても、補足に書いてあるようなマークダウンファイルを別途作成してローカルに配置して参照するように指示するでも現時点では、MCPサーバーの機能と同様かもしれないですね。

今後、より動的な応答ができるようになったり、Amplify Gen2のバックエンド作成、プロジェクトの状態を理解して適切なアドバイスを返せるようになったりすると、さらに強力なツールになりそうですね!

おわりに

Frontend MCP Serverを使って歯磨き習慣アプリを作ってみました!固定ガイドラインを返すシンプルな作りですが、スターターキットから始められる点と、開発パターンに従える点は良いのかなと思いました!今後の進化に注目しながら、積極的に使ってナレッジをブログで共有できたらなと思っています!

残念ながら今回は歯磨きの習慣をしてみよう!と言ったレベルのアプリケーションにはならなかったので、今後もAIを活用して歯磨きの習慣を続けられる何かを生み出したいですね・・・

最後までご覧いただきありがとうございました!

補足:MCPサーバーが返す固定ガイドライン

Frontend MCP Serverが返す固定ガイドラインの内容を参考までに記載しておきます。

essential-knowledge

React + Tailwind CSS + shadcn/uiを使用したWebアプリケーション開発を支援する際の指針として機能します。
このガイドでは、以下の内容が含まれています。

  • プロジェクト実装フローの詳細な手順
  • 要件分析からUI開発、バックエンド設定までの具体的な作業内容
  • CHECKLIST.mdを使用したタスク管理方法
  • 技術的なガイドライン(状態管理、コンポーネント構成など)
essential-knowledge
essential-knowledge
# Web application development instructions                                                                                                                       
## Introduction

This document provides instructions to create a custom web applications based on a frontend starter template. The template uses React, Tailwind CSS, React Router v7, shadcn UI components, AWS Amplify, and Zustand for state management. You should use this information to analyze user requirements, suggest appropriate approaches, and provide implementation steps for customizing the reference template to meet their specific needs. Follow the structured approach outlined below to deliver high-quality applications efficiently while maintaining consistency with the existing architecture and best practices.

## Important

- Authentication, basic routing, and private/public layouts are already implemented

- Sample dashboard and settings pages exist as reference

- AWS backend integration will be handled separately

- If you run into issues, you MUST seek guidance from the AWSLabs Frontend MCP server under the "Troubleshooting" topic.

## Project Implementation Flow

### 0. Requirements Analysis

- Generate a modern app name and description

- Identify the primary color for the app if provided by the user, if not use shadcn defaults (usually #171717)

- Identify target users and primary purpose

- List and prioritize core features

- Map features to existing template structure

- Identify new pages and components needed

- Reuse the current authentication layouts and flow

- Reuse the current private page layout, with the application sidebar on the left and page content on the right

- Always include a dashboard page as the start page, and incorporate charts and lists based on the functional needs of the application

- Incorporate an AI Chat assistant to the application if helpful

- Make the UI design contemporary, clean and minimal.

### 1. Document your plan

Once you have completed your analysis, you MUST create a CHECKLIST.md in the root folder of the project with two clearly defined sections:

**Section 1: Application Analysis**

- Application name and description

- Target users and primary purpose

- Core features (prioritized list)

  - Be specific and detailed for each feature

  - Include success criteria for each feature

  - Identify which features require backend integration

- Complete page list with brief descriptions for each page

  - Detail EVERY page needed for the application

  - Include purpose, key components, and data needs for each page

  - Map pages to features they support

- Data models/entities needed

- UI components required for implementation

  - List shadcn components to be used for each page

  - Identify any custom components needed

**Example: Task Tracking App**

```markdown

# TaskFlow Application Analysis

## Application Overview

- **Name**: TaskFlow

- **Description**: A collaborative task tracking application for small teams

- **Target Users**: Small teams (5-15 people), project managers, freelancers

- **Primary Purpose**: Simplify task management and improve team coordination

## Core Features (Prioritized)

1. **Task Management**

   - Create, edit, delete tasks with title, description, due date, priority

   - Assign tasks to team members

   - Success criteria: Users can perform all CRUD operations on tasks

   - Backend integration: Required for persistent storage

2. **Task Board Views**

   - Kanban board with customizable columns (Todo, In Progress, Done)

   - List view with sorting and filtering options

   - Success criteria: Users can switch between views and drag-drop tasks

   - Backend integration: Required for state persistence

3. **Team Collaboration**

   - Comment on tasks

   - @mention team members

   - Success criteria: Users receive notifications when mentioned

   - Backend integration: Required for notifications

## Page List

1. **Dashboard**

   - Purpose: Overview of tasks, recent activity, and team performance

   - Components: Task summary cards, activity feed, progress charts

   - Data: Task counts by status, recent activities, completion rates

2. **Task Board**

   - Purpose: Visual kanban-style task management

   - Components: Drag-drop columns, task cards, filtering controls

   - Data: All tasks with status, assignee, priority information

3. **Task Details**

   - Purpose: View and edit detailed task information

   - Components: Form fields, comments section, activity log

   - Data: Single task with full details and comment history

4. **Team Members**

   - Purpose: Manage team members and view their tasks

   - Components: User list, user profile cards, assigned tasks

   - Data: User profiles and task assignments

5. **Settings**

   - Purpose: Configure application preferences

   - Components: Form fields for notification settings, theme options

   - Data: User preferences

## Data Models

1. **Task**

   - id, title, description, status, priority, dueDate, assigneeId, createdAt

2. **User**

   - id, name, email, avatar, role

3. **Comment**

   - id, taskId, userId, content, createdAt

## UI Components

1. **Dashboard Page**

   - shadcn: Card, Tabs, Avatar, Button, Select

   - Custom: TaskSummaryCard, ActivityFeed

2. **Task Board Page**

   - shadcn: Card, Badge, Avatar, Button, DropdownMenu

   - Custom: DraggableTaskCard, KanbanColumn

3. **Task Details Page**

   - shadcn: Form, Input, Textarea, Select, Button, Tabs, ScrollArea

   - Custom: CommentThread, TaskActivityLog

4. **Team Members Page**

   - shadcn: Card, Avatar, Table, Dialog, Badge

   - Custom: UserProfileCard, TaskAssignmentList

5. **Settings Page**

   - shadcn: Form, Switch, RadioGroup, Separator, Button

   - Custom: NotificationPreferences

**Section 2: Implementation Checklist**

- [ ] Generate a modern app name/description and a project folder name [app-name] based on the app name

- [ ] Clone repo to [app-name] folder and install dependencies

- [ ] Update the README.md based on your analysis of the codebase and frontend stack

- [ ] Update package.json name and app name references

- [ ] Update app name and description on the login page

- [ ] Generate favicon.png and splash.png images using nova canvas MCP server

- [ ] Create mock amplify_outputs.json file

- [ ] Add/update pages and required components, using shadcn components

- [ ] Extend routing structure

- [ ] Add sample data to Zustand store

- [ ] Update navigation

- [ ] Ensure all required pages are created and wired up

As you go through the implementation, keep updating the checklist to ensure that you have completely created all the pages and features necessary to meet the functional needs of the application. The analysis section should be completed BEFORE beginning any implementation tasks.

### 2. Setup & Configuration

```bash
# Clone repository into [app-name] folder
git clone -b starterkits https://github.com/awslabs/mcp.git [app-name]
# navigate to the frontend folder
cd [app-name]/frontend
# install packages
npm install
Analyze this code base after cloning to understand how it is structured and the key architectural patterns and frontend stack.

Based on your analysis, update the README.md with an overview of the functional goal of the application and the frontend stack, including specific versions (e.g. React 18 instead of just React)

**PHASE VERIFICATION**: Ensure repository is cloned successfully and all dependencies are installed without errors. Confirm README.md is updated with accurate information.

### 3. Application Branding & Identity

- Update package.json with new application name

- Update app name references in components (e.g., app-sidebar.tsx)

- Update the app name and description on the login page

- Update document title and metadata in index.html

- Customize the primary color for the application using Tailwind if the user has provided a custom primary color for the app

- When setting primary color, you MUST update both the Tailwind and Amplify theme to keep them in sync

- Use Nova Canvas MCP Server to create the following 2 images:

  - **favicon.png (320x320)**

	- Create a minimal abstract icon that represents the app concept

	- Use monochromatic shades of the primary color

	- Design should be simple enough to be recognizable at small sizes

	- Avoid text or complex details that won't scale down well

  - **splash.png (1024x1024)**

	- Create a compelling minimal abstract conceptual editorial illustration relevant to the concept of the app

	- Use primarily dark shades of the primary color with subtle accent colors if appropriate

	- Design should convey the app's purpose through abstract visual elements

	- Can include subtle patterns, gradients, or geometric shapes

- You MUST use 'mv' to move the generated image and overwrite the existing image, as users can be on Windows or Unix systems and the 'move' command might not be available.

```bash
mv source-folder/file destination-folder/file
- Replace existing app icon references with generated favicon.png

**PHASE VERIFICATION**: Confirm all branding elements are consistently updated throughout the application. Verify both favicon.png and splash.png are properly generated and placed in the public folder.

### 4. UI Development

- Add new pages following existing patterns

- Reuse existing pages, layouts, components where possible

- Install or use shadcn components vs. creating custom components where possible

- Add required shadcn components: `npx shadcn add [component-name]`

- Keep component organization flat and simple

- Extend routing using react-router v7 as configured

- Update navigation components

- Add sample data to the Zustand store

**PHASE VERIFICATION**: Ensure all pages in the application analysis document are implemented. Verify routing works correctly between all pages. Confirm components use shadcn UI where appropriate.

### 5. Backend Configuration

- Create a mock `amplify_outputs.json` file for development

- Structure it to match expected backend resources

- This file will later be updated by an external build process

**PHASE VERIFICATION**: Confirm the mock amplify_outputs.json file is correctly formatted and contains all necessary configuration for local development.

**Example: Task App Mock Backend Configuration**

```json
{
  "auth": {
    "userPoolId": "mock-user-pool-id",
    "userPoolWebClientId": "mock-client-id",
    "region": "us-east-1",
    "identityPoolId": "mock-identity-pool-id"
  },
  "api": {
    "endpoints": [
      {
        "name": "TasksAPI",
        "endpoint": "https://example.com/api/tasks",
        "region": "us-east-1"
      }
    ]
  }
}
## Technical Guidelines

### State Management

- Always use central Zustand store instead of component state

- Avoid prop drilling completely

- Components should access store directly via hooks

- Only use component state for temporary UI states (form inputs while typing)

### Component Organization

- Keep component organization flat

- Place new components in appropriate existing folders

- Don't group by features unless app is complex

- Follow existing naming conventions

- Always use shadcn components if available

## Final check

Conduct a final check to make sure that all items in the CHECKLIST.md are completed with a high level of quality and there are no errors or missing functionality.

troubleshooting(トラブルシューティングガイド)

このガイドでは、以下のような一般的な問題への対処法が記載されています。

  • ルーティングの設定方法(React Router v7を使用)
  • コンポーネントの選定(既存のshadcn/uiコンポーネントを優先)
  • クロスプラットフォーム対応のコマンド使用
  • 画像生成の要件(最小解像度320x320)
  • チャート作成のベストプラクティス
troubleshooting
troubleshooting
# Solutions to common issues when generating code for the application                                                                       
- Always check for guidance from the awslabs.frontend-mcp-server MCP server when implementing new features or adding new pages
- Routing - always the already installed react-router v7 in Declarative mode for routing. Do not use the outdated react-router-dom package
- Components - always look for existing shadcn components before attempting to create new custom components
- Copying/Moving files - the user might be on Windows, try cross-platform commands
- Generating Images - a minimum resolution of 320x320 is required for Nova Canvas MCP server to generate images
- Creating Charts - Use shadcn charts for any charting https://ui.shadcn.com/charts

In addition:
 - You MUST carefully analyze the current patterns and packages before suggesting structural or dependency changes
 - Avoid changing existing layouts, login.tsx, app-sidebar.tsx, and authentication and keep any required changes minimal
 - When adding new features, don't complete the analysis prematurely, continue analyzing even if you think you found a solution
 - Ensure the code is complete and pages and components for new features are implemented fully and connected with the rest of the application

この記事をシェアする

facebookのロゴhatenaのロゴtwitterのロゴ

© Classmethod, Inc. All rights reserved.