A Model Context Protocol server for SQL Server database administration, monitoring, and query execution. Provides tools for schema inspection, performance analysis, session management, transaction monitoring, lock detection, and index health assessment.
Strong foundation with 16 well-named tools following verb_noun convention (get_, list_, execute_, kill_). All tools have descriptions (avg ~180 chars, within 10-1024 baseline). Input schemas are present with typed parameters and descriptions. However, output schemas are not explicitly documented in the code, responses are wrapped in a generic ToolResult(success, data, error) with data as a JSON string. Parameter descriptions are solid but lack some constraint details (e.g., no explicit enum for sampleMode despite validation). Error handling returns structured ToolResult but lacks recovery guidance. No tool annotations (readOnlyHint, destructiveHint) visible despite clear risk levels (READ_ONLY, WRITE, DESTRUCTIVE). Missing pagination guidance for list tools.
Execute an arbitrary T-SQL statement and return results as JSON. SELECT statements return an array of row objects. DML/DDL statements return [{"rowsAffected": N}].
Execute a query and return both the results and the actual runtime XML execution plan. Uses SET STATISTICS XML ON. The query is fully executed — use get_estimated_plan if you want a safe read-only plan analysis. The plan reflects true row counts and operator costs from the actual run.
Show the full blocking chain across all sessions: which sessions are blocked, by whom, and how deep the chain goes. Root blockers appear at depth 0. Each row includes a chain_path (e.g. '52 -> 67 -> 91'), wait type, wait time, and the SQL being run by each session. Returns zero rows if no blocking is occurring.
Return the estimated XML execution plan for a query without executing it. Uses SET SHOWPLAN_XML ON. The query is compiled but not run — no data is returned, no locks are taken. Use this to analyze query plans safely on production.
Return fragmentation percentage for indexes in a database. Each row includes a recommended_action: OK (< 5%), REORGANIZE (5–30%), or REBUILD (> 30%). Scope to a specific table to keep runtime short — scanning all indexes in a large database can be slow. Use sampleMode LIMITED (fastest) for routine checks, SAMPLED or DETAILED for accurate diagnosis.
Output schemas not documented. All tools return ToolResult(success, data, error) with data as JSON string. LLMs cannot infer response structure without explicit schema documentation.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) despite clear risk levels declared (READ_ONLY, WRITE, DESTRUCTIVE). Agents cannot determine safety without annotations.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 50 | <=2025-11-25 | v2 |
Show how often each index is used for seeks, scans, lookups, and updates since the last server restart. High update counts with zero reads indicate unused indexes that waste write overhead and should be considered for removal. Sorted by user_updates descending to surface the costliest unused indexes first.
List all current database locks with resource type, lock mode, request status, and the owning session's login, host, and current wait info. Optionally filter to a single database. Internal locks (session_id <= 0) are excluded.
Return the top missing indexes recommended by SQL Server's DMVs, ordered by estimated impact score. Each row includes the equality/inequality/included columns and a ready-to-run CREATE INDEX statement. Data accumulates since the last server restart and resets on restart or index changes.
List all open (uncommitted) transactions with age in seconds, owning session details, database, current SQL, and wait/blocking info. Sorted oldest-first so long-running transactions that risk log growth appear at the top. Use minAgeSeconds to focus on transactions that have been open suspiciously long.
List all currently executing requests with elapsed time, wait type, blocking session, CPU, logical reads, full SQL text, the specific statement being run, and the live query plan XML. Sorted by total elapsed time descending so the longest-running queries appear first.
Get comprehensive detail for a single session: login, host, program, isolation level, open transactions, CPU, memory, reads/writes, tempdb page usage, connection info, and the SQL currently being executed.
Get the full schema of a table: columns with types, nullability, defaults, and descriptions; primary key and unique constraints; and foreign key relationships.
List all locks currently held by a specific transaction, identified by its transaction_id. Use get_open_transactions first to find the transaction_id. Shows resource type, database, object name, lock mode, and status for every lock the transaction owns.
Kill a SQL Server session (SPID) or check its rollback progress. WARNING: Killing a session rolls back all of its open transactions and terminates its connection. Use withStatusOnly=true first to safely check rollback progress on a session already being killed.
List all online databases on the server with state, size, recovery model, and compatibility level.
List all tables in a database with estimated row counts and space usage. Requires VIEW DATABASE STATE permission.
sampleMode parameter has validation (LIMITED, SAMPLED, DETAILED) but no enum constraint in schema. Description mentions valid values but LLMs cannot parse this from text alone.
List tools (list_databases, list_tables) lack pagination parameters (limit, offset, page_size). No indication of result caps or how to handle large result sets.
Error responses return ToolResult.Fail(message) but lack recovery guidance. E.g., 'topN must be between 1 and 1000' does not suggest what to do next or why the constraint exists.