Skip to content

Commit 1bed5fa

Browse files
Rename to Performance Studio, add MCP docs and settings toggle (#7)
- Rename "SQL Performance Studio" to "Performance Studio" across all user-facing strings: title bar, about dialog, help menu, app name, macOS bundle, csproj product, MCP server name, docs - Add MCP section to README with setup instructions, tool reference, and example questions - Add MCP enable/port toggle to About screen (interim until dedicated settings UI) - Fix MCP endpoint URL from /mcp to / in docs and instructions - Fix MCP server name from sql-performance-studio to performance-studio Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 152e51b commit 1bed5fa

13 files changed

Lines changed: 122 additions & 34 deletions

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to SQL Performance Studio
1+
# Contributing to Performance Studio
22

3-
Thank you for your interest in contributing to SQL Performance Studio! This guide will help you get started.
3+
Thank you for your interest in contributing to Performance Studio! This guide will help you get started.
44

55
## Reporting Issues
66

README.md

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# SQL Performance Studio
1+
# Performance Studio
22

3-
A cross-platform SQL Server execution plan analyzer. Parses `.sqlplan` XML, identifies performance problems, suggests missing indexes, and provides actionable warnings — from the command line or a desktop GUI.
3+
A cross-platform SQL Server execution plan analyzer with built-in MCP server for AI-assisted analysis. Parses `.sqlplan` XML, identifies performance problems, suggests missing indexes, and provides actionable warnings — from the command line or a desktop GUI.
44

55
Built for developers and DBAs who want fast, automated plan analysis without clicking through SSMS.
66

@@ -139,7 +139,7 @@ planview analyze ./queries/ --server sql2022 --database StackOverflow2013 \
139139
```
140140

141141
Batch mode produces three files per query:
142-
- `query_name.sqlplan` — the raw execution plan XML (openable in SSMS or the SQL Performance Studio GUI)
142+
- `query_name.sqlplan` — the raw execution plan XML (openable in SSMS or the Performance Studio GUI)
143143
- `query_name.analysis.json` — structured analysis with warnings, missing indexes, and operator tree
144144
- `query_name.analysis.txt` — human-readable text report
145145

@@ -240,6 +240,7 @@ Features:
240240
- **Copy Repro Script** — extracts parameters, SET options, and query text into a runnable `sp_executesql` script
241241
- **Get Actual Plan** — connect to a server and re-execute the query to capture runtime stats
242242
- **Query Store Analysis** — connect to a server and analyze top queries by CPU, duration, or reads
243+
- **MCP Server** — built-in Model Context Protocol server for AI-assisted plan analysis (opt-in)
243244
- Dark theme
244245

245246
```bash
@@ -248,14 +249,14 @@ dotnet run --project src/PlanViewer.App
248249

249250
## SSMS Extension
250251

251-
A VSIX extension that adds **"Open in SQL Performance Studio"** to the execution plan right-click context menu in SSMS 18-22.
252+
A VSIX extension that adds **"Open in Performance Studio"** to the execution plan right-click context menu in SSMS 18-22.
252253

253254
### How it works
254255

255256
1. Right-click on any execution plan in SSMS
256-
2. Click "Open in SQL Performance Studio"
257+
2. Click "Open in Performance Studio"
257258
3. The extension extracts the plan XML via reflection and saves it to a temp file
258-
4. SQL Performance Studio opens with the plan loaded
259+
4. Performance Studio opens with the plan loaded
259260

260261
### Installation
261262

@@ -267,13 +268,55 @@ A VSIX extension that adds **"Open in SQL Performance Studio"** to the execution
267268

268269
### First run
269270

270-
On first use, if SQL Performance Studio isn't found automatically, the extension will prompt you to locate `PlanViewer.App.exe`. The path is saved to the registry (`HKCU\SOFTWARE\DarlingData\SQLPerformanceStudio\InstallPath`) so you only need to do this once.
271+
On first use, if Performance Studio isn't found automatically, the extension will prompt you to locate `PlanViewer.App.exe`. The path is saved to the registry (`HKCU\SOFTWARE\DarlingData\SQLPerformanceStudio\InstallPath`) so you only need to do this once.
271272

272273
The extension searches for the app in this order:
273274
1. Registry key (set automatically after first browse)
274275
2. System PATH
275276
3. Common install locations (`%LOCALAPPDATA%\Programs\SQLPerformanceStudio\`, `Program Files`, etc.)
276277

278+
## MCP Server (LLM Integration)
279+
280+
The desktop GUI includes an embedded [Model Context Protocol](https://modelcontextprotocol.io) server that exposes loaded execution plans and Query Store data to LLM clients like Claude Code and Cursor.
281+
282+
### Setup
283+
284+
1. Enable the MCP server in `~/.planview/settings.json`:
285+
286+
```json
287+
{
288+
"mcp_enabled": true,
289+
"mcp_port": 5152
290+
}
291+
```
292+
293+
2. Register with Claude Code:
294+
295+
```
296+
claude mcp add --transport streamable-http --scope user performance-studio http://localhost:5152/
297+
```
298+
299+
3. Open a new Claude Code session and ask questions like:
300+
- "What plans are loaded in the application?"
301+
- "Analyze the execution plan and tell me what's wrong"
302+
- "Are there any missing index suggestions?"
303+
- "Compare these two plans — which is better?"
304+
- "Fetch the top 10 queries by CPU from Query Store"
305+
306+
### Available Tools
307+
308+
13 tools for plan analysis and Query Store data:
309+
310+
| Category | Tools |
311+
|---|---|
312+
| Discovery | `list_plans`, `get_connections` |
313+
| Plan Analysis | `analyze_plan`, `get_plan_summary`, `get_plan_warnings`, `get_missing_indexes`, `get_plan_parameters`, `get_expensive_operators`, `get_plan_xml`, `compare_plans`, `get_repro_script` |
314+
| Query Store | `check_query_store`, `get_query_store_top` |
315+
316+
Plan analysis tools work on plans loaded in the app (via file open, paste, query execution, or Query Store fetch). Query Store tools use a built-in read-only DMV query — no arbitrary SQL can be executed.
317+
318+
The MCP server binds to `localhost` only and does not accept remote connections. Disabled by default.
319+
277320
## Project Structure
278321

279322
```

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Reporting a Vulnerability
44

5-
If you discover a security vulnerability in SQL Performance Studio, please report it responsibly.
5+
If you discover a security vulnerability in Performance Studio, please report it responsibly.
66

77
**Do not open a public GitHub issue for security vulnerabilities.**
88

@@ -26,7 +26,7 @@ This policy applies to:
2626

2727
## Security Best Practices
2828

29-
When using SQL Performance Studio:
29+
When using Performance Studio:
3030

3131
- Use Windows Authentication where possible when connecting to SQL Server
3232
- Use dedicated accounts with minimal required permissions

src/PlanViewer.App/AboutWindow.axaml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Window xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
x:Class="PlanViewer.App.AboutWindow"
4-
Title="About SQL Performance Studio"
5-
Width="450" Height="340"
4+
Title="About Performance Studio"
5+
Width="450" Height="420"
66
CanResize="False"
77
WindowStartupLocation="CenterOwner"
88
Icon="avares://PlanViewer.App/EDD.ico"
@@ -11,7 +11,7 @@
1111
<Grid Margin="24" RowDefinitions="Auto,Auto,Auto,Auto,*,Auto">
1212

1313
<!-- Title -->
14-
<TextBlock Grid.Row="0" Text="SQL Performance Studio" FontWeight="Bold" FontSize="20"
14+
<TextBlock Grid.Row="0" Text="Performance Studio" FontWeight="Bold" FontSize="20"
1515
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,4"/>
1616
<TextBlock Grid.Row="1" x:Name="VersionText" Text="Version 0.3.0" FontSize="12"
1717
Foreground="{DynamicResource ForegroundMutedBrush}" Margin="0,0,0,4"/>
@@ -46,8 +46,24 @@
4646
TextDecorations="Underline"/>
4747
</StackPanel>
4848

49-
<!-- Spacer -->
50-
<Panel Grid.Row="4"/>
49+
<!-- MCP Settings -->
50+
<StackPanel Grid.Row="4" Margin="0,0,0,12">
51+
<TextBlock Text="Settings" FontWeight="SemiBold" FontSize="13"
52+
Foreground="{DynamicResource ForegroundBrush}" Margin="0,0,0,8"/>
53+
<StackPanel Orientation="Horizontal" Spacing="12">
54+
<CheckBox x:Name="McpEnabledCheckBox" Content="Enable MCP Server"
55+
FontSize="12" VerticalContentAlignment="Center"
56+
Foreground="{DynamicResource ForegroundBrush}"/>
57+
<TextBlock Text="Port:" FontSize="12" VerticalAlignment="Center"
58+
Foreground="{DynamicResource ForegroundBrush}"/>
59+
<TextBox x:Name="McpPortInput" Width="70" Height="28"
60+
Text="5152" FontSize="12" Padding="6,2"
61+
VerticalContentAlignment="Center"/>
62+
</StackPanel>
63+
<TextBlock Text="Restart the application after changing MCP settings."
64+
FontSize="11" Foreground="{DynamicResource ForegroundMutedBrush}"
65+
Margin="0,4,0,0"/>
66+
</StackPanel>
5167

5268
<!-- Close -->
5369
<Button Grid.Row="5" Content="Close" Click="CloseButton_Click"

src/PlanViewer.App/AboutWindow.axaml.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
/*
2-
* SQL Performance Studio — SQL Server Execution Plan Analyzer
2+
* Performance Studio — SQL Server Execution Plan Analyzer
33
* Copyright (c) 2026 Erik Darling, Darling Data LLC
44
* Licensed under the MIT License - see LICENSE file for details
55
*/
66

7+
using System;
78
using System.Diagnostics;
9+
using System.IO;
810
using System.Reflection;
911
using System.Runtime.InteropServices;
12+
using System.Text.Json;
1013
using Avalonia.Controls;
1114
using Avalonia.Input;
1215
using Avalonia.Interactivity;
16+
using PlanViewer.App.Mcp;
1317

1418
namespace PlanViewer.App;
1519

@@ -25,6 +29,31 @@ public AboutWindow()
2529
var version = Assembly.GetExecutingAssembly().GetName().Version;
2630
if (version != null)
2731
VersionText.Text = $"Version {version.Major}.{version.Minor}.{version.Build}";
32+
33+
// Load current MCP settings
34+
var settings = McpSettings.Load();
35+
McpEnabledCheckBox.IsChecked = settings.Enabled;
36+
McpPortInput.Text = settings.Port.ToString();
37+
38+
// Save on change
39+
McpEnabledCheckBox.IsCheckedChanged += (_, _) => SaveMcpSettings();
40+
McpPortInput.LostFocus += (_, _) => SaveMcpSettings();
41+
}
42+
43+
private void SaveMcpSettings()
44+
{
45+
var settingsDir = Path.Combine(
46+
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".planview");
47+
var settingsFile = Path.Combine(settingsDir, "settings.json");
48+
49+
var json = JsonSerializer.Serialize(new
50+
{
51+
mcp_enabled = McpEnabledCheckBox.IsChecked == true,
52+
mcp_port = int.TryParse(McpPortInput.Text, out var p) && p >= 1024 && p <= 65535 ? p : 5152
53+
}, new JsonSerializerOptions { WriteIndented = true });
54+
55+
Directory.CreateDirectory(settingsDir);
56+
File.WriteAllText(settingsFile, json);
2857
}
2958

3059
private void GitHubLink_Click(object? sender, PointerPressedEventArgs e) => OpenUrl(GitHubUrl);

src/PlanViewer.App/App.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Application xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
x:Class="PlanViewer.App.App"
4-
Name="SQL Performance Studio"
4+
Name="Performance Studio"
55
RequestedThemeVariant="Dark">
66

77
<NativeMenu.Menu>
88
<NativeMenu>
9-
<NativeMenuItem Header="About SQL Performance Studio" Click="OnAboutClicked" />
9+
<NativeMenuItem Header="About Performance Studio" Click="OnAboutClicked" />
1010
</NativeMenu>
1111
</NativeMenu.Menu>
1212

src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ private void ShowAdviceWindow(string title, string content)
607607

608608
var window = new Window
609609
{
610-
Title = $"SQL Performance Studio — {title}",
610+
Title = $"Performance Studio — {title}",
611611
Width = 700,
612612
Height = 600,
613613
MinWidth = 400,
@@ -1119,7 +1119,7 @@ otherwise fall back to the currently selected database */
11191119
database,
11201120
planXml,
11211121
isolationLevel: null,
1122-
source: "SQL Performance Studio",
1122+
source: "Performance Studio",
11231123
isAzureSqlDb: IsAzureConnection);
11241124

11251125
try

src/PlanViewer.App/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleName</key>
6-
<string>SQL Performance Studio</string>
6+
<string>Performance Studio</string>
77
<key>CFBundleDisplayName</key>
8-
<string>SQL Performance Studio</string>
8+
<string>Performance Studio</string>
99
<key>CFBundleIdentifier</key>
1010
<string>com.darlingdata.sqlperformancestudio</string>
1111
<key>CFBundleVersion</key>

src/PlanViewer.App/MainWindow.axaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:controls="using:PlanViewer.App.Controls"
44
x:Class="PlanViewer.App.MainWindow"
5-
Title="SQL Performance Studio — SQL Server Execution Plan Analyzer"
5+
Title="Performance Studio — SQL Server Execution Plan Analyzer"
66
Width="1280" Height="800"
77
MinWidth="640" MinHeight="480"
88
WindowState="Maximized"
@@ -25,7 +25,7 @@
2525
InputGesture="Alt+F4"/>
2626
</MenuItem>
2727
<MenuItem Header="_Help">
28-
<MenuItem Header="_About SQL Performance Studio" Click="About_Click"/>
28+
<MenuItem Header="_About Performance Studio" Click="About_Click"/>
2929
<Separator/>
3030
<MenuItem x:Name="McpStatusMenuItem" Header="MCP Server: Off" IsEnabled="False"/>
3131
</MenuItem>
@@ -40,7 +40,7 @@
4040
<Border x:Name="EmptyOverlay" Background="{DynamicResource BackgroundBrush}"
4141
IsVisible="True" IsHitTestVisible="False">
4242
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="8">
43-
<TextBlock Text="SQL Performance Studio" FontSize="28" FontWeight="Bold"
43+
<TextBlock Text="Performance Studio" FontSize="28" FontWeight="Bold"
4444
Foreground="{DynamicResource ForegroundBrush}"
4545
HorizontalAlignment="Center"/>
4646
<TextBlock Text="Ctrl+N to open a new query session"

src/PlanViewer.App/MainWindow.axaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ private DockPanel CreatePlanTabContent(PlanViewerControl viewer)
496496

497497
var reproScript = ReproScriptBuilder.BuildReproScript(
498498
queryText, database, planXml,
499-
isolationLevel: null, source: "SQL Performance Studio");
499+
isolationLevel: null, source: "Performance Studio");
500500

501501
var clipboard = this.Clipboard;
502502
if (clipboard != null)
@@ -597,7 +597,7 @@ private void ShowAdviceWindow(string title, string content)
597597

598598
var window = new Window
599599
{
600-
Title = $"SQL Performance Studio — {title}",
600+
Title = $"Performance Studio — {title}",
601601
Width = 700,
602602
Height = 600,
603603
MinWidth = 400,
@@ -1059,7 +1059,7 @@ private void ShowError(string message)
10591059
{
10601060
var dialog = new Window
10611061
{
1062-
Title = "SQL Performance Studio",
1062+
Title = "Performance Studio",
10631063
Width = 450,
10641064
Height = 200,
10651065
WindowStartupLocation = WindowStartupLocation.CenterOwner,

0 commit comments

Comments
 (0)