DBeaver MCP Server

Integrates with DBeaver to provide AI assistants access to over 200 database types using existing connections.

DBeaver MCP Server

MCP server that provides AI assistants access to databases through DBeaver connections.

npm version License: MIT Node.js

Features

  • Uses existing DBeaver connections (no separate config needed)
  • Native query execution for PostgreSQL, MySQL/MariaDB, SQLite, SQL Server
  • Falls back to DBeaver CLI for other database types
  • Connection pooling with configurable pool size and timeouts
  • Transaction support (BEGIN/COMMIT/ROLLBACK)
  • Query execution plan analysis (EXPLAIN)
  • Schema comparison between connections
  • Read-only mode and tool filtering
  • Query validation to block dangerous operations
  • Data export to CSV/JSON

Requirements

  • Node.js 18+
  • DBeaver with at least one configured connection

Installation

npm install -g dbeaver-mcp-server

Configuration

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "dbeaver": {
      "command": "dbeaver-mcp-server"
    }
  }
}

Environment Variables

VariableDescriptionDefault
DBEAVER_PATHPath to DBeaver executableAuto-detected
DBEAVER_WORKSPACEPath to DBeaver workspaceOS default
DBEAVER_TIMEOUTQuery timeout (ms)30000
DBEAVER_DEBUGEnable debug loggingfalse
DBEAVER_READ_ONLYDisable write operationsfalse
DBEAVER_DISABLED_TOOLSComma-separated tools to disableNone
DBEAVER_POOL_MINMinimum connections per pool2
DBEAVER_POOL_MAXMaximum connections per pool10
DBEAVER_POOL_IDLE_TIMEOUTIdle connection timeout (ms)30000
DBEAVER_POOL_ACQUIRE_TIMEOUTConnection acquire timeout (ms)10000

Read-Only Mode

{
  "mcpServers": {
    "dbeaver": {
      "command": "dbeaver-mcp-server",
      "env": {
        "DBEAVER_READ_ONLY": "true"
      }
    }
  }
}

Disable Specific Tools

{
  "mcpServers": {
    "dbeaver": {
      "command": "dbeaver-mcp-server",
      "env": {
        "DBEAVER_DISABLED_TOOLS": "drop_table,alter_table"
      }
    }
  }
}

Available Tools

Connection Management

  • list_connections - List all DBeaver connections
  • get_connection_info - Get connection details
  • test_connection - Test connectivity

Data Operations

  • execute_query - Run SELECT queries
  • write_query - Run INSERT/UPDATE/DELETE
  • export_data - Export to CSV/JSON

Schema Management

  • list_tables - List tables and views
  • get_table_schema - Get table structure
  • create_table - Create tables
  • alter_table - Modify tables
  • drop_table - Drop tables (requires confirmation)

Transactions

  • begin_transaction - Start a new transaction
  • execute_in_transaction - Execute query within a transaction
  • commit_transaction - Commit a transaction
  • rollback_transaction - Roll back a transaction

Query Analysis

  • explain_query - Analyze query execution plan
  • compare_schemas - Compare schemas between two connections
  • get_pool_stats - Get connection pool statistics

Other

  • get_database_stats - Database statistics
  • append_insight - Store analysis notes
  • list_insights - Retrieve stored notes

DBeaver Version Support

Supports both configuration formats:

  • DBeaver 6.x: XML config in .metadata/.plugins/org.jkiss.dbeaver.core/
  • DBeaver 21.x+: JSON config in General/.dbeaver/

Development

git clone https://github.com/srthkdev/dbeaver-mcp-server.git
cd dbeaver-mcp-server
npm install
npm run build
npm test
npm run lint

License

MIT

Related Servers