---
title: "corestack_external_db_get"
url: https://docs.corefinity.com/mcp/tools/corestack_external_db_get
type: tool
last_updated: 2026-11-13
feature: database
related:
  - https://docs.corefinity.com/api/reference/database/get-site-database.md
  - https://docs.corefinity.com/guides/sites/database/database-users.md
---
# corestack_external_db_get

**Database tab.** An environment's Database tab: the connection details, its database users (internal and external; the site's own `application` login first) and external database access with its allowed addresses. Scope: read.

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

## When to use it

Read an environment's Database tab: how to connect, its database users and its external database access. Use it before adding, changing or removing a database user, and to find the host, port and allowed addresses an outside system needs.

- `connection` is how the site's own tools reach the database: host `127.0.0.1`, port 3306, the database, and the SSH tunnel command for a client outside the environment. It never holds a login.
- `users` starts with `application`, the site's own login (`kind: protected`); its password is shown by `corestack_db_credentials_get`, and it is never changed here. The rest are the users added on this environment: `internal` ones connect from inside the site (its crons, the terminal and the SSH tunnel), `external` ones through external access from the allowed addresses only. Each says its access (`read_only` or `read_write`), its limits, whether it requires TLS, who added it and when, and whether a change to it is still applying (`pending`).
- `counts` says how many users the environment has and the caps: 10 users, at most 5 of them external.
- `external` is external database access: its status (`off`, `turning_on`, `tonight` while the first turn-on waits for the nightly window named by `window_date`, `on`, `failed`, `turning_off`), whether this environment can take it (`available`), the host (null until the first turn-on) and port outside systems connect to, the allowed addresses and the monthly price. `moved_at` says when a move of the environment turned access on again: the address changed then, so outside systems must use the new one. It is null while external access is not available to the person.
- `can` says what the person may do here.

## Inputs

- `site_id` (integer, ≥ 1, required): The environment's row: the site (its production) or one of its environments.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "site_id": {
      "description": "The environment's row: the site (its production) or one of its environments.",
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- 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_external_db_get",
  "arguments": {
    "site_id": 4211
  }
}
```

The answer starts `{"connection": {"engine": "MariaDB", "version": "11.4", "host": "127.0.0.1", "port": 3306, "database": "application", "ssh_tunnel": "ssh -N -L 3306:127.0.0.1:3306 -p 30122 web@ssh-example-furniture-co-uk.cfstack.io"}, "users": [{"username": "application", "kind": "protected", ...}, ...], ...}`.

## Prompt

```text
Using the Corefinity MCP server, call corestack_external_db_get with site_id 4211. (Database tab.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [GET /api/corestack/sites/{site}/database](https://docs.corefinity.com/api/reference/database/get-site-database.md)
- Guide: [Database users](https://docs.corefinity.com/guides/sites/database/database-users.md)
