---
title: "Set up SSH access and deployments"
url: https://docs.corefinity.com/mcp/playbooks/set-up-ssh-and-deploy
type: playbook
last_updated: 2026-11-13
---
# Set up SSH access and deployments

Give the person SSH access with their public key, connect the site's Git repository and branch, add the crons it needs and run a first deployment.

Prompt name: `set-up-ssh-and-deploy`

## Arguments

- `site` (required): The site: its domain, or the id of any of its environments.
- `environment`: The environment's name, for example Staging. Without it the prompt works on production when this token may, otherwise on the first environment it may.
- `repository`: The Git repository to deploy from, once it is connected on the site's Deployments tab.
- `branch`: The Git branch to deploy.

## Starting prompt

```text
Use the Corefinity MCP prompt "set-up-ssh-and-deploy" with site: <the site: its domain, or the id of any of its environments>, environment: <the environment's name, for example staging. without it the prompt works on production when this token may, otherwise on the first environment it may>, repository: <the git repository to deploy from, once it is connected on the site's deployments tab>, branch: <the git branch to deploy>. Follow it step by step and tell me before anything that changes my account.
```

## What the assistant is told

Purpose: give the person SSH access to <the site's domain> with their own key, connect its Git repository and run a first
deployment.

- Repository: <repository>.
- Branch: <branch>.

## Before you start

- The row you work on is site row <the id of the site row you work on> (<the environment's name>). Use it as `site_id`.
- Ask for the person's **public** key. Never ask for a private key.
- Ask before every change, and type a `confirm_*` value only after the person has said yes to that exact action.
- 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. **SSH.** Read `corestack_ssh_access_get`, then add the person's public key with `corestack_ssh_quick_setup`. If they
   want one key for every site of the company, use `corestack_company_ssh_key_create`.
2. **Git.** Read `corestack_deployments_repositories_list` and `corestack_deployments_branches_list`. If no repository is
   connected, tell the person to connect one on the site's Deployments tab, and wait. Then set it with
   `corestack_deployments_repository_set` and choose the mode with `corestack_deployments_mode_set`. Run
   `corestack_deployments_shared_files_check` before the deployment (it advises, never gates) and tell the person what it
   found: a deployment stops at linking shared files without the settings file its platform needs (such as `.env`)
   unless their repository includes it, which no check can see before the build, and a missing file's `message` says
   where to create it over SFTP or SSH. Then run `corestack_deployment_trigger` when they say so, whether or not they
   create the file; follow it with `corestack_deployments_get`. For build, database or post-deploy
   commands, use the steps of the `set-up-deployment-pipeline` prompt.
3. **Crons the application needs:** check them with `corestack_crons_validate`, then save them with
   `corestack_crons_update`.
4. **Verify** with `corestack_site_http_check` or the smoke test, `corestack_site_smoke_test`.

## Stop and ask

- Before the first deployment to production.
- If the person offers a private key or a password: refuse it and ask for the public key instead.

## When you are done

Report the SSH command the person can use and the deployment's result.

