Zero-database-connection static SQL analysis, query optimization, and execution plan diagnostics MCP server.
pip install autodba-mcp Copy PIP instructions
AutoDBA MCP allows AI coding assistants (Claude Desktop, Cursor, Antigravity, Windsurf) to analyze SQL queries, eliminate performance anti-patterns, synthesize zero-downtime index migration DDL, and parse execution plans—without requiring database credentials, network access, or exposing proprietary data.
On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "autodba": { "command": "uvx", "args": ["autodba-mcp"] } } } Option 2: Cursor (~/.cursor/mcp.json or project .cursor/mcp.json) { "mcpServers": { "autodba": { "command": "uvx", "args": ["autodba-mcp"] } } } Option 3: Windsurf (~/.codeium/windsurf/mcp_config.json) { "mcpServers": { "autodba": { "command": "uvx", "args": ["autodba-mcp"] } } } Option 4: Antigravity / Gemini CLI (mcp_config.json) { "mcpServers": { "autodba": { "command": "uvx", "args": ["autodba-mcp"] } } } Option 5: Local Pip / Development # Run directly with uv uv run autodba-mcp # Or install via pip pip install autodba-mcp autodba-mcp 💡 Example Usage 1. Analyzing Non-SARGable Predicates Input:
SELECT l.LeadId, l.Email, l.CreatedDate FROM dbo.Leads l WHERE YEAR(l.CreatedDate) = 2026 Diagnostic Output:
# AutoDBA Query Analysis Report (TSQL) ## Overview - **Complexity Score**: **45/100** (🟡 Moderate) - **Tables Referenced**: `dbo.Leads` - **Issues Detected**: 1 ## Diagnostic Findings ### [NON_SARGABLE_FUNCTION] Index-Blocking Function on Column — 🔴 CRITICAL **Finding**: Predicate applies scalar function 'YEAR' to column 'CreatedDate', blocking index seek. ```sql YEAR(l.CreatedDate) = 2026 💡 Remediation: Rewrite predicate to isolate the column: e.g. col >= '2026-01-01' AND col < '2027-01-01'.
--- ### 2. Optimizing Query & Synthesizing Index DDL **Input:** ```sql SELECT LeadId FROM dbo.Leads l WHERE YEAR(l.CreatedDate) = 2026 AutoDBA Output:
# AutoDBA Query Optimization Report (TSQL) ## Summary - **Estimated Workload Improvement**: ~75% - **Engine**: Deterministic AST Transformation - **Semantic Verification**: ✅ Passed (All base relations and statement types preserved) - **Anti-patterns Eliminated**: `NON_SARGABLE_FUNCTION` ## Optimized SQL Query ```sql SELECT l.LeadId FROM dbo.Leads AS l WHERE l.CreatedDate >= '2026-01-01' AND l.CreatedDate < '2027-01-01' Recommended Zero-Downtime Index Migration -- Table: Leads | Rationale: Index supporting equality / range filters: CreatedDate CREATE NONCLUSTERED INDEX [IX_AutoDBA_Leads_CreatedDate] ON [dbo].[Leads] ([CreatedDate]) INCLUDE ([LeadId]) WITH (ONLINE = ON, DATA_COMPRESSION = PAGE); --- ## 🛡️ Security & Privacy Guarantees - **No Remote Calls by Default**: Static analysis and deterministic rewrites execute 100% locally on your machine. - **Zero Database Access**: AutoDBA never requires DB hostnames, ports, usernames, or passwords. - **Sanitized Inputs**: Strips non-printable control characters and enforces AST validation before processing. --- ## 🧪 Development & Testing ```bash # Clone the repository git clone https://github.com/jeffreyehogg/autodba-mcp.git cd autodba-mcp # Create virtual environment and install in editable mode uv venv --python 3.12 source .venv/bin/activate uv pip install -e ".[dev]" # Run test suite pytest # Code linting ruff check . 📄 License MIT License. See LICENSE for details.
database dba mcp model-context-protocol mysql performance postgres query-optimization sql sqlglot tsql
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.




