{"id":4359,"date":"2026-06-17T17:11:39","date_gmt":"2026-06-17T17:11:39","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/06\/17\/ai-powered-msbuild-investigation-with-the-microsoft-binlog-mcp-server\/"},"modified":"2026-06-17T17:11:39","modified_gmt":"2026-06-17T17:11:39","slug":"ai-powered-msbuild-investigation-with-the-microsoft-binlog-mcp-server","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2026\/06\/17\/ai-powered-msbuild-investigation-with-the-microsoft-binlog-mcp-server\/","title":{"rendered":"AI-Powered MSBuild Investigation with the Microsoft Binlog MCP Server"},"content":{"rendered":"<p>MSBuild binary logs (<code>.binlog<\/code> files) contain a wealth of information about<br \/>\nyour build \u2014 every property evaluation, target execution, task invocation,<br \/>\nerror, and warning. But navigating that data manually can be overwhelming,<br \/>\nespecially when you\u2019re debugging a complex multi-project solution. What if your<br \/>\nAI coding assistant could do the investigation for you?<\/p>\n<p>Today we\u2019re introducing the <strong>Microsoft Binlog MCP Server<\/strong>, a<br \/>\n<a href=\"https:\/\/modelcontextprotocol.io\/\">Model Context Protocol<\/a> (MCP) server that<br \/>\ngives AI assistants like GitHub Copilot direct access to your build logs. It<br \/>\nparses <code>.binlog<\/code> files and exposes 15 specialized tools that enable AI-driven<br \/>\nbuild failure diagnosis, property tracing, performance analysis, and build<br \/>\ncomparison \u2014 all through natural language conversation.<\/p>\n<h2>Why MCP for Build Logs?<\/h2>\n<p>The <a href=\"https:\/\/modelcontextprotocol.io\/\">Model Context Protocol<\/a> is an open<br \/>\nstandard that lets AI assistants call external tools in a structured way. By<br \/>\nwrapping MSBuild binary log analysis in an MCP server, we give AI assistants<br \/>\nthe ability to:<\/p>\n<ul>\n<li><strong>Investigate build failures<\/strong> by querying errors, warnings, and their full<br \/>\nproject\/target\/task context<\/li>\n<li><strong>Trace property origins<\/strong> to understand where a property got its value<\/li>\n<li><strong>Analyze performance bottlenecks<\/strong> by identifying the slowest projects,<br \/>\ntargets, and tasks<\/li>\n<li><strong>Compare two builds<\/strong> to spot differences in properties and packages<\/li>\n<li><strong>Read embedded source files<\/strong> captured during the build<\/li>\n<\/ul>\n<p>Instead of manually scrolling through the<br \/>\n<a href=\"https:\/\/msbuildlog.com\/\">MSBuild Structured Log Viewer<\/a>, you can simply ask<br \/>\nyour AI assistant questions like <em>\u201cWhy did my build fail?\u201d<\/em> or<br \/>\n<em>\u201cWhat\u2019s making my build slow?\u201d<\/em><\/p>\n<h2>15 Tools at Your AI Assistant\u2019s Disposal<\/h2>\n<p>The Microsoft Binlog MCP Server provides tools organized into four<br \/>\ncategories:<\/p>\n<h3>Build Investigation<\/h3>\n<table>\n<thead>\n<tr>\n<th>Tool<\/th>\n<th>What It Does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>binlog_overview<\/code><\/td>\n<td>Build status, duration, project count, error\/warning counts<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_errors<\/code><\/td>\n<td>Build errors with full project, target, task, file, and line context<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_warnings<\/code><\/td>\n<td>Build warnings, filterable by warning code<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_search<\/code><\/td>\n<td>Full-text search using the StructuredLog Viewer search DSL<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_projects<\/code><\/td>\n<td>List all projects with build status and duration<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_properties<\/code><\/td>\n<td>MSBuild property values (curated defaults or filtered)<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_items<\/code><\/td>\n<td>MSBuild items like PackageReference, Compile, and more<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_imports<\/code><\/td>\n<td>Full import chain of <code>.props<\/code> and <code>.targets<\/code> files<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_explain_property<\/code><\/td>\n<td>Traces where a property gets its value \u2014 which file, target, or task set it<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Embedded Files<\/h3>\n<table>\n<thead>\n<tr>\n<th>Tool<\/th>\n<th>What It Does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>binlog_files<\/code><\/td>\n<td>List or read source files captured during the build<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_search_files<\/code><\/td>\n<td>Search text across all embedded source files<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Performance Analysis<\/h3>\n<table>\n<thead>\n<tr>\n<th>Tool<\/th>\n<th>What It Does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>binlog_expensive_projects<\/code><\/td>\n<td>Slowest projects by exclusive duration<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_expensive_targets<\/code><\/td>\n<td>Slowest targets across the entire build<\/td>\n<\/tr>\n<tr>\n<td><code>binlog_expensive_tasks<\/code><\/td>\n<td>Slowest tasks across the entire build<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Build Comparison<\/h3>\n<table>\n<thead>\n<tr>\n<th>Tool<\/th>\n<th>What It Does<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>binlog_compare<\/code><\/td>\n<td>Diff two binlogs \u2014 compare properties, packages, and more<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Getting Started<\/h2>\n<p>The easiest way to get started is through the<br \/>\n<a href=\"https:\/\/github.com\/dotnet\/skills\">.NET Agent Skills<\/a> repository. The<br \/>\n<code>dotnet-msbuild<\/code> plugin bundles the Microsoft Binlog MCP Server along with<br \/>\ncurated skills and agents for MSBuild build investigation and optimization.<br \/>\nPick the section below that matches your development environment.<\/p>\n<h3>Visual Studio<\/h3>\n<p>Visual Studio supports MCP servers through GitHub Copilot\u2019s agent mode<br \/>\n(Visual Studio 17.14 or later). After installing the <code>dotnet-msbuild<\/code><br \/>\nplugin, the Microsoft Binlog MCP Server is automatically discovered by<br \/>\nCopilot Chat in agent mode. Open the Copilot Chat window, switch to<br \/>\n<strong>Agent<\/strong> mode, and the <code>binlog_*<\/code> tools become available for any<br \/>\nconversation about a <code>.binlog<\/code> file in your solution.<\/p>\n<h3>Visual Studio Code<\/h3>\n<p>In VS Code, enable plugin support and add the marketplace to your<br \/>\n<code>settings.json<\/code>:<\/p>\n<pre><code class=\"language-json\">{\n  \"chat.plugins.enabled\": true,\n  \"chat.plugins.marketplaces\": [\"dotnet\/skills\"]\n}<\/code><\/pre>\n<p>Then install the <code>dotnet-msbuild<\/code> plugin from the marketplace \u2014 the<br \/>\nBinlog MCP Server is configured automatically.<\/p>\n<p>Prefer to wire up the MCP server directly? Add it to your<br \/>\n<code>.vscode\/mcp.json<\/code>:<\/p>\n<pre><code class=\"language-json\">{\n  \"servers\": {\n    \"binlog-mcp\": {\n      \"type\": \"stdio\",\n      \"command\": \"dotnet\",\n      \"args\": [\"tool\", \"run\", \"Microsoft.AITools.BinlogMcp\"]\n    }\n  }\n}<\/code><\/pre>\n<p>To pre-load a specific binlog at startup, pass the <code>--binlog<\/code> argument:<\/p>\n<pre><code class=\"language-json\">{\n  \"servers\": {\n    \"binlog-mcp\": {\n      \"type\": \"stdio\",\n      \"command\": \"dotnet\",\n      \"args\": [\"tool\", \"run\", \"Microsoft.AITools.BinlogMcp\", \"--\", \"--binlog\", \"msbuild.binlog\"]\n    }\n  }\n}<\/code><\/pre>\n<h3>Command Line (Copilot CLI \/ Claude Code)<\/h3>\n<p>For terminal-based AI assistants such as GitHub Copilot CLI or Claude<br \/>\nCode, install the plugin directly from the <code>dotnet\/skills<\/code> marketplace:<\/p>\n<pre><code class=\"language-bash\">\/plugin marketplace add dotnet\/skills\n\/plugin install dotnet-msbuild@dotnet-agent-skills<\/code><\/pre>\n<p>Restart your assistant and the <code>binlog_*<\/code> tools are ready to use. You can<br \/>\nverify they loaded with <code>\/skills<\/code>.<\/p>\n\n<div class=\"alert alert-success\">\n<p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Lightbulb\"><\/i><strong>Tip<\/strong><\/p>\n<p>To generate a binary log, add <code>\/bl<\/code> to any<br \/>\n<code>dotnet build<\/code>, <code>dotnet test<\/code>, or <code>dotnet pack<\/code> command \u2014 for example:<br \/>\n<code>dotnet build \/bl<\/code>.<\/p><\/div>\n<h2>Example: Diagnosing a Build Failure<\/h2>\n<p>Once the MCP server is running and your AI assistant has access to a<br \/>\n<code>.binlog<\/code> file, you can investigate build issues conversationally.<\/p>\n<p>Here\u2019s a typical workflow:<\/p>\n<ol>\n<li><strong>Generate a binlog:<\/strong> Run <code>dotnet build \/bl<\/code> to capture a binary log<\/li>\n<li><strong>Ask your assistant:<\/strong> <em>\u201cMy build failed. Can you investigate<br \/>\nmsbuild.binlog and tell me what went wrong?\u201d<\/em><\/li>\n<li><strong>The AI investigates:<\/strong> It calls <code>binlog_overview<\/code> to get the high-level<br \/>\nstatus, then <code>binlog_errors<\/code> to retrieve the actual errors with full<br \/>\ncontext, and may use <code>binlog_explain_property<\/code> or <code>binlog_search<\/code> to trace<br \/>\nthe root cause<\/li>\n<li><strong>Get actionable guidance:<\/strong> The assistant synthesizes findings and suggests<br \/>\nconcrete fixes<\/li>\n<\/ol>\n<p>For performance investigations, the AI uses the <code>binlog_expensive_projects<\/code>,<br \/>\n<code>binlog_expensive_targets<\/code>, and <code>binlog_expensive_tasks<\/code> tools to identify<br \/>\nbottlenecks and recommend optimizations.<\/p>\n<p>The screenshot below shows this workflow in action inside VS Code.<\/p>\n<p><img data-opt-id=974231527  fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2026\/06\/binlog-mcp-in-vs-code.webp\" alt=\"GitHub Copilot in VS Code agent mode calling binlog MCP tools to diagnose an MSB4044 build failure\" \/><\/p>\n<h2>Try It Yourself: Compare Two Builds<\/h2>\n<p>Here\u2019s a great way to take the MCP server for a spin right now. Pick a<br \/>\nrepository you build regularly \u2014 your own product, or an open-source<br \/>\nproject like <a href=\"https:\/\/github.com\/dotnet\/msbuild\"><code>dotnet\/msbuild<\/code><\/a> or<br \/>\n<a href=\"https:\/\/github.com\/microsoft\/testfx\"><code>microsoft\/testfx<\/code><\/a> \u2014 and capture<br \/>\ntwo binary logs from different versions or configurations:<\/p>\n<pre><code class=\"language-bash\"># Build version A\ngit checkout main\ndotnet build \/bl:build-a.binlog\n\n# Build version B (a different branch, SDK, or configuration)\ngit checkout my-feature-branch\ndotnet build \/bl:build-b.binlog<\/code><\/pre>\n<p>Then ask your AI assistant:<\/p>\n<blockquote>\n<p><em>\u201cCompare <code>build-a.binlog<\/code> and <code>build-b.binlog<\/code>. What MSBuild properties<br \/>\nand package versions changed, and did any of those changes affect build<br \/>\nperformance?\u201d<\/em><\/p>\n<\/blockquote>\n<p>Behind the scenes, the assistant calls <code>binlog_compare<\/code> to diff properties<br \/>\nand packages, then uses <code>binlog_expensive_projects<\/code> and<br \/>\n<code>binlog_expensive_targets<\/code> on both logs to correlate the changes with<br \/>\ntiming differences \u2014 turning what used to be a tedious side-by-side log<br \/>\ncomparison into a single conversation.<\/p>\n<h2>Built on StructuredLogger<\/h2>\n<p>Under the hood, the Microsoft Binlog MCP Server uses the<br \/>\n<a href=\"https:\/\/github.com\/KirillOsenkov\/MSBuildStructuredLog\">MSBuild Structured Log Viewer<\/a><br \/>\nlibrary \u2014 the same engine that powers the popular <code>MSBuild Structured Log Viewer<\/code><br \/>\ndesktop app. The <code>binlog_search<\/code> tool supports the full<br \/>\n<a href=\"https:\/\/github.com\/KirillOsenkov\/MSBuildStructuredLog?tab=readme-ov-file#search\">StructuredLog Viewer search DSL<\/a>,<br \/>\nincluding node type filters (<code>$error<\/code>, <code>$warning<\/code>, <code>$task<\/code>, <code>$target<\/code>,<br \/>\n<code>$project<\/code>), hierarchical scoping with <code>under()<\/code>, and exact phrase matching<br \/>\nwith quoted strings.<\/p>\n<h2>Telemetry<\/h2>\n<p>The server emits anonymous usage telemetry (tool name, latency, result size,<br \/>\nsuccess\/failure) to help us improve the product. It follows the standard .NET<br \/>\nSDK approach: <strong>on by default, single opt-out<\/strong> via the<br \/>\n<code>DOTNET_CLI_TELEMETRY_OPTOUT<\/code> environment variable.<\/p>\n<pre><code class=\"language-bash\">export DOTNET_CLI_TELEMETRY_OPTOUT=1<\/code><\/pre>\n<p>No binlog content, file paths, or raw error messages are ever collected \u2014 only<br \/>\nfilenames are HMAC-SHA256 hashed for correlation.<\/p>\n<h2>What\u2019s Next<\/h2>\n<p>The Microsoft Binlog MCP Server is in preview and we\u2019re actively improving<br \/>\nit. We\u2019d love your feedback \u2014 please file issues in the<br \/>\n<a href=\"https:\/\/github.com\/dotnet\/skills\/issues\">dotnet\/skills<\/a> repository.<\/p>\n<p>If you\u2019re working with MSBuild builds and using AI coding assistants, give it<br \/>\na try. Let your AI do the heavy lifting of build investigation while you focus<br \/>\non writing code.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/msbuild-binlog-mcp-server\/\">AI-Powered MSBuild Investigation with the Microsoft Binlog MCP Server<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>MSBuild binary logs (.binlog files) contain a wealth of information about your build \u2014 every property evaluation, target execution, task [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4360,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-4359","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/4359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=4359"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/4359\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media\/4360"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=4359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=4359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=4359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}