Dmitriusan/mcp-db-analyzer
MCP server for PostgreSQL, MySQL, and SQLite schema analysis, index optimization, and query plan inspection
[](https://www.npmjs.com/package/mcp-db-analyzer) [](https://opensource.org/licenses/MIT)
A Model Context Protocol (MCP) server that gives AI assistants deep visibility into your databases. It inspects schemas, detects index problems, analyzes table bloat/fragmentation, and explains query plans — so your AI can give you actionable database optimization advice instead of generic suggestions.
Supports PostgreSQL, MySQL, and SQLite.
There are dozens of database MCP servers — most are CRUD gateways (run queries, list tables). This tool analyzes your database: schema problems, missing indexes, bloated tables, slow queries, vacuum health.
Other analytical MCP servers (CrystalDBA, pg-dash, MCP-PostgreSQL-Ops) cover PostgreSQL only. MCP DB Analyzer is the only analytical MCP server that supports PostgreSQL, MySQL, and SQLite in a single npx install — no Python, no Go, no Docker.
--driver flagDATABASE_URLnpx mcp-db-analyzerOr install globally:
npm install -g mcp-db-analyzerSet the DATABASE_URL environment variable:
export DATABASE_URL="postgresql://user:password@localhost:5432/mydb"Or use individual PG variables: PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD.
Set DATABASE_URL with a MySQL connection string and pass --driver mysql:
export DATABASE_URL="mysql://user:password@localhost:3306/mydb"
mcp-db-analyzer --driver mysqlOr use individual MySQL variables: MYSQL_HOST, MYSQL_PORT, `
Loading reviews...