# Connect an MCP client by hand

## Connect any MCP client by hand

You do not have to let the CLI edit your files, and you are not limited to the tools it knows
about.  DBGorilla is an ordinary remote MCP server, so any client that speaks the protocol can
connect to it, including newer clients and ones you build yourself.

Any client needs only these four details:

| | Value |
|---|---|
| **Server name** | `dbgorilla` |
| **Server URL** | your deployment with `/mcp/` on the end.  On SaaS: `https://app.dbgorilla.com/mcp/` |
| **Transport** | Streamable HTTP (choose it over SSE or stdio; there is no local process to run) |
| **Authentication** | the HTTP header `Authorization: Bearer <your MCP API key>` |

If your client asks for a command to run, a stdio binary, or a package to install, that option
does not apply: DBGorilla is a hosted endpoint with no local server.  Look for whatever the client
calls a *remote*, *HTTP*, or *custom* MCP server.

Get the key first, then use the entry for your client below, or write the equivalent for a client
that is not listed.

## Getting your MCP key

You have one MCP key at a time, and every `setup-ide` flag that would print it (`--print-key`,
`--print-config`, even `--dry-run`) issues a new one and revokes the old.  Using any of them
to read your key breaks every editor already using it.

The app shows it to you instead.  Open your profile in DBGorilla and find the **MCP Server** card:
your current key is there, with a copy button.  Reading it there changes nothing.  You can also
regenerate or delete the key from that card.

If you would rather stay in the terminal, copy it from a config the CLI has already written:

```sh
# whichever of these exists on your machine
grep -o 'Bearer [^"]*' ~/.cursor/mcp.json
grep -o 'Bearer [^"]*' ~/.gemini/settings.json
grep -o 'Bearer [^"]*' ~/.config/opencode/opencode.json
grep -o 'Bearer [^"]*' .vscode/mcp.json
```

Or ask the API.  This endpoint returns the existing key and does not rotate it. `GET` reads, only
`POST` regenerates:

```sh
# macOS
TOKEN=$(security find-generic-password -s dbgorilla -a tokens -w | jq -r .access_token)

curl -sH "Authorization: Bearer $TOKEN" \
  https://app.dbgorilla.com/api/v0_1/client_api_keys/mcp-api-access
```

On Linux the CLI stores the same value in the Secret Service keyring.  Use `secret-tool lookup
service dbgorilla username tokens` in place of the `security` call.

Both routes put a live credential on your screen, into your shell history, and, for the duration of
the request, into your process list where other users on a shared machine can read it.  On a machine
you do not control, prefer copying the key from the app.

Lost or leaked key: see [When a new key is the right answer](/docs/troubleshooting/editor-and-mcp/#an-editor-stopped-connecting-after-setup-ide).

## Entries for specific clients

Most clients keep MCP servers in a JSON file under an `mcpServers` object, so the entries below
differ only in details.  If yours is not here, copy the closest one and check its documentation for
what it calls the URL field.

### Claude Code

In `~/.claude.json` or via `claude mcp add`:

```json
{
  "mcpServers": {
    "dbgorilla": {
      "type": "http",
      "url": "https://app.dbgorilla.com/mcp/",
      "headers": { "Authorization": "Bearer <your MCP API key>" }
    }
  }
}
```

### Cursor

In `~/.cursor/mcp.json` (or `.cursor/mcp.json` for one project).  Same shape, without the `type`
field:

```json
{
  "mcpServers": {
    "dbgorilla": {
      "url": "https://app.dbgorilla.com/mcp/",
      "headers": { "Authorization": "Bearer <your MCP API key>" }
    }
  }
}
```

### VS Code

In `.vscode/mcp.json` for the project, or your user `mcp.json`.  The top-level key is `servers`.
Using `mcpServers` here silently loads nothing:

```json
{
  "servers": {
    "dbgorilla": {
      "type": "http",
      "url": "https://app.dbgorilla.com/mcp/",
      "headers": { "Authorization": "Bearer <your MCP API key>" }
    }
  }
}
```

### Gemini CLI

In `~/.gemini/settings.json`.  Use `httpUrl`, which selects Streamable HTTP.  The
`url` key selects SSE instead, which is not what the DBGorilla endpoint serves:

```json
{
  "mcpServers": {
    "dbgorilla": {
      "httpUrl": "https://app.dbgorilla.com/mcp/",
      "headers": { "Authorization": "Bearer <your MCP API key>" }
    }
  }
}
```

### opencode

In `~/.config/opencode/opencode.json`.  The servers live under `mcp`, not
`mcpServers`, and the entry needs `enabled`:

```json
{
  "mcp": {
    "dbgorilla": {
      "type": "remote",
      "url": "https://app.dbgorilla.com/mcp/",
      "enabled": true,
      "headers": { "Authorization": "Bearer <your MCP API key>" }
    }
  }
}
```

### Claude Desktop

Claude Desktop cannot be configured by file at all.  Remote MCP servers go through
**Settings → Connectors → Add custom connector**, where you paste
`https://app.dbgorilla.com/mcp/` and complete the OAuth prompt.  It authenticates with OAuth rather
than a Bearer token, so the key above does not apply, and the connector flow requires a Pro, Max,
Team or Enterprise plan.

## After you add the entry

:::caution[Project-scoped config files hold a live credential]

`.vscode/mcp.json` and `.cursor/mcp.json` live inside your repository, and the entry contains your
MCP key in plain text.  Committing one publishes a working credential.  Prefer the
user-scoped file (`--scope user`), add the project file to `.gitignore`, or use your client's
support for referencing an environment variable instead of a literal.

If a key does reach a remote branch, replace it: run `dbgorilla setup-ide`, which issues a new key
and revokes the leaked one.
:::

Restart the client afterward.  Some reload MCP configuration on their own, some only on startup, so
restarting is the one step that always works.

To check a hand-wired client, and what a 401 means, see [The MCP server returns a 401](/docs/troubleshooting/editor-and-mcp/#the-mcp-server-returns-a-401).