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

**Turn on external database access.** Turn on external database access for an environment: a fixed public address and host name that only the listed addresses can reach, for external database users. It costs £15.00 / month (Dedicated IP address); confirm_cost must be true, after the person agreed. Scope: write. Long-running: answers with a task.

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

## When to use it

Turn on external database access for an environment, so an outside system (an order system, an ERP or a reporting tool) can connect to its database with its own external user. It gives the environment a fixed public address and a host name such as `example-furniture-co-uk-db.cfstack.io`, reachable only from the addresses you list; MariaDB itself stays private.

It costs £15.00 / month on the environment's contract (the Dedicated IP address add-on), from when access is on until it is turned off; a contract still in its trial is not charged until the trial ends. Tell the person the price, and send `confirm_cost: true` only after they agreed. Turning it on needs the site's billing rights: an agency that manages the site but does not pay for it asks the site's owner.

The first turn-on of an environment waits for its nightly maintenance window: the call answers at once with no task, `{"operation": null, "external": {...}}`, whose `status` is `tonight` and `window_date` the night it applies; the night bills the charge confirmed now. If that charge cannot be checked at night and the price has changed since, the turn-on is not applied: corestack_pending_changes_list shows the change failed with "The monthly charge for external access changed after it was confirmed…", and the person confirms the new charge by turning access on again. Later turn-ons answer a task and apply within minutes. Then add external users with corestack_external_db_user_add.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `sources` (array of 1–10 objects, required): The addresses that may connect: at least one. Each is `{"cidr": "203.0.113.10/32", "label": "Order system"}`: a public IPv4 address or block from /32 to /28, written from its first address. Private, shared, loopback, link-local, multicast and reserved ranges are refused, and so is the whole internet.
- `confirm_cost` (boolean, required): true: the person agreed to the £15.00 / month charge.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "confirm_cost": {
      "description": "true: the person agreed to the £15.00 / month charge.",
      "type": "boolean"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "sources": {
      "description": "The addresses that may connect: at least one.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "cidr": {
            "description": "A public IPv4 address or block from /32 to /28, e.g. 203.0.113.10/32.",
            "type": "string"
          },
          "label": {
            "description": "What the address is, e.g. \"Order system\".",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "cidr"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "site_id",
    "sources",
    "confirm_cost"
  ],
  "type": "object"
}
```

## Refusals

- `billing_forbidden`: the person cannot change this site's billing; the site's owner turns it on.
- `invalid_arguments`: an address breaks the rules above, a duplicate, more than 10, no address at all, or `confirm_cost` is not true; `fields` names each.
- `currency_unpublished`: the contract's currency has no published price for the add-on yet.
- `external_db_not_available`: this environment cannot take external access yet; Corefinity support can say when.
- `external_db_already_on`: external access is on already (or turning on); change its addresses with corestack_external_db_sources_set.
- `external_db_failed`: the last change to external access failed; Corefinity support retries or releases it.
- `busy`: another change to this environment is applying.
- `deleted`: the site is deleted (in its grace period).
- `provisioning`: the site is still being created.
- `demo_keep_required`: the site or cluster is a free demo that is not kept yet, and the dedicated database address costs money: it starts once the demo is kept. Ask the person to keep it (`corestack_demo_keep`, or open `keep_url`); `change` names this change and what it would cost a month once kept.
- `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_external_db_enable",
  "arguments": {
    "site_id": 4211,
    "sources": [
      {
        "cidr": "203.0.113.10/32",
        "label": "Order system"
      }
    ],
    "confirm_cost": true
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_external_db_enable with site_id 4211, sources [{"cidr":"203.0.113.10/32","label":"Order system"}]. (Turn on external database access.) Tell me what it returned.
```

## The same task elsewhere

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