
MSBuild 带有 MCP 服务器的二进制日志分析工具,用于 AI 辅助构建调查
概览
MSBuild 二进制日志(.binlog)分析工具——一个 CLI 和一个用于 AI 辅助构建调查的 MCP 服务器。 MSBuild 二进制日志捕捉构建的一切:属性、项目、导入、解析包、编译器调用、目标、任务和时序。但浏览 binlog 很繁琐——它们可能庞大、嵌套且充满无关的杂音。 通过两个接口在binlog上暴露结构化查询: MCP服务器特别强大:指向一个失败的binlog,让它驱动调查——从概览→错误→属性→自动导入,导入→NuGet诊断,遵循构建工程师的工作流程。 - 概述 — 构建状态、时长、项目数量、顶层结果 - 错误/警告 — 包含项目、文件、行信息的诊断 - 属性 — MSBuild 属性值(可选过滤器)- 导入 — 项目的完整导入链 - 项目 — 项目组(PackageReference、Compile 等)
概述(AI 翻译)
MSBuild 二进制日志(.binlog)分析工具——一个 CLI 和一个用于 AI 辅助构建调查的 MCP 服务器。
为什么?
MSBuild 二进制日志捕捉构建的一切:属性、项、导入、已解析包、编译器调用、目标、任务和时序。 但浏览binlog非常繁琐——它们可能庞大、嵌套且充满无关紧要的噪音。
BinlogInsights 通过两个接口在 binlog 上提供结构化查询:
| 界面 | 使用场景 |
|---|---|
CLI (binlog-insights) |
快速终端调查、脚本编写、CI管道 |
MCP服务器 (binlog-insights-mcp) |
VS Code / 副驾驶聊天中的AI辅助调查 |
MCP服务器特别强大:指向一个失败的binlog,让它驱动调查——从概览→错误→属性→自动导入,导入→NuGet诊断,遵循构建工程师的工作流程。
特色
26个MCP工具 / 13个CLI命令
建筑调查:
overview— 构建状态、时长、项目数量、顶级结果errors/warnings— 包含项目、文件、行信息的诊断
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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": []
}
}
}
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →