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

**Show the database login.** Show the environment's database login (host, port, database, user, password and the SSH tunnel line for a client outside the environment). Commands in the environment never need it: they connect with the container's APP_DB_* variables (MYSQL_PWD="$APP_DB_PASSWORD" mariadb -u "$APP_DB_USER" "$APP_DB_NAME"). Scope: exec. The secret opens in the person's browser; set reveal_to_agent to true to receive it yourself (needs exec).

- Scope: `exec`
- Runs as a task: no
- Returns a secret only when `reveal_to_agent` is set

## When to use it

Show the environment's database login (host, port, database, user, password and the SSH tunnel line for a client outside the environment). Commands in the environment never need it: they connect with the container's APP_DB_* variables (MYSQL_PWD="$APP_DB_PASSWORD" mariadb -u "$APP_DB_USER" "$APP_DB_NAME").

## Inputs

- `site_id` (integer, ≥ 1, required)
- `reveal_to_agent` (boolean, default `false`): Return the secret to you instead of opening it in the person's browser. Needs exec.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "reveal_to_agent": {
      "default": false,
      "description": "Return the secret to you instead of opening it in the person's browser. Needs exec.",
      "type": "boolean"
    },
    "site_id": {
      "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_db_credentials_get",
  "arguments": {
    "site_id": 4211
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_db_credentials_get with site_id 4211. (Show the database login.) Tell me what it returned.
```

## The same task elsewhere

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