dbx: Lightweight Rust MCP Client for 70+ Databases & AI Agents
dbx: AI Agent Database Access with Granular MCP Controls
dbx is a 20 MB Rust-powered cross-platform database client that connects to over 70 databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, and SQL Server. Beyond its core database management features, dbx offers a dedicated Model Context Protocol (MCP) server, designed to allow AI coding agents to interact with configured databases.
Integrating AI Agents via the dbx MCP Server
The core of dbx's AI integration is its independent Rust-powered MCP server, which facilitates database queries from AI coding agents. This server is distributed separately from the main desktop application, meaning a direct installation of dbx does not automatically deploy the MCP executable.
To get started, you can run the server using npx:
npx @dbx-app/mcp-serverFor persistent integration with your MCP environment, add dbx to your .mcp.json configuration:
{
"mcpServers": {
"dbx": { "command": "npx", "args": ["-y", "@dbx-app/mcp-server"] }
}
}This setup allows AI agents like Claude Code, Cursor, and Windsurf to list connections, browse tables, execute SQL, and even open tables directly within the dbx UI.
Connection Security and Access Control
dbx provides robust control over how AI agents interact with your databases. Within DBX Settings → MCP, you can manage an allowlist of connections and define specific access modes:
- Read only (
read_only) - Data read/write (
safe_write) - Full access (
high_risk_write)
These machine-readable values ensure precise control, and client configurations do not require separate permission or connection-scope environment variables. For upgrade compatibility, any existing DBX_MCP_ALLOW_WRITES=0 (or false) setting will enforce read-only access until a new central MCP policy is explicitly saved. This legacy environment variable cannot enable write access or override a saved policy.
Deploying the MCP Server with dbx Web/Docker
For dbx Web or Docker deployments, the MCP server needs to be pointed to the Web backend API. If the Web login page requires a password, set the DBX_WEB_PASSWORD environment variable to match:
{
"mcpServers": {
"dbx": {
"command": "npx",
"args": ["-y", "@dbx-app/mcp-server"],
"env": {
"DBX_WEB_URL": "http://localhost:4224",
"DBX_WEB_PASSWORD": "your-web-login-password"
}
}
}
}Additionally, Windows portable builds require DBX_DATA_DIR in the MCP config to point to the data directory located next to DBX.exe, which contains dbx.db.
AI SQL Assistant Capabilities
Beyond the MCP server, dbx includes a built-in AI SQL Assistant. This assistant can translate natural language descriptions into SQL queries, explain existing queries, optimize SQL, and fix errors. It also incorporates safety checks for AI-generated SQL. The assistant supports Claude, OpenAI, local models, or any OpenAI-compatible endpoint, offering flexibility in your AI model choice.