msbuild
A lightweight MCP (Model Context Protocol) server for building MSBuild projects. Supports dynamic MSBuild discovery using vswhere and provides flexible build configuration options.
claude mcp add --transport stdio zenoengine-msbuild-mcp-server uvx msbuild-mcp-server@latest
How to use
The MSBuild MCP Server automates builds for MSBuild-compatible projects (such as .sln, .csproj, and .vcxproj) by dynamically locating MSBuild and exposing configurable build options to MCP clients. It discovers the appropriate MSBuild executable across Visual Studio installations, allowing you to run builds with a chosen configuration (e.g., Release or Debug), target platform, verbosity, parallelism, and whether to restore NuGet packages. When integrated with MCP clients like VSCode, Cursor, Windsurf, or other compatible tools, you can trigger builds using natural language prompts or scripted tool invocations and receive concise, relevant error reporting when builds fail.
Typical workflows involve configuring build parameters in the client’s MCP snippet, then issuing a build request (e.g., a solution path plus configuration like Release|x64). The server takes care of locating MSBuild, assembling the command line, executing the build, and returning results suitable for display in your IDE or chat tool. This enables repeatable, LLMed-driven build automation across multiple projects and languages supported by MSBuild, including C#, C++, and others on Windows.
How to install
Prerequisites
- Python 3.11 or higher
- Visual Studio or Visual Studio Build Tools (to provide MSBuild)
- uv (recommended) for running MCP servers
- Install uvx (if not already installed)
- Follow the uv installation guide: https://docs.astral.sh/uv/getting-started/installation/
- Ensure uv is accessible in your PATH
- Install the MSBuild MCP Server via uvx
- Run in your terminal: uvx install msbuild-mcp-server@latest
- This will install the server package and make the msbuild-mcp-server command available
- Register the MCP server with your MCP-enabled tools
- In your MCP client configuration, add the following server entry: { "mcpServers": { "msbuild-mcp-server": { "command": "uvx", "args": [ "msbuild-mcp-server@latest" ] } } }
- Save and restart your MCP client or editor extension to register the server
- Verify installation
- List running MCP servers or try a simple build command through your MCP client to confirm the server responds and locates MSBuild on your machine
Prerequisites recap: ensure Python and Visual Studio components are installed to provide MSBuild, and have uv installed to run the MCP server via uvx.
Additional notes
Tips and troubleshooting:
- MSBuild discovery relies on typical Visual Studio installation paths. If you have multiple VS versions, ensure the server can locate the intended MSBuild (e.g., via environment variables or VS installation selectors).
- For large solutions, consider enabling parallel builds and setting a reasonable max CPU count to improve performance.
- If NuGet restore is required, ensure nuget restore behavior is enabled in your build configuration and that network access is available.
- When integrating with MCP clients, provide explicit path and configuration parameters in your prompts to minimize ambiguity in the build command.
- Common issues: MSBuild not found, incorrect path, or incompatible .csproj/.sln files. Ensure the appropriate workloads (e.g., Desktop development with C++) are installed if building C++ projects.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP