An agent that can read your database answers questions you'd otherwise open a SQL editor for. "Why did signups drop on Tuesday?" "Which orders have been stuck in pending for more than an hour?" "What's actually in the events table?" With a query capability the model answers in seconds; without one it guesses. The useful part isn't the SQL — Claude Code and Cursor both write SQL fine — it's giving the agent a way to run a read without handing it your credentials. That handoff is the whole friction, and it's what this post walks through for both tools.

We've written separately about why pasting a database connection string into an agent is the move you can't undo — the credential is bearer access, it can write and drop as well as read, and once it's passed through a model's context you can't un-share it. Read that for the safety model; here we take it as settled and get the wiring done. The short version: the client holds the credential, the agent gets a scoped, read-only-by-default ask.

What you need

Termalin — the desktop app, free tier is fine. It's an SSH and database client with a built-in MCP server; that local server is what your agent will talk to.

At least one database connection saved in Termalin's Data client — Postgres, MySQL, SQLite, SQL Server, ClickHouse, MongoDB, Redis, and more. Pick something low-stakes for the first run: an analytics replica, a staging database, a copy.