Skip to content

Commit caca8aa

Browse files
Switch MCP server from BinlogInsights.Mcp to AITools.BinlogMcp (v0.10.19) (#9)
Replace BinlogInsights.Mcp (nuget.org) with AITools.BinlogMcp from the dotnet-eng Azure DevOps feed as the underlying MCP server. Package & executable: - Package: BinlogInsights.Mcp → AITools.BinlogMcp - Executable: binlog-insights-mcp → binlog-mcp - Feed: nuget.org → pkgs.dev.azure.com/dnceng/public/.../dotnet-eng - Install commands now use --prerelease --add-source flags Format compatibility (AITools.BinlogMcp uses different response formats): - binlog_overview: text instead of JSON → parse both formats - binlog_search: text instead of JSON → parseSearchResults() helper - binlog_projects: projectFile instead of fullPath → handle both - binlog_evaluations: text format → parse [id=N] lines - binlog_tasks_in_target: parameter 'target' not 'target_name' - binlog_task_details: uses task_id (int) not task_name Smooth customer transition: - findMcpTool() detects both binlog-mcp and binlog-insights-mcp - Auto-migrates: installs new tool when old one is detected - Shows migration prompt with command to uninstall old tool - Version detection checks both tool store paths - serverMatchesBinlogMcp() recognizes old and new server configs - Graceful 'not available' message for unregistered tools Other improvements: - Always inject binlog_file in tree MCP calls (fixes stale state after binlog removal) - Consistent unique project count in overview (dedup via binlog_projects) - Store taskId on tree items for task detail lookups All 208 tests pass. Version bumped to 0.10.19. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5dc2078 commit caca8aa

3 files changed

Lines changed: 69 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.10.19 (Preview)
4+
5+
### Changed
6+
- **Switched MCP server to AITools.BinlogMcp** — the extension now uses [AITools.BinlogMcp](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/AITools.BinlogMcp) from the dotnet-eng feed instead of BinlogInsights.Mcp from nuget.org. The new package is auto-installed on first use. Existing BinlogInsights.Mcp installations are automatically migrated — the extension installs the new tool and prompts to uninstall the old one.
7+
- **Consistent project count** — the overview and tree view now show the same deduplicated project count instead of the raw evaluation count
8+
- **Search with text format** — search results from the new MCP's text format are parsed correctly for the tree view
9+
10+
### Fixed
11+
- **Evaluations tree** — parse text format responses from the new MCP server; gracefully show "not available" when the tool isn't registered
12+
- **Task expansion** — fixed parameter names (`target` not `target_name`, `task_id` not `task_name`) to match the new MCP tool signatures
13+
- **Multi-binlog removal** — always inject `binlog_file` in tree MCP calls to avoid stale state errors when removing a binlog
14+
- **Overview parsing** — handle both JSON (old) and text (new) overview formats
15+
- **Project list for solutions** — parse `projectFile` property in addition to `fullPath` for compatibility
16+
317
## 0.10.18 (Preview)
418

519
### Removed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "binlog-analyzer",
33
"displayName": "MSBuild Binlog Analyzer",
44
"description": "Analyze MSBuild binary logs with Copilot Chat and MCP tools",
5-
"version": "0.10.18",
5+
"version": "0.10.19",
66
"preview": true,
77
"publisher": "dotutils",
88
"license": "MIT",

src/extension.ts

Lines changed: 54 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,29 @@ async function configureMcpServer(binlogPaths: string[], config: vscode.Workspac
21002100
};
21012101
} else {
21022102
let insightsExe = findMcpTool();
2103+
2104+
// Force migration: if user has the old BinlogInsights.Mcp but not the
2105+
// new AITools.BinlogMcp, install the new one automatically.
2106+
if (insightsExe && insightsExe.includes('binlog-insights-mcp')) {
2107+
const newExeName = process.platform === 'win32' ? 'binlog-mcp.exe' : 'binlog-mcp';
2108+
const newExePath = path.join(os.homedir(), '.dotnet', 'tools', newExeName);
2109+
if (!fs.existsSync(newExePath)) {
2110+
const migrated = await installMcpTool();
2111+
if (migrated) {
2112+
insightsExe = migrated;
2113+
cachedMcpExePath = migrated;
2114+
vscode.window.showInformationMessage(
2115+
'🔄 Migrated from BinlogInsights.Mcp to AITools.BinlogMcp. You can uninstall the old tool: `dotnet tool uninstall -g BinlogInsights.Mcp`',
2116+
'Copy Command'
2117+
).then(sel => {
2118+
if (sel === 'Copy Command') {
2119+
vscode.env.clipboard.writeText('dotnet tool uninstall -g BinlogInsights.Mcp');
2120+
}
2121+
});
2122+
}
2123+
}
2124+
}
2125+
21032126
if (!insightsExe) {
21042127
insightsExe = await installMcpTool();
21052128
// After install, start the tree client (it skipped earlier because tool wasn't found)
@@ -2280,13 +2303,14 @@ async function fetchAboutInfo(mode: 'interactive' | 'auto' | 'silent') {
22802303
async function getInstalledMcpVersion(toolPath: string): Promise<string | null> {
22812304
// Primary: read version from the .store directory (works for all versions, even old ones without --version)
22822305
try {
2283-
const storeDir = path.join(os.homedir(), '.dotnet', 'tools', '.store', 'aitools.binlogmcp');
2284-
if (fs.existsSync(storeDir)) {
2285-
const versions = fs.readdirSync(storeDir).filter(d => /^\d+\.\d+\.\d+/.test(d));
2286-
if (versions.length > 0) {
2287-
// Sort and pick the highest (there should only be one for a global tool)
2288-
versions.sort(compareVersions);
2289-
return versions[versions.length - 1];
2306+
for (const storeId of ['aitools.binlogmcp', 'binloginsights.mcp']) {
2307+
const storeDir = path.join(os.homedir(), '.dotnet', 'tools', '.store', storeId);
2308+
if (fs.existsSync(storeDir)) {
2309+
const versions = fs.readdirSync(storeDir).filter(d => /^\d+\.\d+\.\d+/.test(d));
2310+
if (versions.length > 0) {
2311+
versions.sort(compareVersions);
2312+
return versions[versions.length - 1];
2313+
}
22902314
}
22912315
}
22922316
} catch { /* fall through */ }
@@ -2420,26 +2444,36 @@ function findMcpTool(): string | null {
24202444

24212445
const homeDir = os.homedir();
24222446
const isWindows = process.platform === 'win32';
2423-
const exeName = isWindows ? 'binlog-mcp.exe' : 'binlog-mcp';
2447+
2448+
// Look for both the new (AITools.BinlogMcp → binlog-mcp) and old
2449+
// (BinlogInsights.Mcp → binlog-insights-mcp) executables so existing
2450+
// users aren't broken on upgrade.
2451+
const candidates = isWindows
2452+
? ['binlog-mcp.exe', 'binlog-insights-mcp.exe']
2453+
: ['binlog-mcp', 'binlog-insights-mcp'];
24242454

24252455
// Global dotnet tools are installed in ~/.dotnet/tools/
2426-
const globalToolPath = path.join(homeDir, '.dotnet', 'tools', exeName);
2427-
if (fs.existsSync(globalToolPath)) {
2428-
cachedMcpExePath = globalToolPath;
2429-
return globalToolPath;
2456+
for (const exeName of candidates) {
2457+
const globalToolPath = path.join(homeDir, '.dotnet', 'tools', exeName);
2458+
if (fs.existsSync(globalToolPath)) {
2459+
cachedMcpExePath = globalToolPath;
2460+
return globalToolPath;
2461+
}
24302462
}
24312463

24322464
// Also check PATH
24332465
const pathDirs = (process.env.PATH || '').split(path.delimiter);
2434-
for (const dir of pathDirs) {
2435-
const candidate = path.join(dir, exeName);
2436-
try {
2437-
if (fs.existsSync(candidate)) {
2438-
cachedMcpExePath = candidate;
2439-
return candidate;
2466+
for (const exeName of candidates) {
2467+
for (const dir of pathDirs) {
2468+
const candidate = path.join(dir, exeName);
2469+
try {
2470+
if (fs.existsSync(candidate)) {
2471+
cachedMcpExePath = candidate;
2472+
return candidate;
2473+
}
2474+
} catch {
2475+
// ignore permission errors
24402476
}
2441-
} catch {
2442-
// ignore permission errors
24432477
}
24442478
}
24452479

0 commit comments

Comments
 (0)