Skip to main content
Glama
Mhdd-24

@mhdd_24/dbeaver-mcp

by Mhdd-24

@mhdd_24/dbeaver-mcp

npm version GitHub

MCP server for PostgreSQL / DBeaver-style exploration and SQL from Cursor (or any MCP client). Same architecture as @mhdd_24/pgadmin-mcp.

Say "db status", "list databases", or "run this SQL on Dev" in chat — the assistant calls the matching tools.

Full documentation: docs/WIKI.md


Tools

Tool

Role

db_set_profile

Sticky session switch: dev | qa | default

db_status

Sticky + active profile, host, SELECT 1

db_list_databases

List databases on active (or one-shot) profile server

db_list_schemas

List user schemas

db_list_tables

List tables/views in a schema

db_describe_table

Column metadata

db_query

Run SQL (read-only by default)

Profiles (no connection details in chat)

  1. Put both Dev and QA credentials in mcp.json (DBEAVER_DEV_*, DBEAVER_QA_* — or reuse PG_DEV_* / PG_QA_*).

  2. Say dbprofile=qa or dbprofile=dev — the assistant calls db_set_profile.

  3. Later tools reuse that sticky profile until you switch or the MCP process restarts.

  4. Optional one-shot: pass profile: "qa" on a single tool without changing sticky.

  5. database still means the logical DB name on that server (e.g. transboard), not the env profile.


Related MCP server: pgEdge Postgres MCP Server

Safety

  • Read-only by default — only SELECT / WITH…SELECT / EXPLAIN / SHOW / VALUES

  • Set DBEAVER_ALLOW_WRITE=true (or PG_ALLOW_WRITE=true) to allow writes

  • DBEAVER_QUERY_MAX_ROWS / PG_MAX_ROWS caps returned rows; timeout via DBEAVER_STATEMENT_TIMEOUT_MS / PG_QUERY_TIMEOUT_MS


Install / run

npm i -g @mhdd_24/dbeaver-mcp
# or from source:
git clone https://github.com/Mhdd-24/DBeaver-MCP.git
cd DBeaver-MCP
npm install
npm run build
node dist/index.js

Cursor mcp.json

"dbeaver": {
  "command": "npx",
  "args": ["-y", "@mhdd_24/dbeaver-mcp"],
  "env": {
    "DBEAVER_PROFILE": "dev",
    "DBEAVER_DEV_HOST": "192.168.1.141",
    "DBEAVER_DEV_PORT": "5432",
    "DBEAVER_DEV_USER": "postgres",
    "DBEAVER_DEV_PASSWORD": "YOUR_PASSWORD",
    "DBEAVER_DEV_DATABASE": "postgres",
    "DBEAVER_QA_HOST": "192.168.1.131",
    "DBEAVER_QA_PORT": "5432",
    "DBEAVER_QA_USER": "postgres",
    "DBEAVER_QA_PASSWORD": "YOUR_PASSWORD",
    "DBEAVER_QA_DATABASE": "postgres",
    "DBEAVER_ALLOW_WRITE": "false",
    "DBEAVER_QUERY_MAX_ROWS": "500"
  }
}

Restart Cursor after saving.


Example prompts

  • dbprofile=qa

  • dbprofile=dev

  • db status

  • list databases

  • list tables in schema transc for database transboard

  • describe table translations schema transc database transboard

  • run: SELECT version();

Available Tools

7 tools
db_describe_tableA

Describe columns for a table or view. Optional schema, database, and/or profile override.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYesTable or view name
schemaNoSchema name (default: public)
profileNoConnection profile: "dev" | "qa" | "default". Uses credentials from mcp.json (DBEAVER_DEV_* / DBEAVER_QA_* or PG_DEV_* / PG_QA_*). Omit to use the sticky session profile from db_set_profile / DBEAVER_PROFILE.
databaseNoOptional database name override

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations and no mention of read-only nature, side effects, or error behavior. With no annotations, the description carries full burden but is silent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single concise sentence that fronts the purpose before optionality. No fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema or description of returned column details (names, types, etc.). Also lacks guidance on when to prefer this over listing tables or querying.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers all 4 parameters at 100% coverage. Descriptions add some details (e.g., default for schema, profile credential reference), but tool-level description adds little beyond repeating optionality.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb 'Describe' with specific object (columns) and resource (table/view). Scope is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies use for column information, but does not explicitly differentiate from sibling tools like db_list_tables or db_query.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

db_list_databasesA

List databases on the active profile server (or optional one-shot profile=dev|qa).

