A browser-based C# playground β write, compile, and run C# entirely client-side using the .NET 10 WebAssembly runtime and Roslyn. No server. No account. No install.
π Also includes an MCP Playground β a Model Context Protocol server + in-browser client that exposes
compile_and_runas a tool for VS Code, Claude Desktop, and any other MCP-aware client.
| π | Monaco-powered editor for a single Program.cs file with C# syntax highlighting, inline diagnostics, and error navigation. |
| Click Run to compile and execute your code inside a dedicated Web Worker running Roslyn and the .NET WebAssembly runtime, entirely in your browser. | |
| β¨οΈ | Supply buffered STDIN before running, and see captured stdout/stderr, exceptions, and timing breakdowns (compile / execute / total) in the output pane. |
| π | Automatic time/space Big-O complexity estimate (with rationale) for the code you just ran. |
| π§± | Resizable, swappable editor/I-O panes, focus modes, and fullscreen support. |
| πΎ | Editor preferences, theme (light/dark/system), and layout are persisted locally so your workspace is restored next time you visit. |
| β‘ | Keyboard shortcuts: Ctrl/Cmd+Enter to run, Shift+F5 to stop, Ctrl/Cmd+S to force-save locally, F11 to toggle fullscreen, plus Monaco's native Find/Replace and Undo/Redo. |
| π | Graceful recovery from runaway programs (e.g. infinite loops): Stop hard-terminates the worker and a fresh one takes its place. |
| π | A clear "unsupported browser" message if required capabilities (WebAssembly, Web Workers, Blob URLs, local storage) are missing, instead of a silent failure. |
codedotnet also ships a Model Context Protocol (MCP) server
(codedotnet-sandbox/) that exposes the exact same compile_and_run capability as a tool any
MCP-aware client (VS Code, Claude Desktop, Cursor, Continue, the browser, or a custom
JSON-RPC-over-stdio/WebSocket script) can call β reusing the same
CodeDotNet.Engine-backed WebAssembly artifact as the main playground, but isolated per-call in a
disposable, hard-timeout-enforced child process.
The MCP Playground tab in the web app is an in-browser client for this server over a
WebSocket transport (ws://127.0.0.1:7900 by default):
| π | Connect to any MCP WebSocket endpoint (defaults to the local sandbox) and see its Connected/Disconnected status live. |
| π§° | Discovered tools panel lists every tool the server advertises via tools/list, with its description. |
| π | Edit a single-file C# program in the same Monaco-powered editor used by the main playground. |
Call compile_and_run invokes the tool over JSON-RPC 2.0 and renders the parsed result: status (e.g. ExecutionCompleted, ExecutionCompletedWithWarnings), captured stdout, diagnostics/warnings with file/line/column, and a build / run / total timing breakdown. |
|
| π | A collapsible Raw JSON-RPC tools/call response section shows the exact wire payload for debugging or integrating your own MCP client. |
β οΈ Note: The live demo is a static GitHub Pages site and cannot run the MCP WebSocket sandbox server, so the MCP Playground tab will show Disconnected there. The sandbox (codedotnet-sandbox/) is a Node.js process that forks a pool of disposable child processes β each cold-booting the .NET WebAssembly runtime (~1.5-2s) β to isolate and hard-timeout everycompile_and_runcall. That's intentionally heavy for a hosted/serverless environment, so it is not deployed; you must run it locally (see below) to get a live MCP connection.
To try it locally:
# Terminal 1: start the MCP WebSocket server (ws://127.0.0.1:7900)
cd codedotnet-sandbox
npm install
npm run serve
# Terminal 2: start the web app
cd codedotnet.web
npm install
npm run devRequirements: Node.js 22+ for both processes, and the
.NET 10 SDK to publish the codedotnet.compiler
browser-wasm artifact the sandbox reuses (one-time step: dotnet publish -c Release codedotnet.compiler/codedotnet.compiler.csproj, or run scripts/copy-worker-assets.ps1).
Open the printed dev server URL, switch to the MCP Playground tab, click Connect, and
run the sample program. See
codedotnet-sandbox/README.md for the stdio transport, worker-pool
isolation model, and instructions for registering the server with VS Code, Claude Desktop,
Cursor, Continue, or any other MCP-aware/JSON-RPC client.
Prerequisites: .NET 10 SDK and Node.js 22+.
# Frontend (dev server with hot reload)
cd codedotnet.web
npm install
npm run dev
# Publish the compiler worker once so the frontend can load it locally
npm run build:workerThen open the printed local URL in your browser.
To produce a production build (as used for GitHub Pages deployment):
cd codedotnet.web
npm run build:worker:release
npm run build
| Path | Purpose |
|---|---|
π₯οΈ codedotnet.web/ |
React + TypeScript + Vite frontend (editor, shell, worker manager, complexity estimator). |
βοΈ codedotnet.compiler/ |
.NET 10 browser-wasm project: Roslyn compile host, execution host, JS interop. |
β
codedotnet.compiler.tests/ |
xUnit tests for the compiler/execution host logic (linked source, runs natively). |
π§° codedotnet-sandbox/ |
Node.js MCP server: stdio + WebSocket transports for a sandboxed compile_and_run tool. |
π€ .github/workflows/deploy.yml |
CI validation + GitHub Pages deployment workflow. |
π¦ .github/dependabot.yml |
Automated weekly dependency updates (npm, NuGet, GitHub Actions). |
π docs/ |
Architecture, testing, deployment, security, privacy, limitations, and ADRs. |
- ποΈ
docs/architecture.mdβ system architecture and component responsibilities. - π§ͺ
docs/testing.mdβ how to run and what each test suite covers. - π
docs/deployment.mdβ CI/CD and GitHub Pages deployment flow. - π
docs/custom-domains.mdβ DNS/CNAME guidance for custom domains. - π
docs/security.mdβ Content-Security-Policy, sandboxing model, dependency scanning. - π΅οΈ
docs/privacy.mdβ what happens to your code, and how to verify it yourself. β οΈ docs/known-limitations.mdβ buffered STDIN, single-file constraint, no NuGet restore, browser resource limits.- π
docs/adr/β Architecture Decision Records (ADR-001 through ADR-008). - π§©
codedotnet-sandbox/README.mdβ MCP server: architecture, isolation model, tool contract, and MCP client registration. - Β©οΈ
THIRD-PARTY-NOTICES.mdβ third-party license notices.
MIT β see LICENSE.

