Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Analyze MSBuild binary logs (`.binlog`) with **GitHub Copilot Chat** and **MCP t
@binlog /perf
```

The [Microsoft.AITools.BinlogMcp](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-tools/NuGet/Microsoft.AITools.BinlogMcp) server (28 analysis tools) is auto-installed on first use.
The [Microsoft.AITools.BinlogMcp](https://www.nuget.org/packages/Microsoft.AITools.BinlogMcp) server (28 analysis tools) is auto-installed on first use.

## What You Get

Expand Down Expand Up @@ -52,12 +52,12 @@ The [Microsoft.AITools.BinlogMcp](https://dev.azure.com/dnceng/public/_artifacts

## Troubleshooting: MCP Server Installation

The extension auto-installs [Microsoft.AITools.BinlogMcp](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-tools/NuGet/Microsoft.AITools.BinlogMcp) via `dotnet tool install -g`. In corporate environments with restricted NuGet feeds, this may fail. Here are the workarounds:
The extension auto-installs [Microsoft.AITools.BinlogMcp](https://www.nuget.org/packages/Microsoft.AITools.BinlogMcp) via `dotnet tool install -g`. In corporate environments with restricted NuGet feeds, this may fail. Here are the workarounds:

### 1. Install with explicit feed source
### 1. Install manually

```bash
dotnet tool install -g Microsoft.AITools.BinlogMcp --prerelease --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
dotnet tool install -g Microsoft.AITools.BinlogMcp
```

### 2. Diagnose NuGet issues
Expand All @@ -67,9 +67,9 @@ dotnet nuget list source
```

Common problems:
- **dotnet-tools feed not configured** — the tool is published on the dotnet-tools Azure DevOps feed
- **nuget.org not configured** — the tool is published on nuget.org, the default NuGet feed
- **Authenticated feed requires credentials** — may block access to the feed
- **Package source mapping** excludes the dotnet-tools feed for this package
- **Package source mapping** excludes nuget.org for this package

### 3. Verify installation

Expand All @@ -81,7 +81,7 @@ binlog-mcp --help
## Related Projects

