cd /news/ai-agents/let-claude-code-query-your-database-… · home › topics › ai-agents › article
[ARTICLE · art-162865] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Let Claude Code query your database read only with the DBX MCP server

DBX, an open-source database client covering 100+ databases, ships an MCP server that lets coding agents such as Claude Code and Cursor inspect real database schemas through allowed connections in read-only mode. Developers add the server to a project's .mcp.json via npx and restart the agent, which can then examine tables and sample rows before drafting queries or migrations instead of guessing at schemas or being handed raw credentials.

by read1 min views1 publishedNov 3, 2026

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.

npx @dbx-app/mcp-server

.mcp.json, using npx as the command and -y @dbx-app/mcp-server as the args:

{
  "mcpServers": {
    "dbx": {
      "command": "npx",
      "args": ["-y", "@dbx-app/mcp-server"]
    }
  }
}

Restart your agent so it picks up the new server.

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.

"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."

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

── more in #ai-agents 4 stories · sorted by recency
── more on @dbx 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/let-claude-code-quer…] indexed:0 read:1min 2026-11-03 · —