Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"berth": {
"args": [],
"command": "berth"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A secure berth for your data -- database access for AI tools.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
uvx 'berth-mcp' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked berth-mcp against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in data
Query and manage PostgreSQL databases directly from AI assistants
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Manage Supabase projects — databases, auth, storage, and edge functions
Real-time financial market data: stocks, forex, crypto, commodities, and economic indicators
MCP Security Weekly
Get CVE alerts and security updates for io.github.seayniclabs/berth and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A secure berth for your data -- database access for AI tools.
Berth is a Model Context Protocol server that gives AI assistants safe, structured access to PostgreSQL, SQLite, and MySQL databases. It exposes 13 tools for inspecting schemas, running queries, managing data, generating migrations, and performing backups -- all governed by a 3-tier safety model that prevents accidental damage.
Berth enforces three operating modes that control what SQL is permitted:
| Mode | Default | Allows | Blocks |
|---|---|---|---|
| read-only | Yes | SELECT, EXPLAIN | All writes |
| write | No | INSERT, UPDATE, DELETE, CREATE | DROP, TRUNCATE, ALTER DROP, DELETE without WHERE |
| admin | No | Everything | Destructive ops require a confirmation token (60s expiry) |
The server starts in read-only mode. Write and admin modes must be explicitly enabled. Destructive operations in admin mode generate a one-time confirmation token that expires after 60 seconds -- the AI must echo the token back to confirm intent.
| Tool | Description | Key Parameters |
|---|---|---|
health | Server health check | -- |
db_connect | Connect to a database | dsn (connection string) |
db_query | Execute a SELECT query (auto-adds LIMIT 1000) | connection_id, sql |
db_execute | Execute INSERT/UPDATE/DELETE (respects safety mode) | connection_id, sql, confirmation_token |
db_schema | List tables, views, and indexes | connection_id |
db_describe | Column details for a table | connection_id, table |
db_relationships | Foreign key relationships | connection_id, table (optional) |
db_size | Database and table sizes | connection_id |
db_active_queries | Currently running queries (PostgreSQL only) | connection_id |
db_explain | Run EXPLAIN ANALYZE on a query | connection_id, sql |
generate_migration | Generate migration SQL by comparing schemas | connection_id + target_sql, or from_connection + to_connection |
db_backup | Create a database backup | connection_id, output_path |
db_restore | Restore from backup (admin mode + confirmation token) | connection_id, input_path, confirmation_token |
The generate_migration tool compares two schemas and produces dialect-aware SQL to migrate from one to the other. Two modes of operation:
Mode 1 — Live database vs. target DDL:
Provide connection_id (an active connection) and target_sql (CREATE TABLE statements describing the desired schema). Berth introspects the live database and diffs it against the parsed target.
Mode 2 — Two live databases:
Provide from_connection and to_connection (two active connection IDs). Berth introspects both and generates the migration to transform the source into the target.
What it generates:
CREATE TABLE for new tablesALTER TABLE ADD COLUMN for new columnsALTER TABLE ALTER COLUMN / MODIFY COLUMN for type, nullability, and default changesCREATE INDEX / DROP INDEX for index changesADD CONSTRAINT / DROP CONSTRAINT for foreign key changesDROP TABLE and DROP COLUMN are commented out with warnings (safety first)Dialect handling:
ALTER COLUMN ... TYPE, SET/DROP NOT NULL, SET/DROP DEFAULTMODIFY COLUMN for all column changes, DROP INDEX ... ON tablepg_stat_activity, EXPLAIN ANALYZE, pg_dump/psql backup/restore