.NET Framework Development MCP server

Provides .NET Framework development capabilities through TCP communication, enabling project building with MSBuild, test execution across MSTest/NUnit/xUnit frameworks, and solution analysis with automatic Visual Studio detection and cross-platform WSL support.
Back to servers
Setup instructions
Provider
bytedreamer
Release date
Jul 05, 2025
Stats
8 stars

The .NET Framework MCP Server is a specialized TCP-based tool that enables Claude Code (running in WSL or other Linux environments) to remotely build and work with Windows .NET Framework projects. It bridges the gap between AI assistants and the Windows build environment, allowing you to leverage AI capabilities with legacy .NET Framework applications.

Installation and Setup

Windows Setup (Server Side)

  1. Prerequisites:

    • Visual Studio 2019/2022 or Build Tools for Visual Studio
    • .NET 8.0 SDK (for running the server)
    • Windows 10/11 or Windows Server
  2. Build the MCP server:

    build-on-windows.bat
    

    This creates a self-contained executable in the publish folder.

  3. Start the TCP server:

    run-tcp-server.bat
    

    The server will start listening on port 3001.

WSL/Linux Setup (Client Side)

  1. Prerequisites:

    • Claude Code with MCP support
    • netcat (nc): sudo apt install netcat-openbsd
  2. 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"
          }
        }
      }
    }
    
  3. Create the bridge script:

    #!/bin/bash
    exec nc localhost 3001
    
  4. Make it executable:

    chmod +x wsl-mcp-bridge.sh
    
  5. Restart Claude Code to apply the configuration.

Using the MCP Server

Available Tools

build_project

Builds a .NET project or solution.

Parameters:

  • path (string, required): Path to .csproj or .sln file
  • configuration (string): Build configuration (Debug/Release)
  • platform (string): Target platform (Any CPU/x86/x64)
  • restore (boolean): Restore NuGet packages

run_tests

Runs tests in a .NET test project.

Parameters:

  • path (string, required): Path to test project
  • filter (string): Test filter expression
  • verbose (boolean): Enable verbose output

run_project

Executes a .NET console application.

Parameters:

  • path (string, required): Path to project
  • args (array): Command line arguments
  • workingDirectory (string): Working directory

analyze_solution

Gets information about a solution structure.

Parameters:

  • path (string, required): Path to .sln file

list_packages

Lists NuGet packages in a project.

Parameters:

  • path (string, required): Path to project

Configuration Options

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"
  }
}

Available Configuration Settings

  • MsBuildPath: Path to MSBuild.exe or "auto" for automatic detection
  • DefaultConfiguration: Default build configuration (Debug/Release)
  • DefaultPlatform: Default target platform (Any CPU/x86/x64)
  • TestTimeout: Test execution timeout in milliseconds (default: 5 minutes)
  • BuildTimeout: Build timeout in milliseconds (default: 20 minutes)
  • EnableDetailedLogging: Enable verbose logging
  • PreferredVSVersion: Preferred Visual Studio version ("2022", "2019", or "auto")
  • UseDotNetCli: Use dotnet CLI instead of MSBuild/VSTest (default: false)
  • DotNetPath: Path to dotnet CLI executable (default: "dotnet")

Environment variables use the prefix MCPSERVER_, for example:

  • MCPSERVER_DefaultConfiguration=Release
  • MCPSERVER_EnableDetailedLogging=true

Troubleshooting

MSBuild Errors

  • Use run-tcp-server-vs2022.bat for explicit VS2022 MSBuild
  • Set environment variable: set MSBUILD_PATH=C:\Path\To\MSBuild\Bin
  • Ensure Visual Studio or Build Tools for Visual Studio is installed

WSL Connection Issues

WSL2 networking varies by configuration. Try these solutions:

# 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

Then update your bridge script to use the IP address instead of "localhost"

Port Already in Use

Change the port in both the server startup and bridge script.

Using dotnet CLI Instead of MSBuild

Enable dotnet CLI mode via configuration file (appsettings.json):

{
  "McpServer": {
    "UseDotNetCli": true
  }
}

Or via environment variable:

set MCPSERVER__UseDotNetCli=true

Note that the dotnet CLI has some limitations with older .NET Framework projects.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "dotnet-framework" '{"command":"/path/to/wsl-mcp-bridge.sh","env":{"MCP_DEBUG":"true"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "dotnet-framework": {
            "command": "/path/to/wsl-mcp-bridge.sh",
            "env": {
                "MCP_DEBUG": "true"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "dotnet-framework": {
            "command": "/path/to/wsl-mcp-bridge.sh",
            "env": {
                "MCP_DEBUG": "true"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later