{"id":60274,"date":"2026-06-17T10:00:00","date_gmt":"2026-06-17T17:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=60274"},"modified":"2026-06-17T10:00:00","modified_gmt":"2026-06-17T17:00:00","slug":"msbuild-binlog-mcp-server","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/msbuild-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\nyour build \u2014 every property evaluation, target execution, task invocation,\nerror, and warning. But navigating that data manually can be overwhelming,\nespecially when you&#8217;re debugging a complex multi-project solution. What if your\nAI coding assistant could do the investigation for you?<\/p>\n<p>Today we&#8217;re introducing the <strong>Microsoft Binlog MCP Server<\/strong>, a\n<a href=\"https:\/\/modelcontextprotocol.io\/\">Model Context Protocol<\/a> (MCP) server that\ngives AI assistants like GitHub Copilot direct access to your build logs. It\nparses <code>.binlog<\/code> files and exposes 15 specialized tools that enable AI-driven\nbuild failure diagnosis, property tracing, performance analysis, and build\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\nstandard that lets AI assistants call external tools in a structured way. By\nwrapping MSBuild binary log analysis in an MCP server, we give AI assistants\nthe ability to:<\/p>\n<ul>\n<li><strong>Investigate build failures<\/strong> by querying errors, warnings, and their full\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,\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\n<a href=\"https:\/\/msbuildlog.com\/\">MSBuild Structured Log Viewer<\/a>, you can simply ask\nyour AI assistant questions like <em>&#8220;Why did my build fail?&#8221;<\/em> or\n<em>&#8220;What&#8217;s making my build slow?&#8221;<\/em><\/p>\n<h2>15 Tools at Your AI Assistant&#8217;s Disposal<\/h2>\n<p>The Microsoft Binlog MCP Server provides tools organized into four\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\n<a href=\"https:\/\/github.com\/dotnet\/skills\">.NET Agent Skills<\/a> repository. The\n<code>dotnet-msbuild<\/code> plugin bundles the Microsoft Binlog MCP Server along with\ncurated skills and agents for MSBuild build investigation and optimization.\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&#8217;s agent mode\n(Visual Studio 17.14 or later). After installing the <code>dotnet-msbuild<\/code>\nplugin, the Microsoft Binlog MCP Server is automatically discovered by\nCopilot Chat in agent mode. Open the Copilot Chat window, switch to\n<strong>Agent<\/strong> mode, and the <code>binlog_*<\/code> tools become available for any\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\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\nBinlog MCP Server is configured automatically.<\/p>\n<p>Prefer to wire up the MCP server directly? Add it to your\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\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\nverify they loaded with <code>\/skills<\/code>.<\/p>\n<p><div class=\"alert alert-success\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Lightbulb\"><\/i><strong>Tip<\/strong><\/p>To generate a binary log, add <code>\/bl<\/code> to any\n<code>dotnet build<\/code>, <code>dotnet test<\/code>, or <code>dotnet pack<\/code> command \u2014 for example:\n<code>dotnet build \/bl<\/code>.<\/div><\/p>\n<h2>Example: Diagnosing a Build Failure<\/h2>\n<p>Once the MCP server is running and your AI assistant has access to a\n<code>.binlog<\/code> file, you can investigate build issues conversationally.<\/p>\n<p>Here&#8217;s 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>&#8220;My build failed. Can you investigate\nmsbuild.binlog and tell me what went wrong?&#8221;<\/em><\/li>\n<li><strong>The AI investigates:<\/strong> It calls <code>binlog_overview<\/code> to get the high-level\nstatus, then <code>binlog_errors<\/code> to retrieve the actual errors with full\ncontext, and may use <code>binlog_explain_property<\/code> or <code>binlog_search<\/code> to trace\nthe root cause<\/li>\n<li><strong>Get actionable guidance:<\/strong> The assistant synthesizes findings and suggests\nconcrete fixes<\/li>\n<\/ol>\n<p>For performance investigations, the AI uses the <code>binlog_expensive_projects<\/code>,\n<code>binlog_expensive_targets<\/code>, and <code>binlog_expensive_tasks<\/code> tools to identify\nbottlenecks and recommend optimizations.<\/p>\n<p>The screenshot below shows this workflow in action inside VS Code.<\/p>\n<p><img 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&#8217;s a great way to take the MCP server for a spin right now. Pick a\nrepository you build regularly \u2014 your own product, or an open-source\nproject like <a href=\"https:\/\/github.com\/dotnet\/msbuild\"><code>dotnet\/msbuild<\/code><\/a> or\n<a href=\"https:\/\/github.com\/microsoft\/testfx\"><code>microsoft\/testfx<\/code><\/a> \u2014 and capture\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>&#8220;Compare <code>build-a.binlog<\/code> and <code>build-b.binlog<\/code>. What MSBuild properties\nand package versions changed, and did any of those changes affect build\nperformance?&#8221;<\/em><\/p>\n<\/blockquote>\n<p>Behind the scenes, the assistant calls <code>binlog_compare<\/code> to diff properties\nand packages, then uses <code>binlog_expensive_projects<\/code> and\n<code>binlog_expensive_targets<\/code> on both logs to correlate the changes with\ntiming differences \u2014 turning what used to be a tedious side-by-side log\ncomparison into a single conversation.<\/p>\n<h2>Built on StructuredLogger<\/h2>\n<p>Under the hood, the Microsoft Binlog MCP Server uses the\n<a href=\"https:\/\/github.com\/KirillOsenkov\/MSBuildStructuredLog\">MSBuild Structured Log Viewer<\/a>\nlibrary \u2014 the same engine that powers the popular <code>MSBuild Structured Log Viewer<\/code>\ndesktop app. The <code>binlog_search<\/code> tool supports the full\n<a href=\"https:\/\/github.com\/KirillOsenkov\/MSBuildStructuredLog?tab=readme-ov-file#search\">StructuredLog Viewer search DSL<\/a>,\nincluding node type filters (<code>$error<\/code>, <code>$warning<\/code>, <code>$task<\/code>, <code>$target<\/code>,\n<code>$project<\/code>), hierarchical scoping with <code>under()<\/code>, and exact phrase matching\nwith quoted strings.<\/p>\n<h2>Telemetry<\/h2>\n<p>The server emits anonymous usage telemetry (tool name, latency, result size,\nsuccess\/failure) to help us improve the product. It follows the standard .NET\nSDK approach: <strong>on by default, single opt-out<\/strong> via the\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\nfilenames are HMAC-SHA256 hashed for correlation.<\/p>\n<h2>What&#8217;s Next<\/h2>\n<p>The Microsoft Binlog MCP Server is in preview and we&#8217;re actively improving\nit. We&#8217;d love your feedback \u2014 please file issues in the\n<a href=\"https:\/\/github.com\/dotnet\/skills\/issues\">dotnet\/skills<\/a> repository.<\/p>\n<p>If you&#8217;re working with MSBuild builds and using AI coding assistants, give it\na try. Let your AI do the heavy lifting of build investigation while you focus\non writing code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Diagnose MSBuild build failures and performance issues with AI using the new Microsoft Binlog MCP Server &#8211; 15 specialized tools that let your AI assistant investigate binary logs.<\/p>\n","protected":false},"author":11288,"featured_media":60275,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,7781],"tags":[568,8182,8181,7869,8032,8053,98],"class_list":["post-60274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-ai","tag-ai","tag-binlog","tag-build-diagnostics","tag-github-copilot","tag-mcp","tag-model-context-protocol","tag-msbuild"],"acf":[],"blog_post_summary":"<p>Diagnose MSBuild build failures and performance issues with AI using the new Microsoft Binlog MCP Server &#8211; 15 specialized tools that let your AI assistant investigate binary logs.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/60274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/11288"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=60274"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/60274\/revisions"}],"predecessor-version":[{"id":60279,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/60274\/revisions\/60279"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/60275"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=60274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=60274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=60274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}