Dbmole MCP logo

Dbmole MCP

Manage PostgreSQL and MySQL connections, tunnels, TLS, schemas, and SQL through an agent-controlled MCP server.

Install Dbmole MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "dbmole-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "dbmole-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 9 tools correctly ().

Overview

dbmole-mcp manages PostgreSQL and MySQL connections through MCP, allowing an agent to add, edit, remove, test, and use named connections at runtime. It stores project connections in `.dbmole.json` and global connections in a user configuration file, re-reading both on every tool call for hot reload. SQL execution supports SSH tunnels, TLS, readonly sessions, positional parameters, timeouts, and bounded results. Reach for it when an agent needs database inspection or queries across local, remote, or bastion-accessed environments without changing client configuration.

Use cases

  • Add a readonly staging connection through an SSH bastion
  • Inspect database schemas and table metadata
  • Run parameterized PostgreSQL or MySQL queries
  • Compare project and global connection definitions
  • Test remote database latency and server versions

Key features

  • Runtime connection management
  • PostgreSQL and MySQL support
  • SSH tunnels with host-key verification
  • TLS with certificate and hostname verification
  • Readonly sessions and bounded query results
  • Hot-reloaded project and global stores

Tools9

What Dbmole MCP lets your agent do. Expand a tool for its parameters.

Verified live~1.6k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

What it can do

From the 9 tools this server returned when we ran it.

Runs commands · 1Can delete or modify data · 2Makes changes · 2Handles credentials · 4Read-only tools · 5
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age168 days
Maintainers1

Observed 2026-11-27 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 3d ago via OSV.dev · dbmole-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads292Package downloads in the last 30 days.
Last commit11d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed9Callable tools this server registers over MCP.

How Dbmole MCP works

What dbmole-mcp does

dbmole-mcp exposes PostgreSQL and MySQL databases to MCP-compatible agents. It supports multiple named connections and lets the agent manage those connections through MCP rather than requiring a server restart or manual client configuration change.

Connections can be stored at project scope in .dbmole.json or globally in ~/.config/dbmole/connections.json. A project entry takes precedence over a global entry with the same name. Credentials are not returned by connection-listing operations, which instead show details such as host, port, database, readonly status, source layer, and SSH usage.

How it works

The server communicates over stdio. It reloads the project and global connection files before each tool call, so edits made by an agent, a user, or another session apply to subsequent operations. When connection settings change, the previous pool is closed and a new one is created.

Project-file discovery starts at the server working directory and searches upward for .dbmole.json. Git worktrees without their own file can use the main checkout’s file. Project and global files are written atomically with mode 0600.

SSH access supports password, private-key, or agent authentication. Host keys can be checked through known_hosts or a pinned fingerprint. TLS includes certificate and hostname verification and can operate through an SSH tunnel.

Setup and configuration

Node.js 22 or newer is required. The server starts without connection settings; add connections later with add_connection or create the JSON files directly. Install it for a compatible MCP client with npx -y dbmole-mcp, or build and run the supplied Docker image.

For project-scoped connections, keep .dbmole.json out of version control because it may contain credentials. In Docker, mount the project at /work, persist the global store with a volume, and provide known_hosts, private keys, or an SSH agent socket when tunnel connections need them.

Tools and capabilities

  • list_connections reports resolved connections, shadowed names, invalid entries, and broken files.
  • add_connection, update_connection, and remove_connection manage project or global entries.
  • test_connection checks the complete path, including SSH tunneling, and reports server version and latency.
  • execute_sql runs one statement with PostgreSQL $1 or MySQL ? parameters. Results default to 100 rows, allow up to 1,000, and are capped at 40 KB.
  • list_databases returns database names and sizes while excluding PostgreSQL templates and MySQL system schemas.
  • list_tables finds tables, views, and materialized views with approximate row counts.
  • describe_table returns columns, primary keys, indexes, and foreign keys for qualified tables or views.

Limitations and notes

Readonly mode is enforced by the database session rather than only by the agent’s behavior. A broken project file prevents all project connections from loading, while a broken global store affects names not supplied by the project layer. Credentials entered through chat pass through the model context; production secrets should be written into the connection file directly.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Dbmole MCP

dbmole-mcp is an MCP server that connects AI agents to PostgreSQL and MySQL databases. Its main tools manage named connections, test connectivity, execute parameterized SQL, list databases and tables, and describe schema details. Connections can use SSH tunnels, TLS, readonly sessions, and project or global configuration files.

Install it with `npx -y dbmole-mcp` through your MCP client, using Node.js 22 or newer. Claude Code and Codex provide direct `mcp add` commands, while Cursor and VS Code provide installation links. Claude Desktop can use the latest `.mcpb` release or a stdio configuration entry.

Yes, dbmole-mcp works with Cursor through its MCP installation link or an equivalent stdio configuration using `npx -y dbmole-mcp`. After installation, connections can be added through the MCP tools rather than by editing the client configuration for each database.

It stores project connections in `.dbmole.json` and global connections in `~/.config/dbmole/connections.json`, with an optional custom global-store path. Project entries override same-name global entries, and both files are re-read on every tool call.

Yes, it can create SSH tunnels using password, private-key, or agent authentication. Host keys are checked against `known_hosts` or a pinned fingerprint, and TLS can be used through the tunnel. Docker users must mount the relevant SSH files or forward the agent socket.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDbmole MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/dbmole-mcp?style=directory)](https://allmcps.com/mcp/dbmole-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/dbmole-mcp"><img src="https://allmcps.com/api/badge/dbmole-mcp?style=directory" alt="Dbmole MCP on AllMCPs" /></a>