C# Runner
fast, secure c# runner
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
Maintainer
Works with
Installation
Manual Installation
npx csharp-runnerConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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.ymlStart 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 -dVerify 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.
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"
}
}
}(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: 256MC# 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.
C# Runner Alternatives — Similar Developer Tools Servers
Looking for alternatives to C# Runner? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up C# Runner in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.