MCP server for T-SQL debugging, providing session management, stepping, breakpoints, inspection, and tracing capabilities for SQL Server stored procedures and scripts
Strong tool naming (verb-first, clear intent) and comprehensive descriptions (avg 180 chars, well above 10-char minimum). All 17 tools have descriptions and input schemas with typed parameters. However, output schemas are not explicitly documented in the source code provided, only inferred from descriptions. Parameter descriptions are present but some lack constraint details (e.g., 'line' in goto lacks range bounds). Error handling guidance is minimal; tools do not return actionable recovery hints. Security is well-designed (secrets via env vars, allowlist pattern), but no tool annotations (readOnlyHint/destructiveHint) are visible in the schema definitions.
Clear all breakpoints for one location (same location shape as set_breakpoints).
Run until the next breakpoint, a fault the exception filters stop on, a COMMIT (stopped once for confirmation), or completion. Returns the resulting stop state, including all output/result sets produced along the way.
End a debug session and tear it down. Rolls back the session transaction unless the session was opened with commitMode='commit' AND the target's allowWrites is true (DESIGN §24.1). Returns the final summary (return code, final state, committed?).
Evaluate a T-SQL expression or statement in the session (Debug Console / REPL, DESIGN §12.3), in the given frame (default: the top frame). Reads always work; writes are refused unless the session was opened with allowConsoleWrites=true AND the target allows writes. Returns the rendered result text.
Get the current call stack (frames, innermost first) with each frame's module, line, full statement span, and the statement about to execute.
Output schemas not documented. Tool descriptions infer return structure (e.g., 'Returns the rendered result text' for evaluate, 'Returns the new stop state' for step), but no explicit JSON Schema for response objects. LLMs cannot plan downstream tool calls without knowing what fields to extract.
Parameter constraints incomplete. 'line' in goto lacks range bounds (1-based, max line number?). 'page' in get_temp_rows defaults to 0 but no max specified. 'frameId' is integer but no validation range. Unbounded numeric parameters invite absurd LLM inputs.
No tool annotations visible. Schemas lack readOnlyHint, destructiveHint, or idempotentHint. LLMs cannot distinguish safe (get_state) from destructive (step, continue, goto) operations without explicit hints. This is a current MCP spec feature (2026-07-28).
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 61 | <=2025-11-25 | v2 |
Get the current stop state of a session (where execution is paused, the call stack, the active error and transaction state) without stepping.
Read one page of a temp table / table variable's rows. 'name' is the physical name shown by get_variables(scope='temp'); 'page' is the 0-based page index (tempTablePageSize rows).
Read a scope for a frame. scope: 'locals' (the frame's @variables), 'system' (@@TRANCOUNT / XACT_STATE / session options), 'temp' (temp tables & table variables with row counts), 'errorContext' (ERROR_NUMBER/MESSAGE/… inside a CATCH). frameId comes from a stop state's frame.id.
Move the cursor to a line WITHOUT executing the skipped statements (DESIGN §13). State does not change. Use to skip a COMMIT or jump past code. Returns the new stop state.
List all live debug sessions: id, server/database, mode, current line, idle age.
Set (replace) the breakpoints for one location. location.kind: 'script' (a line in the debugged script), 'procedure' (location.name = 'dbo.uspChild'), or 'file' (location.path). Each breakpoint may carry a T-SQL 'condition' (exact) and a 'hitCondition' (e.g. '>=5', '%3'). Returns each requested line's verified/mapped result.
Configure where 'continue' and traces stop on T-SQL errors (DESIGN §10.6): 'all' (stop at every fault site), 'caught' (stop on errors routed to a CATCH), 'unhandled' (default on).
Set a local @variable's value in a frame (DESIGN §8.3). value is a T-SQL literal, e.g. '42' or "N'FULL'". Returns the applied value.
Open a T-SQL debug session against an ALLOWLISTED server (default-deny: an unknown server is refused — DESIGN §24.1). Runs to the first statement and returns the entry stop state. mode='script' (default) debugs the given script text/path; mode='procedure' debugs a stored procedure with args. Writes roll back on end unless commitMode='commit' AND the target allows writes. A SQL-auth password must come from the TSQLDBG_SQL_PASSWORD env var, never a tool argument.
Execute one step and return the new stop state. granularity: 'over' (default) runs the current statement, stepping over any EXEC; 'in' steps into an eligible EXEC / dynamic SQL; 'out' runs until the current frame returns. Output and result sets produced by the step are included in the stop state.
Trace a stored procedure to completion and return a summary plus a JSONL trace-file path (one line per statement: the statement, changed variables, output, result sets, errors; the summary carries the OUTPUT parameters' final values). The recommended FIRST tool for investigating a procedure — cheap, one round trip. Rolls back unless commit-gated (DESIGN §24.1). stepMode 'over' (default) or 'into'.
Trace a T-SQL script (batches separated by GO) to completion and return a summary plus a JSONL trace-file path (one line per statement). The recommended FIRST tool for investigating a script. Rolls back unless commit-gated (DESIGN §24.1). stepMode 'over' (default) or 'into'.
Error handling lacks recovery guidance. Descriptions mention 'refused' (start_session) and 'rolls back' (end_session) but do not guide LLM on what to do next. No pattern like 'If server not found, call list_sessions() first' or 'Retryable: connection timeout.'
Parameter 'args' in start_session and trace_* tools is typed as 'object' with only a description. No nested schema visible. LLMs cannot validate required fields (server, database, mode, procedure/script) without explicit nested JSON Schema.