Berth logo

Berth

Query, inspect, modify, migrate, back up, and restore PostgreSQL, MySQL, and SQLite databases through MCP.

Install Berth

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

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "berth": {
      "command": "uvx",
      "args": [
        "berth-mcp"
      ],
      "env": {
        "BERTH_BACKUP_DIR": "YOUR_VALUE_HERE"
      }
    }
  }
}

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

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx berth-mcp

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Berth MCP server gives AI clients structured access to PostgreSQL, MySQL, and SQLite through a stdio MCP process. It supports database connections, queries, schema inspection, migrations, backups, and restores, with read-only operation enabled by default. Use it when an agent needs controlled database access and explicit safeguards around writes or destructive actions.

Use cases

  • Inspect database schemas and foreign-key relationships
  • Run bounded read queries against application databases
  • Generate migration SQL from live or target schemas
  • Create and restore database backups with controlled permissions

Key features

  • PostgreSQL, MySQL, and SQLite support
  • Read-only default safety mode
  • Schema inspection and query analysis
  • Dialect-aware migration generation
  • Database backup and restore tools
  • Path and confirmation safeguards

Tools13

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

Self-reported~144 tokens of context

Security & health

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

Not checked yetLast checked

We have not completed a health check for this listing yet.

0/96 checks healthy over the last 25d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · berth-mcp (PyPI)

Adoption & maintenance

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

Last commit6mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed13Callable tools this server registers over MCP.

How Berth works

What Berth MCP server does

Berth MCP server connects MCP-compatible AI clients to PostgreSQL, MySQL, and SQLite databases. It provides tools for opening database connections, running read and write SQL, inspecting schema metadata, reviewing relationships and storage use, analyzing queries, generating migration SQL, and handling database backups and restores.

The server is intended for database work performed through an AI assistant rather than for direct interactive use. It communicates over stdio and is launched by an MCP client. PostgreSQL includes activity inspection and native backup and restore support; SQLite and MySQL use their respective database inspection and command-line backup mechanisms.

How it works

A client first calls db_connect with a database connection string and receives a connection identifier for later operations. db_query runs SELECT statements and automatically adds a limit of 1,000 rows. db_execute handles INSERT, UPDATE, and DELETE statements subject to the active safety mode.

The default mode is read-only. Write mode must be explicitly enabled and permits selected data changes and CREATE operations while blocking destructive patterns such as DROP, TRUNCATE, ALTER DROP, and deletes without a WHERE clause. Admin mode permits broader operations, but destructive actions require a one-time confirmation token that expires after 60 seconds.

Setup and configuration

Install the package from PyPI with pip install berth-mcp, or use pipx install berth-mcp for an isolated installation. PostgreSQL and SQLite drivers are included. MySQL support requires the optional extra:

Terminal
pip install berth-mcp[mysql]

Start the process with berth. Claude Code can register it with claude mcp add berth -- berth. Claude Desktop requires an MCP server entry whose command is berth; installations inside a virtual environment can specify the executable's full path.

BERTH_BACKUP_DIR sets the directory allowed for backup and restore files. If it is not set, the current working directory is used. Backup and restore paths are checked to remain inside this directory.

Tools and capabilities

The Berth MCP server exposes tools for:

  • Checking service health and creating database connections.
  • Running bounded SELECT queries and safety-checked data modification statements.
  • Listing tables, views, indexes, columns, and foreign-key relationships.
  • Reporting database and table sizes.
  • Viewing active queries on PostgreSQL databases.
  • Running EXPLAIN ANALYZE for query investigation.
  • Comparing a live schema with target DDL or comparing two live databases to produce dialect-aware migration SQL.
  • Creating backups and restoring them with admin mode and confirmation.

Migration output can add tables, columns, indexes, and constraints. Changes that would drop tables or columns are emitted as commented warnings rather than executable destructive statements. SQLite-specific limitations and table-rebuild guidance are included when its DDL support does not cover an operation directly.

Limitations and notes

Write and admin access are opt-in; normal startup does not permit writes. Restore operations and destructive SQL need the appropriate mode and confirmation token. Active-query inspection is available only for PostgreSQL.

The server validates table names used for SQLite introspection, uses parameterized queries, masks passwords in connection-related output, and rejects backup paths outside the configured directory. It is not documented as a standalone database shell: an MCP client is expected to start and communicate with the process.

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 Berth

Berth is an MCP server that connects AI clients to PostgreSQL, MySQL, and SQLite databases. Its main tools connect to databases, run bounded queries and safety-checked writes, inspect schemas and relationships, generate migrations, analyze queries, and create or restore backups with required safeguards.

Install it with `pip install berth-mcp` or `pipx install berth-mcp`. PostgreSQL and SQLite support is included; MySQL requires `pip install berth-mcp[mysql]`. Start the MCP process with the `berth` command.

Yes, Berth works with both Claude Desktop and Claude Code. Register Claude Code with `claude mcp add berth -- berth`; in Claude Desktop, add `berth` as the server command in `claude_desktop_config.json`.

Berth starts in read-only mode, requires explicit write or admin access for broader operations, and uses short-lived confirmation tokens for destructive actions. It also blocks selected unsafe SQL patterns in write mode, including DROP, TRUNCATE, and deletes without a WHERE clause.

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 PreviewBerth AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/berth?style=directory)](https://allmcps.com/mcp/berth)
HTML Embed
<a href="https://allmcps.com/mcp/berth"><img src="https://allmcps.com/api/badge/berth?style=directory" alt="Berth on AllMCPs" /></a>