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-mcp describe 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-connections-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 (and TimescaleDB, CockroachDB, YugabyteDB, Redshift), MySQL, MariaDB, SQLite, SQL Server, Oracle and ClickHouse. Connections behind an SSH tunnel work too. 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, TimescaleDB, CockroachDB, YugabyteDB, Redshift | Every query runs in |
MySQL, MariaDB | Read-only session and |
SQLite | The file is opened read-only, and an authorizer inside SQLite denies |
Oracle |
|
ClickHouse | Every query is sent with |
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.
Published on npm as
dbeaver-connections-mcp(the npm namedbeaver-mcpbelongs to an unrelated project). Installing it gives you the commandsdbeaver-connections-mcp,dbeaver-mcpanddbeaver-postgres-mcp, which all start the same server.Earlier versions were called
dbeaver-postgres-mcp. Withnpx, use the package name:npx -y dbeaver-connections-mcp.npx -y dbeaver-mcpwould install the other project.
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, ClickHouse: 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. ClickHouse has no foreign or unique keys; it shows the primary, sorting and partition keys, |
| 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. ClickHouse uses @clickhouse/client over ClickHouse's HTTP interface (port 8123, or 8443 with TLS); connections set to the native port 9000 are listed as unavailable. SSH tunnels use ssh2, also an optional dependency.
Check first what it sees and whether it can log in:
npx -y dbeaver-connections-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
- Events [dev] clickhouse:8123/events via SSH deploy@bastion.example.com:22 user=reader, password saved
OK: connected as reader, ClickHouse 25.8.4.13; read-only enforced by: the database
- Ledger [test] crdb.internal:26257/ledger user=app, password saved
OK: connected as app, CockroachDB v25.4.17; read-only enforced by: the database
- Legacy ERP [prod] erp:5000/erp user=sa, password saved
NOT USABLE: generic is not supported yet (supported: postgresql, mysql, sqlite, sqlserver, oracle, clickhouse)
mode: read-onlyClaude Code
macOS / Linux:
claude mcp add dbeaver --scope user -- npx -y dbeaver-connections-mcpWindows (Claude Code cannot start npx directly there, so it goes through cmd /c):
claude mcp add dbeaver --scope user -- cmd /c npx -y dbeaver-connections-mcp--scope user makes the server available in every folder. Without it, claude mcp add registers it only for the folder you ran it in. Check that it starts with:
claude mcp get dbeaverIt should say Status: ✓ Connected. The very first check can say Failed to connect while npx is still downloading the package; run it again. If it says Connected but the assistant sees no connections, run npx -y dbeaver-connections-mcp --check: if DBeaver keeps its workspace somewhere unusual, set DBEAVER_WORKSPACE.
Limit it to some connections (on Windows, put cmd /c before npx as above):
claude mcp add dbeaver --scope user -e DBEAVER_MCP_CONNECTION_TYPES=dev,test -- npx -y dbeaver-connections-mcpIf claude mcp add says unknown option '-y'
Some setups lose the --, and then claude mcp add reads the -y meant for npx as its own option. Any of these avoids it:
Install globally and run it with node. No npx or -y, and it starts faster because nothing is downloaded at launch. npm root -g prints where global packages live; use that folder in the path:
npm install -g dbeaver-connections-mcpclaude mcp add dbeaver --scope user -- node "C:\Users\you\AppData\Roaming\npm\node_modules\dbeaver-connections-mcp\dist\index.js"On macOS / Linux the global install puts dbeaver-connections-mcp on your PATH, so claude mcp add dbeaver --scope user -- dbeaver-connections-mcp is enough. To update, run npm install -g dbeaver-connections-mcp again.
Pass the command as JSON, so its arguments are never read as options:
claude mcp add-json dbeaver --scope user '{"type":"stdio","command":"cmd","args":["/c","npx","-y","dbeaver-connections-mcp"]}'(On macOS / Linux use "command":"npx","args":["-y","dbeaver-connections-mcp"].) Windows PowerShell 5.1 can strip the inner double quotes; if you get a JSON error, use one of the other two ways.
Write the config file yourself. .mcp.json in a project folder makes the server available in that project (Claude Code asks you to approve it the first time):
{
"mcpServers": {
"dbeaver": {
"command": "cmd",
"args": ["/c", "npx", "-y", "dbeaver-connections-mcp"],
"env": { "DBEAVER_MCP_CONNECTION_TYPES": "dev,test" }
}
}
}After a global install you can use "command": "node" with "args": ["C:\\Users\\you\\AppData\\Roaming\\npm\\node_modules\\dbeaver-connections-mcp\\dist\\index.js"] instead. For every folder, put the same mcpServers entry in ~/.claude.json.
Then check with claude mcp get dbeaver as above.
GitHub 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-connections-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-connections-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 ( |
|
| Known host keys for SSH tunnels (see below) |
|
|
|
|
| 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); ClickHousessl/sslmode. They are read from the JDBC URL query string (?sslmode=verify-full), driver properties and the SSL tab, each overriding the one beforeDefault schema (bootstrap setting): the search path on PostgreSQL, the default database on MySQL,
CURRENT_SCHEMAon OracleClickHouse: the database, and HTTPS from the JDBC driver's
ssl/sslmode/sslrootcertproperties or the SSL tabSSH tunnel (SSH tab, or a network profile): host and port, password, private key file or saved key (with its passphrase), or SSH agent (
SSH_AUTH_SOCK; Pageant or the Windows OpenSSH agent), one jump server, and the "remote host/port" override. Each connection gets a local port on127.0.0.1forwarded through the SSH server, opened on first use and reopened if it drops. Host keys are checked against~/.ssh/known_hosts: a host listed with a different key, or with a key marked@revoked, is refused. An unlisted host is refused too (DBeaver would ask, this server cannot): connect once withsshto add it, setDBEAVER_MCP_SSH_ACCEPT_UNKNOWN_HOSTS=true, or set "Bypass host verification" in DBeaver to skip the check. Aknown_hoststhat exists but cannot be read is an error. TLS to the database is still checked against the real host name where the client library allows it (PostgreSQL, SQL Server, ClickHouse).
PostgreSQL-compatible servers use DBeaver's PostgreSQL driver entries (TimescaleDB, CockroachDB, YugabyteDB, Redshift, Greenplum, EDB...). Which one is behind a connection is read from version(), so a CockroachDB cluster opened with the plain PostgreSQL driver works too. TimescaleDB, CockroachDB and YugabyteDB are tested; Redshift is not (there is no Redshift to run in Docker): its catalog is PostgreSQL 8.0's, so the server leaves out what Redshift lacks (lock_timeout, partitions, identity columns, relation sizes, EXPLAIN ANALYZE). Google Cloud SQL connector connections are listed as unavailable.
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: SOCKS/HTTP proxies (those connections are listed as unavailable), more than one SSH jump server, keyboard-interactive SSH logins other than a saved password, and engines other than the ones 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.ClickHouse: table functions and functions that reach other servers, object stores or the server's files (
url,s3,remote,mysql,postgresql,file,executable...;readonly=1already refuses most of them),sleep,SET/USE/SYSTEM/KILL,INTO OUTFILE,system.named_collections(holds credentials). ASETTINGSclause in the query is refused by the server itself underreadonly=1, so the time limit cannot be lifted.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, fetching only the rows needed on Oracle, andmax_result_rowswithresult_overflow_mode=breakplus a streamed read on ClickHouse. 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
docker exec -i dbeaver-mcp-test-clickhouse-1 clickhouse-client --password clickhouse --multiquery < test/fixture.clickhouse.sql
docker exec -i dbeaver-mcp-test-timescale-1 psql -U postgres < test/fixture.sql
docker exec -i dbeaver-mcp-test-cockroach-1 ./cockroach sql --insecure -d defaultdb < test/fixture.cockroach.sql
docker exec -i dbeaver-mcp-test-yugabyte-1 bash -c 'bin/ysqlsh -h $(hostname) -U yugabyte' < test/fixture.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 TEST_CLICKHOUSE=localhost:18123 \
TEST_TIMESCALE=localhost:15433 TEST_COCKROACH=localhost:16257 TEST_YUGABYTE=localhost:15434 \
TEST_SSH=localhost:12222 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, and with TEST_SSH once more for each engine through the compose ssh service (an OpenSSH server that reaches the databases by their service names). src/integration.test.ts has the PostgreSQL-specific ones, and src/ssh.test.ts tests tunnels against in-process SSH servers (password, keys, jump server, known_hosts), so it needs no Docker.
Publishing:
npm login
npm publish # runs the tests firstLicense
MIT
Available Tools
7 toolsdescribe_tableDescribe a table or viewARead-only
Full structure of one table or view: columns (type, nullable, default, comment), primary/unique/foreign keys, tables referencing it, indexes, size, and the view definition.
Inputs: table (required), connection (required), schema.
explain_queryExplain a query planARead-only
Shows the execution plan of a query. analyze=true really runs it (still read-only and rolled back) and reports actual times (and buffers on PostgreSQL).
Inputs: sql (required), connection (required), params, analyze.
find_columnsFind columns by nameARead-only
Searches column names (and column comments) across all tables and views, e.g. to find every table that has a 'policy_id' column.
Inputs: pattern (required), connection (required), limit, schema.
list_connectionsList DBeaver connectionsARead-only
Lists the database connections configured in DBeaver that this server may use: name, engine and placeholder style, type (dev/test/prod), host, database, whether it can be used, and how read-only is enforced. Call this first.
Inputs: no named parameters.
list_schemasList schemasARead-only
Lists schemas in the connection's database with how many tables/views each has.
Inputs: connection (required), include_system.
list_tablesList tables and viewsARead-only
Lists tables, views and materialized views with estimated row counts and comments. Partitions are hidden (only the parent is shown). Filter matches table names and comments.
Inputs: connection (required), limit, filter, schema, +1 more.
run_queryRun a read-only queryARead-only
Runs one read statement (SELECT, WITH; also SHOW, VALUES, TABLE where the engine has them) in a transaction that is always rolled back. Returns at most 1000 rows (default 100); long values are shortened. Pass values with 'params' and placeholders instead of pasting them into the SQL: the connection's param_style from list_connections ($1, $2... on PostgreSQL; ? on MySQL, MariaDB and SQLite; @p1, @p2... on SQL Server; :1, :2... on Oracle; typed {p1:String}, {p2:UInt64}... on ClickHouse).
Inputs: sql (required), connection (required), params, max_rows.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct discovery step: connections → schemas → tables → single-table structure → column search → query execution → execution plan. The only pair that could be confused, run_query and explain_query, is clearly separated by the 'shows the plan' description. No two tools appear to do the same thing.
All seven tools follow a strict snake_case verb_noun convention (list_*, describe_table, find_columns, run_query, explain_query). The verbs also reflect real semantic differences (list vs describe vs find), so the pattern is both consistent and informative.
Seven tools is well-scoped for a read-only database inspection server; each covers a distinct layer of the exploration workflow. Nothing feels padded, and no obvious step of the workflow is forced into an overloaded mega-tool.
The read-only exploration lifecycle (connect → schema → table → column → query → plan) is fully covered, with a sensible rollback-only write policy. Minor gaps remain: no way to list routines/sequences/triggers, no cross-connection or cross-schema text search for DDL/object names, and no connection health check beyond the 'can be used' flag in list_connections.
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 gradedqualityDmaintenanceProvides 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.9 npm7MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely query and explore SQL Server and PostgreSQL databases with read-only access, supporting schema discovery, relationship exploration, and query execution.26 npm3MIT
- AlicenseBqualityDmaintenanceEnables 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.22258 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