dbeaver-mcp
Connects to local DBeaver workspaces to discover saved database connections and lets AI assistants explore them without re-entering hosts or passwords. Supports filtering by project, connection name, and connection type, and respects DBeaver read-only settings.
Provides read-only MariaDB database exploration through DBeaver connections: list databases and tables, describe table structure and indexes, find columns, run parameterized queries, and explain query plans.
Provides read-only MySQL database exploration through DBeaver connections: list databases and tables, describe table structure and indexes, find columns, run parameterized queries, and explain query plans.
Provides read-only PostgreSQL database exploration through DBeaver connections: list schemas and tables, describe columns and constraints, find columns, run parameterized SELECT/WITH/VALUES queries, and explain query plans with optional analyze.
Provides read-only SQLite database exploration through DBeaver connections: list tables and schemas, describe table structure, find columns, run parameterized queries, and explain query plans. SQLite files are opened read-only with an authorizer denying writes.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dbeaver-mcpdescribe the orders table in my Shop connection"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
dbeaver-mcp
An MCP server that lets AI assistants (Claude Code, Claude Desktop, GitHub Copilot in VS Code, Cursor...) explore your databases through the connections you already have in DBeaver. No second place to keep hosts and passwords.
Supported engines: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server and Oracle. Other DBeaver connections are listed but marked as unavailable.
Read-only by default, enforced by the database itself wherever the engine can do it:
Engine | How writes are refused |
PostgreSQL | Every query runs in |
MySQL, MariaDB | Read-only session and |
SQLite | The file is opened read-only, and an authorizer inside SQLite denies |
Oracle |
|
SQL Server | No read-only transaction exists. Queries run in a transaction that is always rolled back, and the SQL check refuses everything but one |
Works with DBeaver Community Edition. DBeaver does not need to be running.
Formerly published as
dbeaver-postgres-mcp. Thedbeaver-postgres-mcpcommand still works as an alias ofdbeaver-mcp.
What the assistant can do
Tool | What it does |
| Your DBeaver connections: name, engine, placeholder style, type (dev/test/prod), host, database, user, and how read-only is enforced. Never passwords. |
| Schemas with table counts and comments (MySQL: databases; SQLite: |
| Tables and views with estimated row counts and comments. PostgreSQL partitions are folded into their parent. Filter by name or comment. |
| Columns (type, nullable, default, comment), primary/unique/foreign/check constraints, tables that reference it, indexes, size, view definition |
| Which tables have a column like |
| One read statement ( |
| Query plan; |
| Only when |
Related MCP server: Database MCP Server
Install and connect
Requires Node.js 20+. SQLite connections need Node.js 22.13+ (they use Node's built-in node:sqlite, so nothing native is installed). SQL Server uses tedious and Oracle uses oracledb in Thin mode, both pure JavaScript; no Oracle Instant Client is needed. oracledb is an optional dependency: if it is missing, Oracle connections are listed as unavailable.
Check first what it sees and whether it can log in:
npx -y dbeaver-mcp --checkworkspace: C:\Users\you\AppData\Roaming\DBeaverData\workspace6
- Local Insurance [dev] localhost:5432/insurance user=qa, password saved
OK: connected as qa, PostgreSQL 16.4
- Shop [dev] localhost:3306/shop user=app, password saved
OK: connected as app@%, MySQL 8.4.6
- Local cache [dev] C:\data\cache.db
OK: SQLite 3.51.2
- Analytics [prod] warehouse:1521/dwh user=bi, password saved
OK: connected as BI, Oracle 19.24.0.0.0; read-only enforced by: a read-only transaction (DDL is kept out by the SQL guard)
- Billing [test] sql01:1433/billing user=report, password saved
OK: connected as report, SQL Server 16.0.4305.5 (Standard Edition (64-bit)); read-only enforced by: the SQL guard and a rollback only
- Legacy ERP [prod] erp:5000/erp user=sa, password saved
NOT USABLE: mssql is not supported yet (supported: postgresql, mysql, sqlite, sqlserver, oracle)
mode: read-onlyClaude Code
claude mcp add dbeaver -- npx -y dbeaver-mcpOn Windows: claude mcp add dbeaver -- cmd /c npx -y dbeaver-mcp
Limit it to some connections:
claude mcp add dbeaver -e DBEAVER_MCP_CONNECTION_TYPES=dev,test -- npx -y dbeaver-mcpGitHub Copilot in VS Code
.vscode/mcp.json in your project (or the user-level MCP config):
{
"servers": {
"dbeaver": {
"type": "stdio",
"command": "npx",
"args": ["-y", "dbeaver-mcp"],
"env": { "DBEAVER_MCP_CONNECTION_TYPES": "dev,test" }
}
}
}Use Copilot Chat in Agent mode to call the tools.
Claude Desktop / Cursor
{
"mcpServers": {
"dbeaver": {
"command": "npx",
"args": ["-y", "dbeaver-mcp"]
}
}
}Claude Desktop: claude_desktop_config.json. Cursor: Settings → MCP.
Configuration
All settings are environment variables, so they work in any MCP client.
Variable | Default | |
| auto | Folder that contains |
| all | Only these DBeaver projects, comma separated |
| all | Only these connections (name, id, or |
| none | Hide these connections |
| all | Only these DBeaver connection types, e.g. |
|
|
|
|
|
|
|
| Rows returned when the model does not ask for a number |
|
| Hard limit per query |
|
| Time limit for every query ( |
|
| Longer text/JSON values are cut |
The workspace is re-read every few seconds, so a connection you add in DBeaver is visible without restarting.
What is taken from DBeaver
Host, port, database or SQLite file (also from the JDBC URL when the connection is saved in URL mode), SQL Server named instances, Oracle service name / SID / TNS alias (
tnsnames.orafrom DBeaver's TNS path orTNS_ADMIN)Saved user and password (
credentials-config*.json)Connection type (dev / test / prod, and custom types with "confirm execute")
The "Read-only connection" checkbox
SSL settings with root/client certificates (PEM): PostgreSQL
sslmode; MySQLsslMode/useSSL/verifyServerCertificate(like Connector/J, TLS is tried first by default); SQL Serverencrypt/trustServerCertificate(encrypted by default, like the Microsoft JDBC driver)Default schema (bootstrap setting): the search path on PostgreSQL, the default database on MySQL,
CURRENT_SCHEMAon Oracle
If a PostgreSQL connection has no saved password, or the project uses DBeaver's "secure storage" (OS keychain), the server falls back to the normal PostgreSQL ways: PGPASSWORD and ~/.pgpass (%APPDATA%\postgresql\pgpass.conf on Windows). MySQL connections without a saved password log in without one.
SQL Server: SQL Server logins only (Windows, Kerberos and Entra ID authentication are listed as unavailable). Oracle: normal database logins only; connections set to log in as SYSDBA/SYSOPER are refused.
Not supported yet: SSH tunnels and proxies (those connections are listed as unavailable), and engines other than the six above. See docs/multi-db-plan.md for what comes next; a new engine is one class implementing Driver in src/drivers/types.ts.
Safety
Layers, from strongest to weakest:
Read-only in the database, always rolled back (see the table at the top). On PostgreSQL, MySQL, MariaDB and SQLite, writes, DDL, data-modifying CTEs and
SELECT INTOall fail inside the engine; on Oracle, DML does. The test suite checks this per engine with the SQL check switched off, and checks that SQL Server's rollback undoes writes and DDL.Static SQL check, per dialect. It understands each engine's quoting and comments, including MySQL's
/*! ... */comments, which the server executes. It allows one statement per call and no transaction control, and it blocks the few things a read-only transaction does not stop:PostgreSQL:
dblink*(opens a second connection), server files (pg_read_file,lo_import...), admin functions (pg_terminate_backend,set_config...), password tables (pg_authid,pg_shadow)MySQL / MariaDB:
INTO OUTFILE/DUMPFILE,LOAD DATA,LOAD_FILE(),SLEEP()/BENCHMARK()/ locks,SET/USE(session state of pooled connections),KILL,mysql.userSQLite:
ATTACH,VACUUM,load_extension()and file functions (SQLite's authorizer also denies them)SQL Server: anything but one
SELECT/WITH. SQL Server runs statements sent without;as one batch (SELECT 1 DELETE FROM t), so in read-only mode the check refuses every other statement's first word anywhere (INSERT,EXEC,INTO,COMMIT,SET...; quote a column named like a keyword). Alsoxp_*,sp_OA*,OPENROWSET/OPENQUERY/OPENDATASOURCE, dynamic SQL,WAITFOR,NEXT VALUE FOR, login tables.Oracle: DDL, PL/SQL blocks,
WITH FUNCTIONandPRAGMA AUTONOMOUS_TRANSACTION,ALTER SESSION, packages that reach files, the network, other sessions or jobs (UTL_FILE,UTL_HTTP,DBMS_LOCK,DBMS_SQL,DBMS_SCHEDULER...),SYS.USER$/LINK$. A stored function that itself uses an autonomous transaction cannot be detected; a read-only login prevents that.
Timeouts and limits. Every query has a time limit and lock timeouts. Row caps stop on the server side: a cursor on PostgreSQL,
sql_select_limiton MySQL, stepping the statement on SQLite,SET ROWCOUNTon SQL Server, and fetching only the rows needed on Oracle. Big tables are never pulled into memory.Write mode is opt-in and still refuses prod-like and DBeaver read-only connections.
What you should still do:
Use a database user with SELECT-only grants for the connections you expose. That is the only protection that does not depend on this code, and on SQL Server it is the only one in the database at all.
Remember that query results are sent to your AI provider. Check this is allowed for the data (personal data, client data).
DBeaver's password file is encrypted with a key that is the same in every installation. This tool reads it the same way DBeaver does, and so can any program running as you. The server never returns passwords to the model.
Development
npm install
npm run build
npm test # unit tests
npm run inspect # MCP Inspector UInpm test always runs the unit tests and the SQLite conformance tests, which build their own database file. Tests for the other engines run when that database is available and loaded with the matching fixture. test/compose.yml starts all of them:
docker compose -p dbeaver-mcp-test -f test/compose.yml up -d
# Oracle takes a minute or two on first start.
docker exec -i dbeaver-mcp-test-postgres-1 psql -U postgres < test/fixture.sql
docker exec -i dbeaver-mcp-test-mysql-1 mysql -uroot -proot < test/fixture.mysql.sql
docker exec -i dbeaver-mcp-test-mariadb-1 mariadb -uroot -proot < test/fixture.mysql.sql
docker cp test/fixture.mssql.sql dbeaver-mcp-test-mssql-1:/tmp/f.sql
docker exec dbeaver-mcp-test-mssql-1 /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'Sa_passw0rd!' -i /tmp/f.sql
docker cp test/fixture.oracle.sql dbeaver-mcp-test-oracle-1:/tmp/f.sql
docker exec dbeaver-mcp-test-oracle-1 sqlplus -s system/oracle@//localhost/FREEPDB1 @/tmp/f.sql
TEST_PG_HOST=localhost TEST_PG_PORT=15432 PGPASSWORD=postgres TEST_MYSQL=localhost:13306 TEST_MARIADB=localhost:13307 \
TEST_MSSQL=localhost:11433 TEST_ORACLE=localhost:11521 npm test(podman works the same as docker. In Git Bash on Windows, set MSYS_NO_PATHCONV=1 for the docker cp / exec lines.) src/conformance.test.ts runs the same checks against every engine; src/integration.test.ts has the PostgreSQL-specific ones.
Publishing:
npm login
npm publish # runs the tests firstLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Draxlr's remote MCP server connects AI assistants to your SQL databases and dashboards. Explore schemas, run read-only queries, manage saved queries and dashboards, and export results, all with row-level security so each user sees only their own data.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides AI assistants with read-only access to inspect database schemas, preview data, and run safe queries across PostgreSQL, MySQL, MongoDB, and SQL Server. It enables AI tools to understand database structures and relationships automatically to generate more accurate code.22 npm7MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to safely query and explore SQL Server and PostgreSQL databases with read-only access, supporting schema discovery, relationship exploration, and query execution.24 npm3MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to interact with multiple SQL databases (PostgreSQL, MySQL, SQL Server, SQLite, Trino) through MCP, reusing existing DBeaver connections for queries, schema management, and transactions, with SSH tunneling and read-only mode support.22850 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to query and interact with MySQL, PostgreSQL, and SQLite databases through saved connections, supporting read-only exploration and optional write operations with safety controls.MIT