csharp-code-sandbox-mcp

csharp-code-sandbox-mcp

3.1

If you are the rightful owner of csharp-code-sandbox-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A C#–based Model Context Protocol (MCP) server that executes arbitrary C# scripts.

C# Code Sandbox MCP

A C#–based Model Context Protocol (MCP) server that executes arbitrary C# scripts.

Prerequisites

This project depends on the dotnet-script tool. Ensure it is installed globally on your system:

# Install dotnet-script globally
> dotnet tool install dotnet-script -g

Building the Project

To build the project, navigate to the root directory and run:

> dotnet build

Running the Server

To run the server, you need to configure the AI agent with the following settings:

"mcp": {
    "servers": {
        "CSharpSandBox": {
            "type": "stdio",
            "command": "dotnet",
            "args": [
                "run",
                "--project",
                "{PROJECT-PATH}\\csharp-code-sandbox-mcp\\src\\MCPServer\\MCPServer.csproj",
                "--no-build"
            ]
        }
    }
}

Replace {PROJECT-PATH} with the absolute path to the project directory.

Acknowledgments

Thanks to the project node-code-sandbox-mcp by alfonsograziano for the inspiration behind this work.

License

This project is licensed under the MIT License. See the file for details.