# dbx: AI Agent Database Queries via MCP Client for 70+ DBs

> dbx is a 20 MB cross-platform database client supporting over 70 databases. It provides a separate Rust-powered MCP server, enabling AI coding agents to securely query databases using pre-configured connections and managed access policies. Developers can integrate dbx with tools like Claude Code to facilitate AI-driven database interactions.

**Published:** 2026-10-17T12:00:24.877+00:00

**Keywords:** dbx,mcp-client,t8y2-dbx,ai-database-client

# dbx: Connecting AI Agents to 70+ Databases via MCP

dbx is a lightweight, 20 MB cross-platform database client built in Rust, offering support for over 70 databases including MySQL, PostgreSQL, SQLite, Redis, MongoDB, and SQL Server. Beyond its comprehensive database management features, dbx distinguishes itself by providing a dedicated Model Context Protocol (MCP) server, specifically designed to empower AI coding agents to interact with configured databases.

## Enabling AI Database Access with the dbx MCP Server

The core of dbx's AI integration lies in its independent Rust-powered MCP server. This server acts as a bridge, allowing AI agents to query databases using connections already set up within dbx. It's crucial to note that this MCP server is distributed separately from the main desktop application; installing dbx does not automatically deploy the MCP executable.

To get the dbx MCP server running, you can use `npx`:

```bash
npx @dbx-app/mcp-server
```

Integrating this into your `.mcp.json` configuration is straightforward:

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

For dbx Web or Docker deployments, the MCP server needs to point to the Web backend API. If the Web login page uses a password, `DBX_WEB_PASSWORD` must be set accordingly in the MCP config:

```json
{
  "mcpServers": {
    "dbx": {
      "command": "npx",
      "args": ["-y", "@dbx-app/mcp-server"],
      "env": {
        "DBX_WEB_URL": "http://localhost:4224",
        "DBX_WEB_PASSWORD": "your-web-login-password"
      }
    }
  }
}
```

Windows portable builds require `DBX_DATA_DIR` in the MCP config, pointing to the `data` directory located next to `DBX.exe` (the folder containing `dbx.db`).

## Granular Access Control for AI Agents

Managing what an AI agent can do with your databases is critical. dbx provides a robust permission system within **DBX Settings → MCP**. Here, you can define an allowlist for connections and set access modes:

*   **Read only** (`read_only`)
*   **Data read/write** (`safe_write`)
*   **Full access** (`high_risk_write`)

These machine-readable values simplify client configurations, removing the need for permission or connection-scope environment variables. For upgrade compatibility, a legacy `DBX_MCP_ALLOW_WRITES=0` (or `false`) will enforce read-only access until a central MCP policy is explicitly saved. This legacy variable cannot enable writes or override a saved policy.

## Capabilities Exposed to AI Agents

Once connected, the dbx MCP server allows AI agents to perform several key operations:

*   Listing available database connections.
*   Browsing tables within a selected database.
*   Executing SQL queries.
*   Opening tables directly in dbx's UI for visual inspection.

This integration works with any MCP-compatible agent, including Claude Code, Cursor, and Windsurf, enabling AI agents to interact with your data in a structured and controlled manner.

## Built-in AI SQL Assistant

Beyond the MCP server, dbx itself includes an AI SQL Assistant. This feature allows developers to describe their data needs in natural language and receive SQL queries in return. The assistant can also explain queries, optimize SQL, fix errors, and run AI-generated SQL through safety checks. It supports Claude, OpenAI, local models, and any OpenAI-compatible endpoint. This built-in assistant complements the MCP server by providing immediate, local AI assistance for SQL generation and refinement within the dbx client itself.

## References

*   [dbx on GitHub](https://github.com/t8y2/dbx)
*   [Model Context Protocol Documentation](https://modelcontextprotocol.io/introduction)
*   [dbx on model-context-protocol.com](https://model-context-protocol.com/clients/)
```

## Related Repository

- [dbx](https://model-context-protocol.com/clients/dbx)

**Source:** https://model-context-protocol.com/blog/dbx-ai-agent-database-queries-via-mcp-client-for-70-dbs-mcp-client-guide
