Azure SQL MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| AZURE_CLIENT_ID | No | Client ID for service-principal auth | |
| AZURE_TENANT_ID | No | Tenant ID for service-principal auth | |
| AZURE_SQL_SERVER | Yes | Azure SQL logical server host (required) | |
| AZURE_SQL_PROFILE | No | Enforced named workflow profile (triage, optimizer, sandbox, enforcer-review, enforcer-apply) | |
| AZURE_SQL_PASSWORD | No | SQL authentication password | |
| AZURE_SQL_USERNAME | No | SQL authentication username | |
| AZURE_CLIENT_SECRET | No | Client secret for service-principal auth | |
| AZURE_SQL_AUTH_MODE | No | Authentication mode: entra-default, service-principal, interactive, or sql-password | entra-default |
| AZURE_SQL_ROW_LIMIT | No | Maximum returned rows for bounded query paths | 200 |
| AZURE_SQL_TRANSPORT | No | stdio, sse, or streamable-http | stdio |
| AZURE_SQL_ACCESS_MODE | No | restricted or unrestricted | restricted |
| AZURE_SQL_TOOL_GROUPS | No | Tool groups: core, performance, schema, admin, or all | all |
| AZURE_SQL_WRITE_POLICY | No | disabled, review, or apply | disabled when restricted, else review |
| AZURE_SQL_DEFAULT_DATABASE | Yes | Default database for omitted tool arguments (required) | |
| AZURE_SQL_MCP_BEARER_TOKEN | No | Bearer token for SSE/HTTP (required for remote transports) | |
| AZURE_SQL_ALLOWED_DATABASES | Yes | Comma-separated database allowlist (required) | |
| AZURE_SQL_DATABASE_POLICY_FILE | No | Path to local database policy JSON file | |
| AZURE_SQL_PERFORMANCE_STATE_DIR | No | Protected durable workflow state directory | ~/.azure-sql-mcp/state |
| AZURE_SQL_QUERY_TIMEOUT_SECONDS | No | Per-query timeout | 30 |
| AZURE_SQL_PERSIST_VIEW_SQL_STATE | No | Explicitly permit exact view SQL in state store for sandbox apply/rollback | false |
| AZURE_SQL_PLAN_APPLY_KILL_SWITCH | No | Blocks prepared plan apply when true | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| check_runtime_statusA | Return DB-free runtime identity, registered-tool capabilities, and contract fingerprints for this MCP server process. |
| list_databasesA | List the configured Azure SQL databases available to this MCP server. |
| check_capabilitiesA | Probe Azure SQL capabilities and permission-sensitive features for a database. |
| list_schemasA | List schemas in the selected Azure SQL database. |
| list_objectsA | List objects in a schema. Supports table, view, procedure, function, and index. |
| search_objectsA | Search for database objects by name pattern across all schemas. |
| get_object_detailsB | Show detailed information about a schema object. |
| get_dependenciesA | Get dependency graph for a database object: what it references and what references it. |
| get_table_statsA | Get approximate row counts and storage sizes for tables. |
| capture_schema_snapshotA | Capture a point-in-time schema snapshot for a database. |
| compare_schemasA | Compare schemas between two databases and return all differences. |
| generate_migration_scriptA | Generate a T-SQL migration script to transform source schema to match target. |
| get_active_sessionsA | List active sessions and running queries, including blocking information. |
| execute_sqlA | Execute statically validated, row-capped read-only SQL. The query may be preceded by DECLARE @var and SET @var = ... statements, followed by exactly one SELECT. DML, DDL, dynamic SQL, and stored procedure execution are always rejected. |
| explain_queryA | Generate an estimated or actual execution plan for a read-only SQL query. |
| tune_queryA | Compatibility initializer only: open a performance case/session and collect evidence. It does not generate or benchmark a rewrite and must not be treated as a completed optimization. Named optimizer profiles use the explicit case/session workflow instead. |
| benchmark_query_rewriteA | Benchmark a baseline query against a proposed rewrite using the same typed read-only execution path, interleaved actual-plan samples, and complete bounded snapshot equivalence. |
| check_equivalence_preflightA | Analyze direct SQL and recursively resolved view definitions for semantic-equivalence proof risks without returning raw definitions. |
| start_performance_caseC | Create a durable, redacted performance case. SQL is fingerprinted and is not written to the MCP state database. |
| collect_performance_evidenceA | Collect Azure SQL resource, Query Store, wait, blocking, statistics, parameter-sensitivity, and regression evidence for a performance case. |
| get_performance_caseA | Get a redacted performance case, its evidence envelopes, and event history. |
| start_tuning_sessionB | Start a durable iterative tuning session. Defaults are 10 candidates, 80 executions, and 20 minutes; explicit multi-hour budgets are accepted when the local database policy permits them. |
| get_tuning_sessionA | Resume a durable tuning session with its complete redacted leaderboard, evidence, events, and remaining budgets. Raw SQL is never persisted. |
| add_tuning_candidateB | Add one concrete rewrite or index experiment to a tuning session. Only its fingerprint and optional artifact reference are persisted. |
| benchmark_tuning_candidateA | Benchmark one rewrite candidate with interleaved, exactly-once samples and snapshot-consistent duplicate-aware result comparison. |
| benchmark_index_candidateA | Benchmark a leased disposable index in a policy-allowlisted sandbox. Cleanup is automatic and cleanup failures are durable. |
| finalize_tuning_sessionB | Finalize a tuning session with the winning candidate, complete leaderboard, rejected experiments, and explicit stopping reason. |
| compare_query_resultsA | Compare two read-only query results in one snapshot. The result is proven only when the complete bounded results, duplicates, shape, and required order match. |
| compare_plan_summariesA | Compare arbitrary redacted execution-plan summaries and sourced metrics. |
| prepare_view_changeA | Prepare and preview a reversible CREATE VIEW or ALTER VIEW change. Optimizer preparations are process-local previews; sandbox preparations become restart-safe only with explicit raw-SQL state opt-in. |
| get_top_queriesB | List top queries from Query Store. |
| analyze_query_indexesA | Extract SQL Server missing-index hints from estimated plans for up to 10 queries. A per-query missing_index_count of zero means no Showplan hint was emitted for that plan. The filtered recommendations can also be empty when an existing index already covers an emitted hint; neither condition proves that no index could improve the query. |
| analyze_workload_indexesA | Analyze the database workload to identify resource-intensive queries and recommend optimal indexes. |
| analyze_index_recommendationsA | Analyze missing-index and automatic tuning recommendations. |
| optimize_indexesA | Run the index optimization engine: analyzes workload from Query Store, generates index candidates from execution plans and DMVs, estimates sizes, scores using Pareto optimization (read benefit vs size vs write overhead), and returns budget-constrained ranked recommendations. |
| get_wait_statsA | Get top wait statistics from sys.dm_db_wait_stats with category mapping (CPU, I/O, Lock, Memory, Network, etc.), benign wait filtering, and root-cause recommendations. |
| get_query_wait_statsA | Get per-query wait breakdown from Query Store wait stats. Ties waits to specific queries: 'this query is slow because of X'. |
| get_currently_waiting_tasksA | Get currently waiting tasks right now — real-time view of what is blocked from sys.dm_os_waiting_tasks with SQL text and wait category. |
| get_lock_detailsA | Get current lock details from sys.dm_tran_locks with owning session, lock mode (S, X, IX, IS, U, Sch-M), resource type, and SQL text. |
| get_open_transactionsA | Get open transactions with duration, type (read/write, read-only), log bytes used, and warnings for long-running or idle-in-transaction. |
| get_deadlock_historyA | Get recent deadlock history from system_health extended events session. Parses deadlock XML to show victim, participants, resources, and SQL text. |
| get_tempdb_usageA | Get per-session tempdb consumption: user/internal object allocations and net usage in MB. |
| get_tempdb_space_breakdownA | Get tempdb space breakdown: version store, user objects, internal objects, free space. Useful for diagnosing version store bloat under snapshot isolation. |
| get_memory_grantsA | Get active and pending memory grants. Identifies queries waiting for memory (RESOURCE_SEMAPHORE) and queries likely spilling to tempdb. |
| get_connection_pool_statsA | Get MCP server connection pool statistics: per-database acquire/release/discard counts, peak utilization, and possible connection leaks. Diagnoses MCP-side slowness without touching the database. |
| get_io_statsA | Get per-file I/O stats: read/write latency, throughput, stall times. Warns when average latency exceeds 20ms threshold. |
| get_resource_limitsA | Get Azure resource governance limits: max CPU%, IOPS, log rate, memory, workers, and current service tier/objective. |
| get_resource_stats_historyA | Get resource utilization history (15-sec granularity) from sys.dm_db_resource_stats. Shows CPU, data I/O, log write, memory trends with sustained pressure warnings. |
| get_database_configurationA | Get Azure SQL database configuration inventory: version, read-only instance settings, database properties, scoped configurations, Query Store, automatic tuning, geo-replication links, and Azure DB properties. |
| get_storage_diagnosticsA | Get Azure SQL storage diagnostics: database/file size, log usage, VLF counts, last VLF status, and high-usage warnings. |
| get_connection_diagnosticsA | Get connection diagnostics: connection counts by client IP, session summary, and optional bounded input-buffer text for current database sessions. |
| get_top_cached_queriesA | Get top cached statements from sys.dm_exec_query_stats. Returns bounded text previews and plan-cache metrics without raw plan XML. |
| get_cached_routine_statsA | Get cached stored procedure and UDF execution statistics. Returns bounded routine metrics and missing-index flags without raw plan XML. |
| get_object_index_diagnosticsA | Get object and index diagnostics: write-heavy nonclustered indexes, read/write usage, buffer footprint, volatile stats, columnstore row groups, index lock waits, and resumable index rebuilds. |
| check_statistics_healthA | Check statistics health: stale stats, high modification counts, low sample rates. Flags stats needing UPDATE STATISTICS. |
| get_plan_cache_analysisA | Analyze plan cache: plan type distribution, single-use plan bloat, top plans by size. Detects ad-hoc query pollution. |
| get_query_compilation_statsA | Identify excessively recompiled queries from sys.dm_exec_query_stats. Flags queries where recompile ratio exceeds 50%. |
| detect_parameter_sniffingA | Detect parameter sniffing: queries with multiple plans where MAX(avg_duration) / MIN(avg_duration) exceeds threshold (default 10x). |
| detect_regressed_queriesA | Surface automatic tuning regression recommendations from sys.dm_db_tuning_recommendations with plan forcing scripts. |
| compare_query_plansA | Compare two query plans side-by-side: operators, duration, CPU, I/O. If plan IDs not specified, compares best vs worst plan by duration. |
| get_forced_plansB | List all forced plans with execution stats and staleness warnings. Identifies forced plans that haven't executed recently or have force failures. |
| get_query_parameter_bucketsA | Extract the compiled parameter values behind each Query Store plan for one query — the parameter buckets a tuning pass must test. Each distinct compiled set produced its own plan shape in production; pair with boundary/NULL/empty cases the history cannot show. |
| plan_health_reviewA | Review Query Store health, parameter sensitivity, regressions, forced-plan failures, and ranked force/unforce candidates. |
| plan_enforcer_tickA | Preview one plan-enforcement cycle. This tool is permanently read-only; use the prepared plan-action workflow for reviewed mutations. |
| review_plan_enforcementA | Review Query Store regressions and forced-plan health, then rank read-only candidate plan force/unforce actions. |
| dry_run_plan_actionB | Preview an exact reversible Query Store force/unforce action and record an audit entry without executing it. |
| prepare_plan_actionC | Capture exact Query Store control state and persist a reviewed, redacted plan-action intent. Automatic Tuning ownership is review-only. |
| analyze_db_healthA | Analyze operational Azure SQL database health. Query-performance triage belongs to collect_performance_evidence, which uses resource, Query Store, wait, blocking, statistics, parameter-sensitivity, and regression evidence. |
| record_decisionA | Record a redacted skill decision backed by scoped evidence. Learning is advisory and cannot change database activity. |
| review_decisionA | Review one decision using only MCP-created terminal-link evidence. |
| propose_lessonB | Propose an inactive lesson from reviewed decisions. |
| recall_lessonsC | Recall at most three fresh, active, scoped lessons. |
| list_learning_candidatesB | List deterministic lesson candidates for maintainer review. |
| create_handoffB | Create a durable, redacted cross-skill learning handoff. |
| get_handoffA | Read one scoped durable cross-skill learning handoff. |
| resolve_handoffA | Claim, resolve, reopen, or cancel a scoped learning handoff; successful resolutions can link a decision. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| analyze-slow-queries | Investigate slow-running queries using Query Store and execution plans. |
| review-index-health | Review index health: fragmentation, unused indexes, duplicates, and missing indexes. |
| explore-schema | Explore a database schema: tables, relationships, and key objects. |
| compare-schemas | Compare schemas between two databases to find differences. |
| troubleshoot-performance | Comprehensive performance troubleshooting: health, queries, indexes, and resources. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/akaalholdings/azure-sql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server