Connections · stop 1 of 12

add_database

Connects another database without the password passing through the chat.

Works in read modeSaves to your nexql-mcp setupTool sets: query · dba · meta · full

You might ask

“Also connect our billing database on db.internal, user billing_reader.”

Your assistant may call add_database to answer.

How it works

  • The assistant passes the host, port, database and user, but never a password. The tool refuses a password, and refuses a URL that contains one.
  • nexql-mcp opens a one-time page on 127.0.0.1 with a random port and secret link. You check the details and type the password there.
  • When you submit, it tests the connection, stores the password in your OS keyring, saves a read-only profile and makes it available straight away, with no restart.
  • The page accepts 5 attempts and expires after 10 minutes. The assistant calls again with setupId to see whether you finished.
  • If nexql-mcp runs on another machine, it gives you a nexql-mcp profile add … command to run in a terminal instead.

Parameters

dbnamestring
Database name.
hoststring
Database server hostname.
namestring
Name for the new connection, e.g. "billing". Must not already be in use.
portnumber
Database server port (default 5432).
setupIdstring
Check on a setup started by an earlier call instead of starting a new one.
sslmodestring
libpq sslmode, e.g. "require" or "verify-full".
urlstring
postgres:// URL without a password, as an alternative to host/port/dbname/user.
userstring
Database role to log in as.

What your assistant reads

The description nexql-mcp sends with the tool. It's how the assistant decides when to use it.

Connect another Postgres database for this session and save it as a read-only profile, without the password passing through the chat. Give the connection details; this opens a one-time page on the user's computer where they check those details and type the password themselves. Never ask the user to paste a password into the chat, and never put one in a shell command or file. Tell the user what the page is for, then call again with setupId to see whether they finished.