snss10 avatar

DBeast PostgreSQL MCP

snss10/dbeast

If you need your AI assistant to inspect, tune, or audit PostgreSQL without handing it a raw SQL execute function, this gives you 21 scoped tools instead. It connects via asyncpg and breaks down DBA work into safe operations like schema discovery with optional Mermaid ERDs, read-only query execution with automatic limits, impact analysis that previews destructive SQL without running it, performance reviews from pg_stat_statements, security audits of roles and privileges, maintenance reports on vacuums and dead tuples, replication lag monitoring, and data quality checks. Works with local Postgres, RDS, Supabase, Neon, or any standard host. You configure it once with a DATABASE_URL in your MCP client settings, and your assistant gets structured access to production database intelligence without the usual escape hatch risks.

GitHub stars
9
tools
21
auth
Secret needed
transport
STDIO
env vars
8
last updated
Jun 10, 2026

Tools

21 tools

Public tool metadata for what this MCP can expose to an agent.

connectConnect to PostgreSQL, check current status, or discover local databases

Connect to PostgreSQL, check current status, or discover local databases

No parameter schema in public metadata yet.

disconnectClose the current database connection

Close the current database connection

No parameter schema in public metadata yet.

health_checkVerify connectivity, pool health, PostgreSQL version, and extensions

Verify connectivity, pool health, PostgreSQL version, and extensions

No parameter schema in public metadata yet.

get_schemaList schemas, tables, columns, indexes, relationships, and optional Mermaid ERDs

List schemas, tables, columns, indexes, relationships, and optional Mermaid ERDs

No parameter schema in public metadata yet.

dependency_analysisMap object dependencies before renaming, dropping, or changing database objects

Map object dependencies before renaming, dropping, or changing database objects

No parameter schema in public metadata yet.

execute_queryRun read-only SELECT queries with automatic row-limit injection

Run read-only SELECT queries with automatic row-limit injection

No parameter schema in public metadata yet.

analyze_queryParse and inspect query structure, warnings, and optimization hints

Parse and inspect query structure, warnings, and optimization hints

No parameter schema in public metadata yet.

query_optimizerRecommend indexes and rewrites for a given query

Recommend indexes and rewrites for a given query

No parameter schema in public metadata yet.

analyze_impactPreview write-query impact, risk level, affected rows, and rollback context without executing

Preview write-query impact, risk level, affected rows, and rollback context without executing

No parameter schema in public metadata yet.

database_healthReview cache hit rates, connections, transaction age, table health, and overall health signals

Review cache hit rates, connections, transaction age, table health, and overall health signals

No parameter schema in public metadata yet.

query_performanceReport slow or expensive queries from PostgreSQL statistics

Report slow or expensive queries from PostgreSQL statistics

No parameter schema in public metadata yet.

security_auditInspect roles, privileges, superuser accounts, and public schema exposure

Inspect roles, privileges, superuser accounts, and public schema exposure

No parameter schema in public metadata yet.

sensitive_data_scanDetect likely PII or secrets by column names and schema patterns

Detect likely PII or secrets by column names and schema patterns

No parameter schema in public metadata yet.

maintenance_analysisReview vacuum status, dead tuples, analyze timestamps, and index health

Review vacuum status, dead tuples, analyze timestamps, and index health

No parameter schema in public metadata yet.

partition_analysisInspect partition health, row distribution, and missing partition risks

Inspect partition health, row distribution, and missing partition risks

No parameter schema in public metadata yet.

data_quality_reportAnalyze null rates, cardinality, value distributions, and outliers

Analyze null rates, cardinality, value distributions, and outliers

No parameter schema in public metadata yet.

duplicate_detectionFind duplicate rows across selected key columns

Find duplicate rows across selected key columns

No parameter schema in public metadata yet.

configuration_reviewReview PostgreSQL configuration and tuning opportunities

Review PostgreSQL configuration and tuning opportunities

No parameter schema in public metadata yet.

replication_statusInspect replication lag, WAL sender/receiver state, and replication slots

Inspect replication lag, WAL sender/receiver state, and replication slots

No parameter schema in public metadata yet.

get_audit_logsRetrieve logged MCP tool calls for a given date

Retrieve logged MCP tool calls for a given date

No parameter schema in public metadata yet.

list_audit_filesList available audit log files

List available audit log files

No parameter schema in public metadata yet.

Sponsors

Configuration

DATABASE_URLsecret

PostgreSQL connection URL, for example postgresql://user:password@host:5432/database.

DB_HOST

PostgreSQL host when DATABASE_URL is not used.

DB_PORT

PostgreSQL port when DATABASE_URL is not used.

DB_USER

PostgreSQL user when DATABASE_URL is not used.

DB_PASSWORDsecret

PostgreSQL password when DATABASE_URL is not used.

DB_NAME

PostgreSQL database name when DATABASE_URL is not used.

AWS_SECRET_NAME

AWS Secrets Manager secret containing PostgreSQL credentials.

AWS_REGION

AWS region for Secrets Manager lookup.

Readme

DBeast

A PostgreSQL MCP server that gives AI assistants expert DBA capabilities.

Python 3.11+ PostgreSQL 12+ MCP Compatible License: MIT

Quick Start · Demo · Tools · Safety · Configuration · Docs


DBeast connects AI assistants such as Claude, Cursor, Windsurf, and VS Code Copilot to PostgreSQL through the Model Context Protocol. Instead of exposing one broad execute_sql escape hatch, DBeast provides 21 focused tools for schema discovery, safe query execution, impact analysis, performance review, security checks, maintenance reporting, replication monitoring, and data quality inspection.


Demo


View the full README on GitHub

Details

Repository
github.com/snss10/dbeast
Categories
Databases, Security & Pentesting
Package
ghcr.io/snss10/dbeast:2.0.2
Transport
STDIO
Auth
Required
Registry
MCP registry, active

Related Databases MCP servers

View all
1mkpvishnu avatarTerminal Mcpmkpvishnu/terminal-mcpMCP server for interactive terminal sessions — SSH, REPLs, database CLIs, TUI apps7stars
2florentine-ai avatarMcpflorentine-ai/mcpMCP server for Florentine.ai - Natural language to MongoDB aggregations0stars
3letoribo avatarMcp Graphql Enhancedletoribo/mcp-graphql-enhancedGraphQL gateway for LLMs. Handles huge GitHub GraphQL & @neo4j/graphql schemas without crashing6stars
4cyanheads avatarFaostat Mcp Servercyanheads/faostat-mcp-serverUN FAOSTAT global food & agriculture statistics over a local SQLite mirror, via MCP.3stars
5madezmedia avatarAcmi Mcpmadezmedia/acmiPersistent agent memory via ACMI — Profile/Signals/Timeline. 16 tools on Upstash Redis.3stars
6nikitacometa avatarMnemon Mcpnikitacometa/mnemon-mcpPersistent layered memory for AI agents. SQLite FTS5, fact versioning, zero-cloud.3stars