Mugi 0.1.3

dotnet add package Mugi --version 0.1.3
                    
NuGet\Install-Package Mugi -Version 0.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mugi" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mugi" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Mugi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mugi --version 0.1.3
                    
#r "nuget: Mugi, 0.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mugi@0.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mugi&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Mugi&version=0.1.3
                    
Install as a Cake Tool

Mugi

Mugi is a fast, simple web application framework for .NET. Write handlers as lambdas, route requests, run middleware, bind and validate typed input, and read the request and write the response through one context object. It runs on Kestrel without WebApplication, the Generic Host, or a dependency injection container.

Mugi is built for NativeAOT. At runtime it uses no reflection, no assembly scanning, and no runtime code generation, so a published app starts in a few milliseconds and ships as a single small binary. Routing, JSON, and typed input binders are prepared at compile time by the Mugi.Generators package; referencing that package is enough.

Install

<ItemGroup>
  <PackageReference Include="Mugi" Version="0.1.3" />
  <PackageReference Include="Mugi.Generators" Version="0.1.3" />
</ItemGroup>

Add Mugi.Schema when the app uses typed input and validation. The packages target net9.0; building needs the .NET 9 SDK or newer.

Quick start

using Mugi;

var app = new App();

app.Get("/", static c => c.Text("Hello"));
app.Get("/users/:id", static c => c.Json(new User(c.Param("id"), "Ada")));

app.Run();

public sealed record User(string Id, string Name);

GET /users/42 returns {"id":"42","name":"Ada"}. The default port is 3000; the PORT environment variable changes the listener without touching the code.

What the package covers

  • Routing with :name and *name patterns, correct 404, 405, HEAD, and OPTIONS handling.
  • One context object for the request and the response: c.Param, c.Query, c.Req.Header, c.Req.Json<T>, c.Text, c.Json, c.Html, c.Stream, and more.
  • Onion-order middleware with app.Use, plus built-in factories: request logging, request IDs, secure headers, CORS, CSRF, Basic and Bearer auth, compression, ETag, and request timeouts.
  • Cookies with optional HMAC signing, form and multipart parsing, server-sent events, and WebSockets.
  • Static file serving with conditional requests, byte ranges, and precompressed siblings.
  • An in-process test client: app.Request("GET", "/users/42") runs the full pipeline without a server.
  • Typed contexts: derive from Context and use App<TContext> to pass values from middleware to handlers without string keys or casts.

Full documentation, benchmarks, and samples are at github.com/hckaye/Mugi.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Mugi:

Package Downloads
Mugi.Jwt

Native AOT-compatible JWT signing, validation, and authentication middleware for Mugi.

Mugi.Schema

Typed request binding and validation for Mugi.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.3 125 8/28/2026
0.1.2 115 8/28/2026