---
title: "Create or refresh a staging environment"
url: https://docs.corefinity.com/mcp/playbooks/create-staging
type: playbook
last_updated: 2026-11-13
---
# Create or refresh a staging environment

Create a staging environment for a site, or refresh an existing one from another environment, then check it answers.

Prompt name: `create-staging`

## Arguments

- `site` (required): The site: its domain, or the id of any of its environments.
- `name`: The staging environment's name. Defaults to Staging.
- `copy_from`: The environment to copy from. Defaults to production.
- `branch`: A Git branch to deploy to it afterwards, if any.

## Starting prompt

```text
Use the Corefinity MCP prompt "create-staging" with site: <the site: its domain, or the id of any of its environments>, name: <the staging environment's name. defaults to staging>, copy_from: <the environment to copy from. defaults to production>, branch: <a git branch to deploy to it afterwards, if any>. Follow it step by step and tell me before anything that changes my account.
```

## What the assistant is told

Purpose: give <the site's domain> a staging environment, or refresh an existing one from another environment, and check it
answers.

- The environment to create or refresh: <name> (when not given: `Staging`).
- Copy it from: <copy from> (when not given: production).
- A branch to deploy to it afterwards: <branch>.

## Before you start

- The site row you start from is <the id of the site row you work on>. Use it as `site_id`.
- Ask before every change, and type a `confirm_*` value only after the person has said yes to that exact action.
- Secrets, such as the environment's HTTP login, open in the person's browser. Never ask for `reveal_to_agent: true`
  unless the person asks for the value to be given to you.
- If a call is refused because this token lacks a scope or the site is outside its limits, the person is asked to allow
  it in the Control Panel; carry on once they have.

## Steps

1. **Does it exist, and is there room?** Read `corestack_environment_list`. Check room with `corestack_uat_sizes_list`
   for a CoreStack site, or `corecluster_capacity_check` for a CoreCluster site. If the person wants a price first, ask
   `corestack_billing_quote_preview`.
2. **Create or refresh.**
   - New: `corestack_environment_create` with a `source` that clones the environment named above (production when none
     is named).
   - Existing: `corestack_site_clone_preview`, then `corestack_site_clone` onto it. Never clone onto production in this
     playbook. A copy that only has to wait (the preview's `queues` is true) is queued and starts on its own: tell the
     person, and follow its task. When `corestack_environment_list` already shows a copy waiting onto it in
     `queued_copies`, another is refused until that one starts; cancel the waiting one with
     `corestack_queued_copy_cancel` only once the person agrees.
3. **A branch, if one was named:** read `corestack_deployments_get`, then run `corestack_deployment_trigger` when the
   environment deploys from Git.
4. **Verify** with `corestack_site_http_check`. The environment's HTTP login opens in the person's browser through
   `corestack_http_auth_reveal_password`.

A create that waits because the region's platform is not taking new changes for a while ("Waiting for the platform") carries on by itself: follow it with `corestack_site_progress_get` or `corestack_site_operation_get` instead of creating it again.

## Stop and ask

- Before creating or replacing anything, and before any price is incurred.
- If the copy would land on production: stop; this playbook never writes production.

## When you are done

Report the environment's address and how the person gets its login.

