Let Claude Code and Cursor query your database (safely) — the MCP setup Termal.in has introduced a setup that lets AI coding agents like Claude Code and Cursor safely query databases through a local MCP server, keeping credentials in the app's vault and enabling read-only access by default. The configuration requires enabling the 'Let agents query your databases' setting and registering the termalin-mcp binary with either tool, after which agents can list connections, inspect tables and schemas, and run queries with a default 200-row cap. 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 https://termal.in/blog/give-an-ai-agent-database-access/ — 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 . One expectation to set: for Claude Code and Cursor, database access runs through the local stdio MCP server, so the agent needs to be on the same machine as your unlocked desktop app. There's a hosted path too — the connectors for claude.ai and ChatGPT can query an enrolled server's databases passwordless through termal.in/api/v1/mcp , using the server's own local database trust — but for a local IDE agent, the local server is the one you want. This is off by default, and deliberately so. Open Settings → Agent and enable "Let agents query your databases." The subtitle spells out the posture: off by default, and stays read-only unless a connection grants full access. Until you flip it, every database tool returns database access for agents is off — enable it in Settings → Agent , full stop. Two defaults are worth internalizing before you go further: The credential itself never moves: the connection's host, port and password stay in the app's vault, and the agent only gets to ask the running app to run a query and hand back rows. There's no connection string in a config file for the agent — or a prompt injection — to read. Claude Code — one command: claude mcp add termalin --