BinlogInsights.Mcp
MCP server for MSBuild binary log analysis β 26 tools for AI-assisted build investigation, performance analysis, and NuGet diagnostics.
Ask AI about BinlogInsights.Mcp
Powered by Claude Β· Grounded in docs
I know everything about BinlogInsights.Mcp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
BinlogInsights
MSBuild binary log (.binlog) analysis tools β a CLI and an MCP server for AI-assisted build investigation.
Why?
MSBuild binary logs capture everything about a build: properties, items, imports, resolved packages, compiler invocations, targets, tasks, and timing. But navigating a binlog is tedious β they can be huge, deeply nested, and full of irrelevant noise.
BinlogInsights exposes structured queries over binlogs through two interfaces:
| Interface | Use case |
|---|---|
CLI (binlog-insights) | Quick terminal investigation, scripting, CI pipelines |
MCP server (binlog-insights-mcp) | AI-assisted investigation in VS Code / Copilot Chat |
The MCP server is particularly powerful: point Copilot at a failing binlog and let it drive the investigation β drilling from overview β errors β properties β imports β NuGet diagnostics automatically, following the same workflow a build engineer would.
Features
26 MCP Tools / 13 CLI Commands
Build investigation:
overviewβ Build status, duration, project count, top-level resultserrors/warningsβ Diagnostics with project, file, line infopropertiesβ MSBuild property values (with optional filter)importsβ Full import chain for a projectitemsβ Item groups (PackageReference, Compile, etc.)nugetβ NuGet restore diagnosticscompilerβ Full compiler command line (references, defines, flags)searchβ Free-text search across all build messagesprojectsβ Project list with status and durationpreprocessβ Effective project XML after all importscompareβ Diff two binlogs: properties, packages, references
Performance analysis (MCP only):
expensive_projects/project_target_timesβ Slowest projects and their target breakdownexpensive_targets/search_targets/project_targetsβ Target-level timingexpensive_tasks/search_tasks/tasks_in_target/task_detailsβ Task-level timingexpensive_analyzersβ Roslyn analyzer performance
Evaluation & files (MCP only):
evaluations/evaluation_properties/evaluation_global_propertiesβ Property/item resolution phaselist_files/get_fileβ Access source files embedded in the binlog
Installation
Prerequisites
- .NET 8 SDK or later
Install the MCP server (recommended)
dotnet tool install -g BinlogInsights.Mcp
Install the CLI
dotnet tool install -g BinlogInsights
Build from source
git clone https://github.com/SergeyTeplyakov/BinlogInsights.git
cd BinlogInsights/src
dotnet build
# Install the MCP server as a global tool:
./install.ps1
Setup for VS Code / Copilot
Add the MCP server to your workspace. Create .vscode/mcp.json:
{
"servers": {
"binlog-insights": {
"type": "stdio",
"command": "binlog-insights-mcp",
"args": []
}
}
}
You can pre-load one or more binlogs at startup so tool calls return instantly:
{
"servers": {
"binlog-insights": {
"type": "stdio",
"command": "binlog-insights-mcp",
"args": ["--binlog", "build.binlog", "--binlog", "other.binlog"]
}
}
}
Note: Relative paths in
--binlogargs are resolved against the MCP server's working directory. If files aren't found, use absolute paths or install the Binlog Analyzer extension which sets the working directory automatically.
Once configured, Copilot Chat automatically gains access to all 26 binlog analysis tools.
Setting up your repo for the team
The samples/repo-setup/ directory contains ready-to-copy files. Drop them into your repo root:
your-repo/
βββ .vscode/
β βββ mcp.json β MCP server config
βββ .github/
β βββ instructions/
β β βββ build-investigation.instructions.md β auto-activates on build files
β βββ skills/
β βββ build-tool-setup/
β β βββ SKILL.md β install/update the MCP tool
β βββ build-failure-analysis/
β β βββ SKILL.md β error investigation
β βββ build-performance-analysis/
β β βββ SKILL.md β perf bottleneck analysis
β βββ build-comparison/
β βββ SKILL.md β diff two builds
What each file does:
| File | Type | Trigger |
|---|---|---|
mcp.json | MCP config | Automatic β VS Code starts the server on workspace open |
build-investigation.instructions.md | Instruction | Automatic β activates when you open any .csproj, .sln, .props, .targets, or .binlog file |
build-tool-setup/SKILL.md | Skill | On-demand β Copilot loads when the tool isn't installed, install fails, or you need to update |
build-failure-analysis/SKILL.md | Skill | On-demand β Copilot loads when you ask about build errors, missing types, NuGet failures |
build-performance-analysis/SKILL.md | Skill | On-demand β Copilot loads when you ask about slow builds, build duration, expensive targets |
build-comparison/SKILL.md | Skill | On-demand β Copilot loads when you compare builds, diff environments, or migrate build systems |
A SKILL-TEMPLATE.md is also included as a starting point for creating your own skills.
Team members just need to:
- Install the tool:
dotnet tool install -g BinlogInsights.Mcp - Open the repo in VS Code β everything else is automatic
Usage
Generate a binlog
Build your project with binary logging enabled:
dotnet build /bl:build.binlog
Or for MSBuild:
msbuild /bl:build.binlog
CLI examples
# Build overview
binlog-insights overview build.binlog
# Show errors
binlog-insights errors build.binlog
# Check properties for a specific project
binlog-insights properties build.binlog --project MyApp --filter TargetFramework
# Search build messages
binlog-insights search build.binlog --query "PackageReference"
# Compare two builds
binlog-insights compare before.binlog after.binlog
# NuGet restore diagnostics
binlog-insights nuget build.binlog
# Compiler command line
binlog-insights compiler build.binlog --project MyApp
AI-assisted investigation
With the MCP server configured, ask Copilot Chat:
"My build failed. Investigate build.binlog and tell me what went wrong."
Copilot will automatically:
- Call
overviewto check build status - Call
errorsto see what failed - Drill deeper based on error type:
- Missing types β
itemsto check PackageReference - Property issues β
propertiesto inspect values - Import problems β
importsto trace the chain - NuGet failures β
nugetfor restore diagnostics
- Missing types β
- Use
searchfor free-text investigation - Use
compareto diff two builds
"Why is my build slow? Analyze build.binlog performance."
Copilot will:
- Call
expensive_projectsto find the slowest projects - Drill into targets with
project_target_times - Check
expensive_analyzersfor slow Roslyn analyzers - Identify bottleneck tasks with
expensive_tasks
"I have two binlogs from different build configurations. Compare them and tell me what's different."
Copilot will:
- Call
compareto diff properties, per-project packages, and solution-wide packages - Report property differences (e.g.,
NuGetPackageRoot, SDK paths) - Show per-project package version mismatches
- List solution-wide package diffs β packages resolved to different versions across all projects
- Drill into specifics with
properties,items, orcompilerto explain why versions differ
This is especially useful for:
- Migrating build systems (e.g., CoreXT β stock MSBuild) β verify that the new build resolves the same packages
- Debugging CI vs local β find property or package differences between environments
- Before/after changes β confirm a
.propsor.targetschange had the intended effect
Architecture
BinlogInsights.Core β Query engine (MSBuild.StructuredLogger)
βββ BinlogInsights β CLI tool (System.CommandLine)
βββ BinlogInsights.Mcp β MCP server (ModelContextProtocol SDK)
- Core parses binlogs via MSBuild.StructuredLogger and exposes typed query classes
- CLI wraps queries with
System.CommandLinefor terminal use - MCP wraps queries as Model Context Protocol tools for AI agents
License
MIT
