C# Runner

v1.0.0Developer Toolsstable

fast, secure c# runner

csharpmcpmcp-server
Share:
109
Stars
0
Downloads
0
Weekly
0/5

What is C# Runner?

C# Runner is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to fast, secure c# runner

fast, secure c# runner

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • fast, secure c# runner

Use Cases

Execute C# code snippets safely and securely through MCP.
Run compiled C# applications from Claude.
sdcb

Maintainer

LicenseMIT
Languagec#
Versionv1.0.0
UpdatedApr 12, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx csharp-runner

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use C# Runner

C# Runner is a high-performance, Docker-based platform for securely executing C# code online, exposed to AI clients via an MCP interface. Built on a Host-Worker architecture, it isolates each code execution in a separate Docker Worker container with CPU, memory, and network restrictions, then streams real-time output back to the caller via Server-Sent Events. AI clients connect to the Host's /mcp endpoint and invoke the run_code tool, enabling Claude and other LLMs to write and immediately test C# code in a safe sandbox — dramatically reducing the feedback loop when generating .NET code.

Prerequisites

  • Docker and Docker Compose installed and running on your machine or server
  • An MCP-compatible client that supports HTTP/SSE MCP transport: Claude Desktop (with server-side SSE support), Cursor, or any HTTP MCP client
  • Network access to the Host service on port 5050 (default)
  • Sufficient system resources for running Docker containers (recommended: at least 2 GB RAM)
1

Download the Docker Compose file

Download the official docker-compose.yml which defines the Host service (public API + MCP endpoint) and Worker services (isolated code execution containers). Workers auto-register with the Host on startup.

curl -L https://raw.githubusercontent.com/sdcb/csharp-runner/refs/heads/master/docker-compose.yml -o docker-compose.yml
2

Start all services

Launch the Host and Workers in detached mode. By default this starts 3 Worker replicas, each limited to 0.5 CPU and 256 MB RAM. The web UI will be available at http://localhost:5050.

docker compose up -d
3

Verify the deployment

Open http://localhost:5050 in your browser to access the web UI. You should see a code editor where you can run C# snippets interactively. The MCP endpoint is at http://localhost:5050/mcp.

4

Configure your MCP client to connect to the server

Add C# Runner to your MCP client configuration using the HTTP transport type pointing to the local MCP endpoint. This works for clients that support Streamable HTTP MCP servers.

{
  "mcpServers": {
    "csharp-runner": {
      "url": "http://localhost:5050/mcp",
      "type": "http"
    }
  }
}
5

(Optional) Scale Workers or adjust resource limits

Edit docker-compose.yml to increase Worker replicas for higher concurrency, or adjust CPU/memory limits. You can also set MaxRuns to automatically recycle workers after N executions, keeping containers clean.

# In docker-compose.yml, under worker -> deploy:
replicas: 5
resources:
  limits:
    cpus: '0.50'
    memory: 256M

C# Runner Examples

HTTP MCP client configuration

Add this to your MCP client config to connect to a locally running C# Runner instance. Adjust the URL if running on a remote server.

{
  "mcpServers": {
    "csharp-runner": {
      "url": "http://localhost:5050/mcp",
      "type": "http"
    }
  }
}

Prompts to try

Use these prompts in your AI client to have it write and immediately execute C# code via the run_code MCP tool.

- "Write a C# program that calculates prime numbers up to 1000 using the Sieve of Eratosthenes, then run it"
- "Create a C# method that parses a JSON string and counts the keys, then test it"
- "Write a LINQ query in C# that filters a list of numbers to only even values and returns the sum"
- "Generate C# code to make an HTTP GET request to https://httpbin.org/get and print the response body"
- "Write and run a C# snippet that demonstrates async/await with Task.WhenAll"

Troubleshooting C# Runner

docker compose up -d fails with 'port 5050 already in use'

Another process is using port 5050 on your machine. Edit docker-compose.yml and change the host port mapping from 5050:8080 to an available port (e.g. 5051:8080), then update your MCP client config URL accordingly.

Workers do not appear in the Host's worker pool (no execution happens)

Workers need the RegisterHostUrl environment variable to point to the Host container. The default docker-compose.yml sets this to http://host:8080 — ensure you have not changed the Host container name. Run docker compose logs worker to see if registration errors appear.

Code execution returns a timeout error

The default MaxTimeout is 30000 ms (30 seconds). For long-running code, set the MaxTimeout environment variable on the Worker service in docker-compose.yml. Also ensure the Worker container has enough CPU — if cpus is set too low, compilation and startup may exceed the limit.

Frequently Asked Questions about C# Runner

What is C# Runner?

C# Runner is a Model Context Protocol (MCP) server that fast, secure c# runner It connects AI assistants to external tools and data sources through a standardized interface.

How do I install C# Runner?

Follow the installation instructions on the C# Runner GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with C# Runner?

C# Runner works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is C# Runner free to use?

Yes, C# Runner is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "csharp-runner": { "command": "npx", "args": ["-y", "csharp-runner"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use C# Runner?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides