---
title: environment_create
url: "/docs/ai-agents/mcp-tools/environments/environment_create/"
canonical_url: https://docs.blossom88.com/docs/ai-agents/mcp-tools/environments/environment_create/
markdown_url: https://docs.blossom88.com/docs/ai-agents/mcp-tools/environments/environment_create.md
summary: Add an Environment to an App, such as staging.
categories:
- mcp
- reference
---

# environment_create

Add an Environment to an App, such as staging. Deploy it with environment_deploy.

| | |
|---|---|
| Access | Changes Blossom |
| Same as | [`blossom environment:create`](/docs/reference/cli/environment/create/) |

## Arguments

| Argument | Type | Description |
|---|---|---|
| `data` | object | The Environment, as in environment.yml from environment:init. Required. |
| `data.app_id` | string | App id. |
| `data.name` | string | Environment name, such as production or staging. |
| `data.source_type` | string | git_repo or image. |
| `data.deletion_protection` | boolean | Refuse deletion until turned off. |
| `data.automatic_deploys` | boolean | Deploy on every push to the tracked branch. |
| `data.image_repo` | string | Where Blossom pushes built images. |
| `data.prebuilt_image` | string | Image to run instead of building, for source_type image. |
| `data.caddy_config` | string | Extra Caddy configuration. |
| `data.basic_auth_enabled` | boolean | Require basic auth; set its users in Blossom. |
| `data.access_mode` | string | Who can open the Environment, such as public. |
| `data.access_public_paths` | string list | Paths open without access checks. |
| `data.preview_access` | string | Who can open Previews. |
| `data.preview_expiry_days` | integer | Delete a Preview after this many days without a deploy. |
| `data.preview_limit` | integer | Most Previews at once. |
| `data.preview_setup_command` | string | Command run when a Preview is created. |
| `data.preview_pull_requests` | boolean | Open a Preview for each pull request. |
| `data.preview_branch_pattern` | string | Branches that get Previews. |
| `data.preview_resources` | object | Preview size. |

## Example

```json
{"data":{"clone_url":"https://github.com/acme/shop","services":[{"name":"web","command":"web","port":3000,"publicly_exposed":true}]}}
```
