> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowstep.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# דוגמאות MCP

> זרימות עבודה מקצה לקצה לתוכניות MCP נפוצות של Flowstep.

## 1. דור ותצוגה מקדימה של מסך

זרימת העבודה הנפוצה ביותר: דור מסך (יצירת הקובץ באותו שלב), ואז הצגת התוצאה.

```
1. create-new-design { "message": "Mobile sign-in screen for a developer tool.
                                  Email/password fields, Google SSO button, dark theme." }
                     → { "fileId": "FILE_ID", "screenIds": ["SCREEN_ID"] }

2. get-screen-image  { "fileId": "FILE_ID", "screenId": "SCREEN_ID" }
                     → [inline PNG]
```

השמטת `fileId` יוצרת קובץ חדש באופן אוטומטי. העבר קיים `fileId` כדי להוסיף מסכים לאותו קובץ במקום.

**פרומפט לעוזר ה-AI שלך:**

> Generate a Flowstep design: a mobile sign-in screen for a developer tool with email/password and a Google SSO button in dark theme, then show me the image.

***

## 2. תצוגה של רכיב React

העלה קובץ `.jsx` או `.tsx` כ-attachment והבקש מ-Flowstep לדור עיצוב תואם. Flowstep קורא את המקור וייצור מסך — אין צורך להריץ את האפליקציה.

```
1. upload-attachment  { "fileData": "<UTF-8 contents of ApiKeys.tsx>",
                        "fileName": "ApiKeys.tsx",
                        "mimeType": "text/javascript" }
                      → { "id": "ATT_ID", "path": "...", "type": "document",
                          "mimeType": "text/javascript" }

2. create-new-design  { "message": "Generate a desktop screen that matches this React component.",
                        "attachments": [{ "id": "ATT_ID", "path": "...", "type": "document" }] }
                      → { "fileId": "FILE_ID", "screenIds": ["SCREEN_ID"] }

3. get-screen-image   { "fileId": "FILE_ID", "screenId": "SCREEN_ID" }
                      → [inline PNG]
```

**פרומפט לעוזר ה-AI שלך:**

> Read `src/components/settings/ApiKeys.tsx`, upload it as an attachment, and generate a Flowstep screen that matches the component layout. Show me the rendered image.

***

## 3. איטרציה על מסך שנוצר ב-MCP

`edit-design` ו-`regenerate-design` דורשים הקשר עיצוב שקיים רק על מסכים שנוצרו עם מערך `designs`. עבור מסכים שנוצרו ללא אחד, ההסדר הוא לעבד את המסך כ-attachment וקרא ל-`create-new-design` עם התמונה.

```
1. upload-attachment  { "fileId": "FILE_ID", "screenId": "SCREEN_ID" }
                      → { "id": "ATT_ID", "path": "...", "type": "image", "mimeType": "image/jpeg" }

2. create-new-design  { "fileId": "FILE_ID",
                        "message": "Change the color scheme to dark mode and
                                    add a 'Remember me' checkbox below the password field.",
                        "attachments": [{ "id": "ATT_ID", "path": "...", "type": "image" }] }
                      → { "fileId": "FILE_ID", "screenIds": ["NEW_SCREEN_ID"] }

3. get-screen-image   { "fileId": "FILE_ID", "screenId": "NEW_SCREEN_ID" }
                      → [inline PNG]
```

עבור מסכים שיש להם הקשר עיצוב, קרא ל-`edit-design` ישירות עם השינוי ב-`message` והמסך ב-`targets`.

***

## 4. הרחבת מסך לזרימת עבודה מלאה

הוסף מסכים עוקבים לעיצוב קיים.

```
1. list-screens   { "fileId": "FILE_ID" }
                  → [{ "screenId": "BASE_SCREEN_ID", "prompt": "Sign-in screen", ... }]

2. expand-design  { "fileId": "FILE_ID",
                    "message": "Add the next screen in the user flow",
                    "operationVariant": "next_screen",
                    "targets": ["BASE_SCREEN_ID"] }
                  → { "fileId": "FILE_ID", "screenIds": ["NEXT_SCREEN_ID"] }

3. get-screen-image { "fileId": "FILE_ID", "screenId": "NEXT_SCREEN_ID" }
                    → [inline PNG]
```

חזור על שלב 2 עם `operationVariant: "error_state"` או `"empty_state"` כדי להוסיף מסכי מקרים קיצוניים.

<Note>
  `operationVariant` הוא פרמטר חובה עבור `expand-design`. גם המסך הבסיס חייב להיות נוצר עם מערך `designs` (הקשר עיצוב) — עבור מסכים ללא אחד, השתמש בהסדר attachment מדוגמה 3.
</Note>

***

## 5. ביקורת קוטה לפני עבודה קבוצתית

בדוק יכולת שיורית לפני הפעלת דורים מרובים.

```
get-plan-details {}
→ {
    "remaining": {
      "messages": { "daily": 38, "monthly": 413 }
    }
  }
```

אם `daily` נמוך, תזמן את העבודה הקבוצתית אחרי 00:00 UTC כאשר היא מתאפסת.