ParametersJSON Schema
NameRequiredDescriptionDefault
profileNoConnection profile: "dev" | "qa" | "default". Uses credentials from mcp.json (DBEAVER_DEV_* / DBEAVER_QA_* or PG_DEV_* / PG_QA_*). Omit to use the sticky session profile from db_set_profile / DBEAVER_PROFILE.

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It does disclose one important behavior — the distinction between the sticky-session profile and the one-shot profile override — but it says nothing about the return shape, error behavior when no profile is available, or the read-only nature of the call beyond what the name implies.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with the core action front-loaded ('List databases') followed by the scoping qualifier and optional variant. No filler, no redundancy, and the structure does everything needed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 1-parameter, 0-required tool with full schema coverage, the description is largely complete. The only meaningful gap is that, with no output schema and no annotations, an agent must assume the return format is a list of database names — but that is easily inferable from the tool name.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameter is already fully documented in the schema (env-var fallbacks, 'default' value, sticky session behavior). The description adds marginal value by labeling the profile argument as 'one-shot', but does not add meaning beyond—the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb+resource combination ('List databases') and a precise scope qualifier ('on the active profile server'), which clearly distinguishes it from sibling enumeration tools db_list_schemas and db_list_tables. An agent can immediately grasp both what it does and that it operates at a different hierarchy level than its siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied via 'active profile' pointing back to db_set_profile's sticky session and the optional one-shot profile branch, so an agent can infer when this applies. However, there is no explicit guidance about when to use it versus alternatives, when a profile is necessary, or no exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

db_list_schemasA

List non-system schemas. Optional database and/or profile (dev|qa) override.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileNoConnection profile: "dev" | "qa" | "default". Uses credentials from mcp.json (DBEAVER_DEV_* / DBEAVER_QA_* or PG_DEV_* / PG_QA_*). Omit to use the sticky session profile from db_set_profile / DBEAVER_PROFILE.
databaseNoOptional database name override

TDQS

A4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It does not disclose whether the operation is read-only, has side effects, or depends on authentication/profile state. The read-only nature of a list operation is implied but not stated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, using two short clauses to convey purpose and parameter scope. Every word adds value, and it avoids unnecessary detail or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and absence of an output schema, the description is sufficiently complete for an agent to invoke it correctly. It could mention error conditions or default behavior more explicitly, but the context from sibling tools and parameter descriptions fills most gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides detailed descriptions for both parameters, including profile credential specifics and sticky-session behavior. The description adds a minor hint about the dev|qa override, slightly reinforcing but not significantly expanding on the schema information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and the target resource ('non-system schemas'). It distinguishes from sibling tools by focusing on schemas rather than databases or tables, and the optional override notes provide additional scoping.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (to list schemas) and includes parameter guidance (optional database/profile override). It does not explicitly mention when not to use it, but the sibling tool names implicitly cover alternative listing operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

db_list_tablesA

List tables/views for a schema (default public). Optional database and/or profile override.

ParametersJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema name (default: public)
profileNoConnection profile: "dev" | "qa" | "default". Uses credentials from mcp.json (DBEAVER_DEV_* / DBEAVER_QA_* or PG_DEV_* / PG_QA_*). Omit to use the sticky session profile from db_set_profile / DBEAVER_PROFILE.
databaseNoOptional database name override

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden. The verb 'list' implies a read-only operation with no side effects, which is transparently stated. It does not mention any destructive or modifying behavior, aligning with the expected safe nature of the tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that conveys all necessary information without redundancy or unnecessary detail. It is well-structured and front-loaded with the primary purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete in the context of this simple listing operation. No output schema is required, and there is no missing information that would prevent the agent from correctly invoking the tool. The optional overrides and defaults are clearly stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All three parameters have descriptive text in the schema, achieving 100% coverage. The 'profile' parameter explicitly explains possible values and the default behavior, and 'schema' and 'database' are self-explanatory. No additional explanation is needed beyond what is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (list), the resource (tables/views), and the scope (schema with default public). It also distinguishes itself from sibling tools like db_list_schemas and db_describe_table by focusing on tables/views.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides useful usage context by noting optional overrides and defaults (schema, database, profile). While it doesn't explicitly contrast with siblings, the purpose is self-evident from the name and description, making the intended use case clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

db_queryA

Run SQL against the sticky session profile (or optional profile=dev|qa for one call). Read-only by default. Optional database name and maxRows. Do not ask the user for connection host/password — use profiles.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL statement to execute
maxRowsNoMax rows to return (default from DBEAVER_QUERY_MAX_ROWS / PG_MAX_ROWS)
profileNoConnection profile: "dev" | "qa" | "default". Uses credentials from mcp.json (DBEAVER_DEV_* / DBEAVER_QA_* or PG_DEV_* / PG_QA_*). Omit to use the sticky session profile from db_set_profile / DBEAVER_PROFILE.
databaseNoOptional database name override

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses 'read-only by default' and profile-based connection handling, which are important behavioral traits. Since no annotations are provided, the description carries the burden; it covers key behavior but not full error or return behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, covering purpose, behavior, and constraints in a few sentences with no redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description does not explicitly mention return format or error behavior. For a query tool the result set is implied, but missing explicit output description lowers completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all parameters. The description adds valuable context about the sticky session profile and instructs not to ask for credentials, enhancing parameter understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action (Run SQL) against a profile, clearly distinguishing it from sibling metadata/list/set tools. The description makes it obvious this is the querying tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear guidance to use profiles instead of asking for credentials and explains the profile override mechanism. It does not explicitly contrast with sibling metadata tools, but the context implies when arbitrary SQL is needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

