Coding agents guess at database schemas. You can paste the schema into the chat, or you can hand the agent raw credentials and hope. The second option is the risky one.
DBX is a database client (desktop, Docker, CLI and web) that advertises 100+ databases in 25 MB, and it ships an MCP server. That lets Claude Code or Cursor inspect real tables through DBX, limited to the connections you allow and set to read only.
Set up
- Install DBX and add your database connections in the app.
- Check that the MCP server starts:
npx @dbx-app/mcp-server - Add a dbx entry to your project's
.mcp.json, usingnpxas the command and-y @dbx-app/mcp-serveras the args:
{ "mcpServers": { "dbx": { "command": "npx", "args": ["-y", "@dbx-app/mcp-server"] } } } - In DBX, open Settings, then MCP. Set the connection allowlist and choose Read only.
Restart your agent so it picks up the new server.
Use it
Ask the agent to look before it writes. Inspect a table's schema and a few sample rows first, then draft the query or migration against what is really there.
A prompt you can paste
"Add the t8y2/dbx MCP server to this project's .mcp.json, then use it in read only mode to inspect the orders table on my dev connection and write a query that lists customers with more than three orders this month. Do not run any write statements."
Keep it safe
- Leave production connections out of the allowlist, or keep them on Read only. Full access lets an agent change data.
- Start with a dev or staging copy so you can see what the agent asks for.
- This walkthrough follows the README and has not been run end to end by us. Check the repo for newer instructions.
More
Step-by-step card: Let Claude Code or Cursor query your databases, read only. More on the repo: DBX use cases.
Source repo: t8y2/dbx.
Want the setup commands for 50 AI repos people actually ship with? Get the free AI Repos That Actually Ship pack: https://dedupedai.com/ship-pack/?utm_source=devto&utm_medium=article&utm_campaign=shippack
Get one email every Monday with the week's hottest AI repos and exactly how to use them: subscribe free at dedupedai.com