- [MSBuild Structured Log Viewer](https://github.com/KirillOsenkov/MSBuildStructuredLog) — WPF viewer with secrets redaction
- [Microsoft.AITools.BinlogMcp](https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-tools/NuGet/Microsoft.AITools.BinlogMcp) — MCP server for binlog analysis
- [Microsoft.AITools.BinlogMcp](https://www.nuget.org/packages/Microsoft.AITools.BinlogMcp) — MCP server for binlog analysis
- [MSBuild Binary Log docs](https://learn.microsoft.com/en-us/visualstudio/msbuild/obtaining-build-logs-with-msbuild#save-a-binary-log)

## License
Expand Down
18 changes: 8 additions & 10 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ let extensionContext: vscode.ExtensionContext | undefined;
let openedViaUri = false;
let optimizeInProgress = false;
let cachedMcpExePath: string | null | undefined; // undefined = not searched yet
const DOTNET_TOOLS_FEED = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json';
let codeLensRegistered = false;

function escapeHtml(s: string): string {
Expand Down Expand Up @@ -2140,11 +2139,11 @@ async function configureMcpServer(binlogPaths: string[], config: vscode.Workspac
...(workspaceCwd && { cwd: workspaceCwd }),
};
vscode.window.showWarningMessage(
'Could not find or install Microsoft.AITools.BinlogMcp. Install it manually: `dotnet tool install -g Microsoft.AITools.BinlogMcp --prerelease --add-source ' + DOTNET_TOOLS_FEED + '`',
'Could not find or install Microsoft.AITools.BinlogMcp. Install it manually: `dotnet tool install -g Microsoft.AITools.BinlogMcp`',
'Copy Command'
).then(sel => {
if (sel === 'Copy Command') {
vscode.env.clipboard.writeText('dotnet tool install -g Microsoft.AITools.BinlogMcp --prerelease --add-source ' + DOTNET_TOOLS_FEED);
vscode.env.clipboard.writeText('dotnet tool install -g Microsoft.AITools.BinlogMcp');
}
});
}
Expand Down Expand Up @@ -2315,9 +2314,8 @@ async function getLatestNuGetVersion(): Promise<string | null> {
const cp = require('child_process');

return new Promise<string | null>((resolve) => {
// Search the dotnet-tools feed for the package (includes prereleases)
cp.execFile('dotnet', ['package', 'search', NUGET_PACKAGE_ID, '--exact-match', '--format', 'json', '--prerelease',
'--source', DOTNET_TOOLS_FEED],
// Search nuget.org for the package
cp.execFile('dotnet', ['package', 'search', NUGET_PACKAGE_ID, '--exact-match', '--format', 'json'],
{ timeout: 30000, encoding: 'utf8' },
(error: any, stdout: string) => {
if (error) {
Expand Down Expand Up @@ -2366,7 +2364,7 @@ async function updateMcpServer() {
const result = await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: 'Updating Microsoft.AITools.BinlogMcp MCP server...' },
() => new Promise<{ success: boolean; output: string }>((resolve) => {
cp.execFile('dotnet', ['tool', 'update', '-g', 'Microsoft.AITools.BinlogMcp', '--prerelease', '--add-source', DOTNET_TOOLS_FEED], { timeout: 60000 }, (err: Error | null, stdout: string, stderr: string) => {
cp.execFile('dotnet', ['tool', 'update', '-g', 'Microsoft.AITools.BinlogMcp'], { timeout: 60000 }, (err: Error | null, stdout: string, stderr: string) => {
resolve({ success: !err, output: (stderr || stdout || '').toString() });
});
})
Expand Down Expand Up @@ -2406,7 +2404,7 @@ async function applyPendingToolUpdate(): Promise<void> {
const result = await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: 'Updating Microsoft.AITools.BinlogMcp MCP server...' },
() => new Promise<{ success: boolean; output: string }>((resolve) => {
cp.execFile('dotnet', ['tool', 'update', '-g', 'Microsoft.AITools.BinlogMcp', '--prerelease', '--add-source', DOTNET_TOOLS_FEED], { timeout: 60000 }, (err: Error | null, stdout: string, stderr: string) => {
cp.execFile('dotnet', ['tool', 'update', '-g', 'Microsoft.AITools.BinlogMcp'], { timeout: 60000 }, (err: Error | null, stdout: string, stderr: string) => {
resolve({ success: !err, output: (stderr || stdout || '').toString() });
});
})
Expand Down Expand Up @@ -2585,9 +2583,9 @@ async function installMcpTool(): Promise<string | null> {
const result = await vscode.window.withProgress(
{ location: vscode.ProgressLocation.Notification, title: 'Installing Microsoft.AITools.BinlogMcp MCP server (dotnet tool)...' },
() => new Promise<string | null>((resolve) => {
cp.execFile('dotnet', ['tool', 'install', '-g', 'Microsoft.AITools.BinlogMcp', '--prerelease', '--add-source', DOTNET_TOOLS_FEED], { timeout: 60000 }, (err: Error | null) => {
cp.execFile('dotnet', ['tool', 'install', '-g', 'Microsoft.AITools.BinlogMcp'], { timeout: 60000 }, (err: Error | null) => {
if (err) {
cp.execFile('dotnet', ['tool', 'update', '-g', 'Microsoft.AITools.BinlogMcp', '--prerelease', '--add-source', DOTNET_TOOLS_FEED], { timeout: 60000 }, () => {
cp.execFile('dotnet', ['tool', 'update', '-g', 'Microsoft.AITools.BinlogMcp'], { timeout: 60000 }, () => {
const exe = findMcpTool();
telemetry.trackToolInstall(!!exe);
resolve(exe);
Expand Down
Loading