Skip to main content
Glama
Dmitriusan

mcp-db-analyzer

by Dmitriusan

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PGHOSTNoPostgreSQL host (alternative to DATABASE_URL)
PGPORTNoPostgreSQL port (alternative to DATABASE_URL)
PGUSERNoPostgreSQL user (alternative to DATABASE_URL)
DB_DRIVERNoDatabase driver: 'postgres', 'mysql', or 'sqlite'. Default is auto-detected from DATABASE_URL or 'postgres'.
MYSQL_HOSTNoMySQL host (alternative to DATABASE_URL)
MYSQL_PORTNoMySQL port (alternative to DATABASE_URL)
MYSQL_USERNoMySQL user (alternative to DATABASE_URL)
PGDATABASENoPostgreSQL database name (alternative to DATABASE_URL)
PGPASSWORDNoPostgreSQL password (alternative to DATABASE_URL)
DATABASE_URLNoDatabase connection URL. For PostgreSQL: postgresql://user:password@host:port/dbname. For MySQL: mysql://user:password@host:port/dbname. For SQLite: /path/to/database.db
MYSQL_DATABASENoMySQL database name (alternative to DATABASE_URL)
MYSQL_PASSWORDNoMySQL password (alternative to DATABASE_URL)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
inspect_schemaA

List all tables in a schema with row counts and sizes, or inspect a specific table's columns, types, constraints, and foreign keys.

analyze_indexesA

Analyze index usage statistics to find unused indexes wasting space and missing indexes causing slow sequential scans. Also detects unindexed foreign keys.

explain_queryA

Run EXPLAIN on a SQL query and return a formatted plan with cost estimates, node types, and optimization warnings. Optionally runs EXPLAIN ANALYZE for actual execution statistics (read-only queries only).

analyze_table_bloatC

Analyze table bloat by checking dead tuple ratios (PostgreSQL) or InnoDB fragmentation (MySQL), vacuum history, and table sizes.

suggest_missing_indexesA

Find tables with high sequential scan counts and zero index usage, cross-referenced with unused indexes wasting space. Provides actionable CREATE INDEX and DROP INDEX recommendations.

analyze_slow_queriesA

Find the slowest queries using pg_stat_statements (PostgreSQL) or performance_schema (MySQL). Shows execution times, call counts, and optimization recommendations. PostgreSQL requires the pg_stat_statements extension to be installed and listed in shared_preload_libraries — the tool returns setup instructions if the extension is missing. Not available for SQLite.

analyze_connectionsA

Analyze active database connections. Detects idle-in-transaction sessions and lock contention between sessions (PostgreSQL), long-running queries flagged at >30 seconds, and connection pool utilization. Idle-in-transaction and lock contention detection are not available on MySQL — use this tool's output to investigate PostgreSQL-specific blocking scenarios. Not available for SQLite.

analyze_table_relationshipsA

Analyze foreign key relationships between tables. Builds a dependency graph showing entity connectivity, orphan tables (no FKs), cascading delete chains (shown at full depth), hub entities (tables with 5+ FK connections), and circular FK dependencies. Useful for understanding schema design, planning migrations, and impact analysis.

analyze_vacuumA

Analyze PostgreSQL VACUUM maintenance status. Checks dead tuple ratios, vacuum staleness, autovacuum configuration, and identifies tables needing manual VACUUM. PostgreSQL only.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dmitriusan/mcp-db-analyzer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server