GUIDE

How to connect a database behind a firewall to Claude, ChatGPT and Cursor

Updated

Run Kaiva Bridge's private connector on a machine inside your network that can reach the database. It connects out to Kaiva Bridge over an encrypted connection on port 443 and reaches only the database addresses you list, so you open no inbound port and add no firewall rule. Bridge then serves the database as a managed MCP server with read-only tools for Claude, ChatGPT, Cursor and any other AI client.

Step by step

  1. Add a connectorIn the console, open Workspace settings, Private network and click Add connector. Give it a name; Bridge shows its token once.
  2. Start it inside your networkOn a machine that can reach the database, with Node 22 or newer, run the commands below. The first line asks for the token. --allow names the database's host and port as that machine sees them; add one --allow for each address Bridge may reach.
  3. Connect the databaseChoose New server, then Database, and pick PostgreSQL, MySQL, MariaDB or SQL Server. Under Network choose Private network and your connector, then paste the connection string. Its host and port must be on the connector's --allow list.
  4. Choose the tools and deploySwitch on the tools your AI needs, click Deploy server and add the server's address to Claude, ChatGPT, Cursor or another MCP client.

On the machine inside your network (macOS or Linux; the console also shows the Windows PowerShell version). The token is typed in, never put on the command line, so it stays out of your shell history:

Terminal
read -rs KAIVA_BRIDGE_CONNECTOR_TOKEN && export KAIVA_BRIDGE_CONNECTOR_TOKEN
npx @kaiva/bridge connect --allow db.internal:5432

How the connector works

The connector only makes outbound connections, to Kaiva Bridge on port 443. Nothing outside your network can open a connection to it.

It holds no SQL and no database driver. Bridge's own drivers run on Bridge's side, including the encrypted connection to your database, so where the database uses TLS the connector carries only encrypted bytes.

What Bridge may reach is decided on your machine, by the --allow list. Bridge can ask to open an address; the connector opens it only if it is on the list, and Bridge cannot change the list.

A server behind a connector is never reached over the internet. If the link drops, the connector reconnects by itself. If the connector is not running, the server's tool calls fail with a message that says so, and Bridge tries no other route.

Encryption and sign-in

MySQL, MariaDB and SQL Server behind a connector connect only with a verified certificate, so the password reaches only your database. If the certificate comes from your own certificate authority, add that CA when you create the server.

PostgreSQL checks the certificate the same way. A PostgreSQL database inside your network that has no TLS can still be connected, by your explicit choice: Bridge then signs in with SCRAM only, so a readable password is never sent. The link between the connector and Bridge is always encrypted.

Keep it running

Run the connector the way you run other long-lived processes on that machine, such as a system service or a container. Workspace settings, Private network shows whether it is connected, the machine it runs on and the addresses it reaches. Revoking it there stops it.

What you need

Pro or Enterprise. A machine inside your network with Node 22 or newer that can reach the database and connect out to api.kaiv.ai on port 443. A PostgreSQL, MySQL, MariaDB or SQL Server login; one that can only read is recommended.

Other ways to do it

  • Give the database a public addressBridge connects directly to a database it can reach over the internet, with no connector. Bridge has no fixed address for an allow-list, so the database must accept connections from anywhere, protected by its login and TLS.
  • Run an MCP server inside your networkKaiva Postgres MCP, or another open-source MCP server, can run next to the database for AI clients on the same network. Claude.ai and ChatGPT cannot reach it without a tunnel or a public address.
  • ChatGPT's Secure MCP TunnelOpenAI's tunnel connects an MCP server you run inside your network to ChatGPT. You run and secure that server, and it serves OpenAI's products.

Questions

Do I need to open a port or change my firewall?
No. The connector only connects out, to Kaiva Bridge on port 443. If your network limits outbound traffic, allow api.kaiv.ai on port 443.
Can Bridge reach other machines on my network?
No. The connector opens only the host and port pairs you list with --allow, and Bridge cannot change that list.
Which databases work through a connector?
PostgreSQL, MySQL, MariaDB and SQL Server.
What happens if the connector stops?
Tool calls to that server fail with a message that its connector is not connected. Bridge never tries the database another way. Start the connector again and calls work.
Can the AI change my data?
No. Database tools only read, and every call runs read-only. A login that can only read adds the database's own refusal.
Which plans include private connectors?
Pro and Enterprise.