db_set_profileA

Set the sticky session connection profile to "dev" or "qa" (or "default"). Call when the user says dbprofile=dev, dbprofile=qa, use Dev DB, switch to QA, etc. Later tools reuse this profile automatically — no host/password in chat. Credentials are loaded from DBEAVER_DEV_* / DBEAVER_QA_* (or PG_DEV_* / PG_QA_*) in mcp.json.

ParametersJSON Schema
NameRequiredDescriptionDefault
verifyNoIf true (default), run SELECT 1 against the new profile
profileYesTarget profile: "dev" | "qa" | "default" (aliases: development, uat)

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and does so well. It discloses the persistent session side effect ('Later tools reuse this profile automatically'), the security-relevant fact that no host/password appears in chat, the credential source environment variables, and the default verification behavior via the schema's verify parameter.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences with no filler. The core action is front-loaded, trigger phrases come second, and the most important behavioral context (persistence, credentials, no secrets in chat) follows. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple setter tool with two parameters and full schema coverage, the description is complete: it explains when to invoke, what the profile affects, how credentials are resolved, and the sticky-session behavior. No output schema exists, but this kind of state-setting tool does not require detailed return-value documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters and their aliases. The description adds useful context about credential loading and the automatic reuse behavior, but it does not add much meaning beyond what the schema already states for the parameters themselves.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Set the sticky session connection profile') and the exact accepted values ('dev', 'qa', 'default'). It also gives concrete trigger phrases, making the tool's purpose unambiguous and easily distinguishable from sibling read/query tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly tells the agent when to call the tool ('Call when the user says dbprofile=dev, dbprofile=qa, use Dev DB, switch to QA, etc.') and explains the sticky-session benefit for later tools. It does not explicitly mention when not to use it or name alternative tools, so it stops short of a perfect 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

db_statusA

Show current sticky PostgreSQL profile, host, database, write mode, and a live SELECT 1 health check. Optional profile arg for a one-shot check without changing the sticky session.

ParametersJSON Schema
NameRequiredDescriptionDefault
profileNoConnection profile: "dev" | "qa" | "default". Uses credentials from mcp.json (DBEAVER_DEV_* / DBEAVER_QA_* or PG_DEV_* / PG_QA_*). Omit to use the sticky session profile from db_set_profile / DBEAVER_PROFILE.
databaseNoOptional database override for the health check

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that a live SELECT 1 is performed (not just cached info) and clarifies that providing a profile does not alter the sticky session. This gives full transparency about side effects and behavior, especially given no annotations are present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, using two short sentences to convey purpose, optional argument, and side-effect behavior. No unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description explicitly lists the output content (profile, host, database, write mode, health check result), making it clear what the tool returns even without an output schema. The context is complete for a status/health check tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Both parameters are fully described in the schema with clear meanings: profile for connection profile (with sticky session context) and database as an optional override. The descriptions are sufficient and match the schema coverage of 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to show current sticky PostgreSQL profile, host, database, write mode, and perform a live SELECT 1 health check. It is specific and distinguishes itself from sibling tools like db_query or db_list_databases.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains the optional profile argument for a one-shot check without changing the sticky session, implying usage for verifying current state. However, it does not explicitly state when to prefer this over alternatives, though the context is clear from sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 7 tool updatesv1.0.0
    • First observeddb_describe_table
    • First observeddb_list_databases
    • First observeddb_list_schemas
    • First observeddb_list_tables
    • First observeddb_query
    • First observeddb_set_profile
    • First observeddb_status

TDQS

A4.2/5.0

Scored across 7 tools

Disambiguation5/5

Each tool has a distinct purpose: profile management, status checking, listing databases/schemas/tables, describing tables, and running queries. No overlap or ambiguity between them.

Naming Consistency5/5

All tools follow a consistent 'db_' prefix with clear verb_noun naming (set_profile, list_databases, describe_table, etc.). Even the single-word tools like db_status and db_query are clear and fit the pattern.

Tool Count5/5

Seven tools is well within the ideal range for a database exploration server. Each tool provides a necessary function without redundancy, making the set feel intentionally scoped.

Completeness4/5

The toolset covers the core read-only workflow: setting profiles, checking status, exploring database structure, and querying. The only notable gap is the lack of write operations (insert/update/delete), but the read-only default suggests this is intentional, so it's a minor limitation.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with PostgreSQL databases through MCP, allowing users to explore database structures, inspect table schemas, and execute read-only SQL queries.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables SQL queries against PostgreSQL databases through MCP-compatible clients and includes a natural language agent for forming SQL queries from natural language.
    223
    PostgreSQL
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables interaction with PostgreSQL databases through MCP, supporting queries, DDL, DML, and schema inspection.
    6
    MIT