Skip to content

Add execution plan analysis MCP tools to Dashboard and Lite#542

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/mcp-plan-tools
Mar 13, 2026
Merged

Add execution plan analysis MCP tools to Dashboard and Lite#542
erikdarlingdata merged 1 commit into
devfrom
feature/mcp-plan-tools

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Ports 5 plan analysis MCP tools from PerformanceStudio to both Dashboard and Lite
  • Tools: analyze_query_plan, analyze_procedure_plan, analyze_query_store_plan, analyze_plan_xml, get_plan_xml
  • Uses ShowPlanParser + PlanAnalyzer (31 anti-pattern rules) returning structured JSON with warnings, missing indexes, parameters, memory grants, and top operators
  • Dashboard fetches plans from SQL Server PerformanceMonitor database; Lite fetches from DuckDB cache with Query Store as on-demand SQL Server fallback

Test plan

  • Dashboard build succeeds (0 errors)
  • Lite build succeeds (0 errors)
  • Dashboard analyze_plan_xml with synthetic XML detects Serial Plan, Scan, missing index, parameter sniffing
  • Lite analyze_plan_xml with synthetic XML detects Scan With Predicate
  • Dashboard analyze_query_plan end-to-end against SQL2022 real query (15 warnings detected)
  • MCP instructions updated for both apps with tool reference table and workflow step

🤖 Generated with Claude Code

Ports the 5 plan analysis tools from PerformanceStudio to both apps:
- analyze_query_plan: Analyze cached plan by query_hash
- analyze_procedure_plan: Analyze procedure plan by sql_handle/plan_handle
- analyze_query_store_plan: Analyze Query Store plan (fetched on-demand from SQL Server)
- analyze_plan_xml: Analyze raw showplan XML directly
- get_plan_xml: Retrieve raw showplan XML by query_hash

Uses ShowPlanParser + PlanAnalyzer (31 anti-pattern rules) to return
structured JSON with warnings, missing indexes, parameters, memory
grants, and top operators.

Dashboard fetches plans from SQL Server PerformanceMonitor database.
Lite fetches from DuckDB cache, with Query Store as on-demand SQL
Server fallback.

Tested end-to-end on both apps against SQL2022.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit c8e1738 into dev Mar 13, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/mcp-plan-tools branch April 9, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant