---
title: "corestack_company_ssh_key_create"
url: https://docs.corefinity.com/mcp/tools/corestack_company_ssh_key_create
type: tool
last_updated: 2026-11-13
feature: ssh-keys
related:
  - https://docs.corefinity.com/guides/sites/access-and-security/ssh-keys.md
---
# corestack_company_ssh_key_create

**Add a company SSH key.** Add a public key to your company and choose the sites it reaches ("all" or a list of site ids). It is added to each site's web user. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Runs as a task: yes

## When to use it

Add a public key to your company and choose the sites it reaches ("all" or a list of site ids). It is added to each site's web user.

While `ssh_keys` is on, "all" means every CoreStack and CoreCluster site of your company: never a CoreStack Enterprise site or one of your clients' sites.

## Inputs

- `name` (string, 1–255 characters, required)
- `key` (string, 1–20000 characters, required)
- `sites` (one of `all` or array of integer, ≥ 1, up to 500 items, required): "all", or a list of site ids.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "key": {
      "maxLength": 20000,
      "minLength": 1,
      "type": "string"
    },
    "name": {
      "maxLength": 255,
      "minLength": 1,
      "type": "string"
    },
    "sites": {
      "anyOf": [
        {
          "enum": [
            "all"
          ],
          "type": "string"
        },
        {
          "items": {
            "minimum": 1,
            "type": "integer"
          },
          "maxItems": 500,
          "type": "array"
        }
      ],
      "description": "\"all\", or a list of site ids."
    }
  },
  "required": [
    "name",
    "key",
    "sites"
  ],
  "type": "object"
}
```

## Refusals

- `forbidden`: the person's role lacks the Create Company SSH Keys permission. The message names it and says an owner of
  the company can grant it in Roles; `details.permission` is `createCompanySSHKeys`. Nothing is changed.
- `invalid_arguments` for `sites: []` while `ssh_keys` is on: a company key reaches at least one site; to stop it reaching every site, delete it.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_company_ssh_key_create",
  "arguments": {
    "name": "Staging",
    "key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGd1aWRlLWV4YW1wbGUta2V5LW9ubHktbm90LXJlYWw deploy@example.co.uk",
    "sites": "all"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_company_ssh_key_create with name Staging, key ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGd1aWRlLWV4YW1wbGUta2V5LW9ubHktbm90LXJlYWw deploy@example.co.uk, sites all. (Add a company SSH key.) Tell me what it returned.
```

## The same task elsewhere

- Guide: [SSH keys](https://docs.corefinity.com/guides/sites/access-and-security/ssh-keys.md)
