
NET Framework
STDIOTCP-based MCP server for building .NET Framework projects on Windows from WSL/Linux environments
TCP-based MCP server for building .NET Framework projects on Windows from WSL/Linux environments
A TCP-based Model Context Protocol (MCP) server specifically designed for building, testing, and running .NET Framework projects on Windows. This tool enables Claude Code (running in WSL or other environments) to remotely build .NET Framework projects using the Windows build toolchain.
This MCP server provides a bridge between AI assistants (like Claude) and the Windows .NET Framework build environment. It's specifically designed for scenarios where:
┌─────────────────┐ TCP/3001 ┌──────────────────┐
│ Claude Code │ ──────────────→ │ TCP MCP Server │
│ (WSL/Linux) │ │ (Windows) │
└─────────────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ MSBuild.exe │
│ (Visual Studio) │
└──────────────────┘
sudo apt install netcat-openbsd
Clone the repository on your Windows machine:
git clone https://github.com/yourusername/dotnet-framework-mcp cd dotnet-framework-mcp
Build the MCP server:
build-on-windows.bat
This creates a self-contained executable in the publish
folder.
Start the TCP server:
run-tcp-server.bat
The server will start listening on port 3001.
Since Claude Code only runs on macOS/Linux, Windows users must run it in WSL2. The bridge enables communication between Claude Code (in WSL2) and the MCP server (on Windows):
localhost
which works in many setupswsl-mcp-bridge.sh
) uses netcat to establish the TCP connection:
nc localhost 3001
The flow looks like this:
Claude Code (WSL2) → Bridge Script → netcat → localhost:3001 → Windows MCP Server
You don't directly interact with netcat - it's wrapped inside the bridge script that Claude Code executes automatically.
Configure Claude Code by editing ~/.config/Claude/claude_desktop_config.json
:
{ "mcpServers": { "dotnet-framework": { "command": "/path/to/wsl-mcp-bridge.sh", "env": { "MCP_DEBUG": "true" } } } }
Create the bridge script (adjust the path to your project location):
#!/bin/bash exec nc localhost 3001
Make it executable:
chmod +x wsl-mcp-bridge.sh
Restart Claude Code to pick up the configuration.
The service implements the following MCP tools:
Build a .NET project or solution.
Parameters:
path
(string, required): Path to .csproj or .sln fileconfiguration
(string): Build configuration (Debug/Release)platform
(string): Target platform (Any CPU/x86/x64)restore
(boolean): Restore NuGet packagesRun tests in a .NET test project.
Parameters:
path
(string, required): Path to test projectfilter
(string): Test filter expressionverbose
(boolean): Enable verbose outputExecute a .NET console application.
Parameters:
path
(string, required): Path to projectargs
(array): Command line argumentsworkingDirectory
(string): Working directoryGet information about a solution structure.
Parameters:
path
(string, required): Path to .sln fileList NuGet packages in a project.
Parameters:
path
(string, required): Path to projectIf Claude Code is running in WSL but you want the MCP server on Windows:
Build the project on Windows:
build-on-windows.bat
This creates a self-contained executable in the publish
folder.
Start the TCP server:
run-tcp-server.bat
Or directly:
publish\DotNetFrameworkMCP.Server.exe --port 3001
Start the TCP server (builds if needed):
start-tcp-server.bat
Or manually:
dotnet run --project src\DotNetFrameworkMCP.Server -- --port 3001
Configure Claude Code in WSL:
{ "mcpServers": { "dotnet-framework": { "command": "/path/to/project/wsl-mcp-bridge.sh", "env": { "MCP_DEBUG": "true" } } } }
Make sure netcat is installed in WSL:
sudo apt install netcat-openbsd
publish
folderrun-tcp-server-vs2022.bat
for explicit VS2022 MSBuildset MSBUILD_PATH=C:\Path\To\MSBuild\Bin
Then update# Option 1: Find Windows host IP (for default NAT mode): ip route show | grep -i default | awk '{ print $3}' # Or check nameserver: cat /etc/resolv.conf | grep nameserver # Option 2: Enable Mirrored Mode networking (Windows 11 22H2+) # Add to .wslconfig in your Windows user directory: # [wsl2] # networkingMode=mirrored
WINDOWS_HOST
in wsl-mcp-bridge.sh
to use the IP address instead of "localhost"Use the provided test script:
./test-tcp-server.sh
Or test with netcat:
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-06-18"}}' | nc localhost 3001
See test-messages.json
for example MCP protocol messages you can send to test different functionality.
The service can be configured through appsettings.json
or environment variables:
{ "McpServer": { "MsBuildPath": "auto", "DefaultConfiguration": "Debug", "DefaultPlatform": "Any CPU", "TestTimeout": 300000, "BuildTimeout": 1200000, "EnableDetailedLogging": false, "PreferredVSVersion": "2022", "UseDotNetCli": false, "DotNetPath": "dotnet" } }
The PreferredVSVersion setting controls which Visual Studio version's MSBuild and VSTest tools to use when multiple versions are installed:
"2022"
: Prefer Visual Studio 2022 tools (default)"2019"
: Prefer Visual Studio 2019 tools"auto"
: Use any available version (searches 2022 first, then 2019)Environment variables use the prefix MCPSERVER_
, for example:
MCPSERVER_DefaultConfiguration=Release
MCPSERVER_EnableDetailedLogging=true
MCPSERVER_PreferredVSVersion=2019
MCPSERVER_UseDotNetCli=true
The MCP server now supports using the dotnet CLI as an alternative to MSBuild/VSTest. This can be useful when:
To enable dotnet CLI mode:
Via configuration file (appsettings.json
):
{ "McpServer": { "UseDotNetCli": true } }
Via environment variable:
set MCPSERVER__UseDotNetCli=true
Note: The dotnet CLI has some limitations when working with older .NET Framework projects:
When UseDotNetCli
is enabled:
dotnet build
is used instead of MSBuild.exedotnet test
is used instead of VSTest.Console.exe🎉 FIRST RELEASE READY - Core functionality complete for .NET Framework building and testing.
build_project
- Build .NET Framework solutions and projectsrun_tests
- Execute tests with detailed error reporting and stack tracesrun_project
- Execute console applicationsanalyze_solution
- Solution structure analysislist_packages
- NuGet package listingCore Features:
Requirements:
[Add your license here]