MagicOnion unifies RPC and bidirectional realtime messaging for .NET servers and clients, including Unity. C# interfaces define services without Protocol Buffers IDL files.
Overview
MagicOnion is an RPC framework for the .NET platform built on gRPC over HTTP/2. Instead of .proto schemas, shared C# interfaces act as the contract between server and client, serialized with MessagePack for arguments and results.
Servers run on .NET 8+ with ASP.NET Core and MagicOnion.Server; clients span .NET Framework 4.6.1 through .NET 8, Unity 2022.3 LTS and newer on Windows, macOS, iOS, Android, IL2CPP, and Mono. Unary services resemble Web API calls, while StreamingHub handles broadcast-style realtime channels comparable to SignalR-style use cases.
Quick-start material shows a minimal ASP.NET Core host, a shared interface, server implementation, and MagicOnionClient on the caller. The same stack can back microservice RPC, game networking, or combined API plus live updates.
Documentation covers Unity-specific client setup and deeper patterns on the project site.
Key features
- C# interfaces as RPC schemas
- gRPC transport with MessagePack payloads
- Unary services and StreamingHub realtime
- ASP.NET Core server integration
- Unity and .NET client support
- MagicOnion.Server and MagicOnion.Client packages
- DI, logging, and hosting via ASP.NET Core
- No .proto files required for contracts
Use cases
- Microservice RPC between .NET services
- Unity game clients calling a .NET backend
- Replace or complement WCF-style RPC
- Bidirectional realtime game or app sync
- Shared contracts across server and mobile .NET