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

**List SSH keys.** Lists the SSH keys that can log in to one environment, website or company (give exactly one selector): every key per username (the shared web user and each person's own login) with its source, who added it, fingerprint, type, size, last use, Legacy end date and whether it has reached the environment. Never shows a key itself. Scope: read.

- Scope: `read`
- Runs as a task: no

## When to use it

List who can log in over SSH, and with which keys, on one environment, a website or a company. Each key shows where it comes from (environment, website, company, agency, personal, Legacy), who added it, its fingerprint, type and size, when it was last used and whether it has reached the environment. Never a key itself.

A website's or a company's own keys (`grants[]`, and a company's `inherited[]`) carry `delivery` across every environment they reach: `state`, `applied` of `total` (where the key works now), `waiting` (environments where the key, or its removal, takes effect only at their one-time switch-over or a platform update; until then the keys that worked there before keep working), `waiting_platform_update` (how many of `waiting` wait for a platform update), `removed` (a key being removed: the environments it has already gone from; 0 otherwise) and `not_on_new_system` (environments that are not on the new system yet, so keys there are not changed from here yet). An agency's key in a client's `inherited[]` describes the client's own environments only: its `delivery`, `reach`, `applies_to.environment_ids` and `last_used_at`. Say "works on 16 of 26 environments, the other 10 at their switch-over", never that a waiting or removing key is broken.

`total` counts only the environments on the new system or joining it: environments that are not on the new system yet are counted in `not_on_new_system` and left out of `total`, `applied`, `waiting` and `removed`. A key on 16 environments with 10 more not on the new system yet reads `state` `applied`, `applied` 16 of `total` 16, `not_on_new_system` 10: say "works on all 16 environments on the new system; 10 are not on the new system yet". When every environment is outside, `total` is 0 and `state` is `applied`. An environment's own `delivery.not_on_new_system` is `true` when it is not on the new system yet, whatever its `state` and `waiting_for` say (`waiting_for` is `cli_override` when its CLI override keeps it off); it then has no switch-over date, so never promise one.

An environment's answer has `managed_on`: null, or `{id, name}` when this environment runs on the same server as another environment whose SSH the Control Panel manages. Its keys are then added, changed and removed on that environment (the first note says so, and `can_add.refused` is `managed_elsewhere`).

A company's answer (`my_company` or `client_company_id`) also has `can_add.message`: when your role lacks the Create Company SSH Keys permission, `can_add.refused` is `forbidden` and `message` is the sentence adding a company key would refuse with (the permission and who can grant it); otherwise it is null.

An environment's answer lists in `add_options` the levels you may add a key at (this environment, its website, the company, yourself). A level you reach but your role may not add at is left out of it and named in `add_refusals` instead, `{level, refused, message}`: today only `company`, `forbidden`, when your role lacks the Create Company SSH Keys permission, with the same sentence. Offer only the levels in `add_options`; when the person asks for the company level, give them that sentence. `add_refusals` is empty for the company's owner and for a role holding the permission.

## Inputs

- `enterprise_env_id` (integer): a CoreStack Enterprise environment's id (`environment.id` in corestack_ssh_keys_list). Give this or `site_id`.
- `site_id` (integer): a CoreStack or CoreCluster environment row, as the other corestack tools take it. Give this or `enterprise_env_id`.
- `website_id` (integer): a website's id. Give exactly one of the four selectors.
- `my_company` (boolean): `true` for your own company.
- `client_company_id` (integer): a client company your agency reaches.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "client_company_id": {
      "description": "A client company your agency reaches.",
      "minimum": 1,
      "type": "integer"
    },
    "enterprise_env_id": {
      "description": "A CoreStack Enterprise environment's id (environment.id in corestack_ssh_keys_list); for CoreStack or CoreCluster give site_id.",
      "minimum": 1,
      "type": "integer"
    },
    "my_company": {
      "description": "true: your own company (the token's).",
      "type": "boolean"
    },
    "site_id": {
      "description": "A CoreStack or CoreCluster environment row's site_id.",
      "minimum": 1,
      "type": "integer"
    },
    "website_id": {
      "description": "A website's id.",
      "minimum": 1,
      "type": "integer"
    }
  },
  "type": "object"
}
```

## Refusals

- `forbidden`: listing a company's keys and the person's role lacks the View Company SSH Keys permission. The message
  names it and says an owner of the company can grant it in Roles; `details.permission` is `viewCompanySSHKeys`.
- 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).
- `tenant_mismatch` also answers a purged site (removed, or a create that failed and was rolled back), by `site_id` or by its environment's or website's id: its SSH access ended with it.
- `switched_off`: SSH keys are not switched on for this object yet.
- `enterprise_panel_only`: SSH keys for CoreStack Enterprise environments are managed in the Control Panel only at the moment.

## Example

```json
{
  "name": "corestack_ssh_keys_list",
  "arguments": {
    "site_id": 912
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_ssh_keys_list with site_id 912. (List SSH keys.) Tell me what it returned.
```

## The same task elsewhere

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