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

> Source: <https://dev.to/dedupedai/let-claude-code-query-your-database-read-only-with-the-dbx-mcp-server-3o32>
> Published: 2026-11-03 02:11:17+00:00

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](https://github.com/t8y2/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](https://dedupedai.com/use-cases/t8y2-dbx/let-claude-code-query-your-databases-with-the-dbx-mcp-server/?utm_source=devto&utm_medium=article&utm_campaign=howto_dbx). More on the repo: [DBX use cases](https://dedupedai.com/use-cases/t8y2-dbx/?utm_source=devto&utm_medium=article&utm_campaign=howto_dbx).

Source repo: [t8y2/dbx](https://github.com/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](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](https://dedupedai.com/join/?utm_source=devto&utm_medium=article&utm_campaign=howto_dbx)**
