higherkindness/mu-scala
53.8
Adequate · 20 September 2026
5.8k
lines of production code
Scala
primary language
1
measurement over time
What this system is
mu-scala is a functional RPC library for Scala that enables the creation of gRPC services and clients using Protobuf and Avro serialization. It provides a modular architecture supporting both Scala 2 and 3, featuring type-safe configuration, client connection caching, and comprehensive observability through metrics and health checks. The system integrates deeply with the Cats Effect ecosystem, offering FS2-based streaming support, context-aware metadata propagation, and distributed tracing capabilities.
How it got here
2017–2018 — modular architecture and Scala 3 migration
10 changes.
The project underwent a comprehensive restructuring, rebranding to mu-scala and migrating its build infrastructure to support Scala 3 and a multi-module architecture. This period focused on decoupling the codebase into granular components for services, clients, and observability, while introducing modern lifecycle management for gRPC servers and type-safe configuration loading.
2019–2020 — RPC infrastructure and configuration expansion
13 changes.
This period focused on expanding the MU RPC library's core infrastructure by introducing a new configuration module for type-safe channel and server setup. It also added significant client-side features, including connection caching, Netty-specific channel building, and FS2-based streaming implementations with context-aware metadata propagation.
2022–2024 — Scala 3 migration and Avro support
13 changes.
This period focused on enabling cross-compilation for Scala 3 by introducing dedicated source directories and implementing Scala 3-specific encoders for Avro and gRPC. It also expanded the framework's capabilities with new features for request metadata context, distributed tracing via Natchez, and a standard health-check service, all supported by comprehensive test coverage for both Scala 2 and Scala 3 builds.
Features
Add TaggedDecimal type for precise Avro decimal handling
A new \TaggedDecimal\ opaque type has been introduced in the Avro module to replace previous Shapeless-based tagging. This type enforces precision and scale constraints at runtime, ensuring that decimal values conform to specific Avro schema requirements. Users can now create tagged decimals with guaranteed precision and scale validation, and the type includes built-in Avro4s encoders, decoders, and schema generators for seamless integration.
modules/service/src/main/scala-3/higherkindness/mu/rpc/avro · high confidence
Added Scala 2 and Scala 3 source directories for the service module
The service module now includes dedicated source directories for Scala 2 (\scala-2\) and Scala 3 (\scala-3\), enabling cross-compilation for both versions. The Scala 2 sources provide the core macro implementation for the \@service\ annotation, including the \serviceImpl\ macro, \RPCServiceModel\ for generating service definitions, and internal encoders for Protobuf and Java Time types. The Scala 3 sources provide the \channel\ package object, which defines \ManagedChannelOps\ and the \configureChannel\ helper for gRPC channel configuration.
modules/service/src/main/scala-2, modules/service/src/main/scala-3/higherkindness/mu/rpc/channel · high confidence
Added benchmarking infrastructure and documentation
The benchmarks module now includes a README with instructions for running JMH benchmarks manually or via scripts, along with Ruby helper scripts to execute individual or all benchmarks and aggregate results for comparison between the previous and next versions.
benchmarks · high confidence
Added example protocol definitions for Avro and gRPC
The microsite examples now include schema definitions for the Greeter service, providing concrete templates for users. An Avro protocol file (greeter.avdl) defines the request/response structure, while Protobuf files (greeter.proto and greeter/streaming.proto) define the service interface, including support for streaming RPCs.
microsite/examples/avro, microsite/examples/proto · high confidence
Added internal utility helpers for encoding/decoding primitives and time types
New internal utility objects have been added to the service module to handle serialization of common data types. BigDecimalUtil provides methods to convert BigDecimal values to and from byte arrays, preserving scale and precision. EncoderUtil offers utilities to convert Int and Long values to and from byte arrays using Java NIO ByteBuffers. JavaTimeUtil adds helpers to convert Java Time types (LocalDate, LocalDateTime, Instant) to and from compact integer or long representations (epoch days or milliseconds). These utilities support the internal encoding/decoding logic for RPC messages.
modules/service/src/main/scala/higherkindness/mu/rpc/internal/util · high confidence
Added support for ScalaPB message marshalling
Users can now automatically marshal ScalaPB generated messages in gRPC calls. This change introduces a new implicit marshaller for ScalaPB's GeneratedMessage types within the internal encoders module, enabling seamless serialization of these protocol buffer messages without requiring manual configuration.
modules/service/src/main/scala/higherkindness/mu/rpc/internal/encoders · high confidence
Adds gRPC tracing context propagation via Natchez
The service now includes implicit implementations for client and server tracing contexts, enabling automatic propagation of distributed tracing information (such as trace IDs and spans) within gRPC metadata. This allows users to integrate their RPC services with the Natchez tracing library, ensuring that spans are correctly continued or created across service boundaries without manual header management.
modules/service/src/main/scala/higherkindness/mu/rpc/internal/tracing · high confidence
Introduces GrpcServer abstraction with Resource-based lifecycle management
The server module now exposes a \GrpcServer\ trait that wraps the underlying gRPC server, providing a unified API for starting, shutting down, and querying server state. This change introduces \Resource\-based factory methods (\defaultServer\, \serverResource\) in the \GrpcServer\ companion object, allowing users to manage the server's lifecycle declaratively within cats-effect contexts. The implementation supports both default and Netty-specific transport layers via \default\ and \netty\ constructors, and includes helper methods like \server\ for running the server indefinitely.
modules/server/src/main/scala/higherkindness/mu/rpc/server · high confidence
Introduces ManagedChannelInterpreter for gRPC channel construction
A new ManagedChannelInterpreter class has been added to the service module to handle the creation and lifecycle management of gRPC ManagedChannel instances. This component allows users to configure channels via address or target, apply a list of channel configurations, and access the built channel through standard effects, unsafe execution with a dispatcher, or as a managed resource.
modules/service/src/main/scala/higherkindness/mu/rpc/channel · high confidence
Introduction of ConfigM trait for type-safe configuration loading
The \modules/config\ module now provides a \ConfigM\ trait within the \higherkindness.mu.rpc.config\ package, replacing the previous placeholder \Main\ object. This trait defines a \load\ method that returns a \F\[Config\]\, enabling asynchronous, effectful loading of Typesafe Config instances. An implicit \syncConfigM\ instance is provided for \cats.effect.Sync\ contexts, allowing users to seamlessly integrate Pureconfig-based configuration loading into their effect systems.
modules/config/src/main/scala/higherkindness/mu/rpc · high confidence
Introduction of ServerContext for request metadata handling
A new ServerContext trait has been added to the RPC service internals, allowing server-side context to be derived from incoming gRPC metadata. This enables users to access and utilize request metadata (such as headers) within their service implementations via a resource-managed context.
modules/service/src/main/scala/higherkindness/mu/rpc/internal/context · high confidence
Netty gRPC client channel configuration and build logic
The Netty client module now provides the implementation for building and configuring gRPC channels. This includes a \NettyChannelInterpreter\ that constructs \ManagedChannel\ instances from address, socket address, or target specifications, and applies a list of standard channel configurations. Additionally, Scala 2 and Scala 3 specific package objects expose a \configureNettyChannel\ function, allowing users to apply Netty-specific settings such as channel type, SSL context, keep-alive parameters, and event loop groups to the underlying Netty channel builder.
modules/client/netty · high confidence
New FS2 server call handlers with context support
The FS2 RPC server module now includes a new \handlers.scala\ file that provides server call handlers for unary, client-streaming, server-streaming, and bidi-streaming RPCs. These handlers leverage \Fs2ServerCallHandler\ and support Gzip compression. Additionally, new context-aware handlers (\contextClientStreaming\, \contextServerStreaming\, \contextBidiStreaming\) are introduced, which integrate with \ServerContext\ to allow RPC implementations to access and manage server-side context via \Kleisli\ transformers.
modules/fs2/src/main/scala/higherkindness/mu/rpc/internal/server · high confidence
New FS2-based client call implementations with context support
The FS2 client module now includes a new \calls.scala\ implementation that handles unary, client-streaming, server-streaming, and bidi-streaming RPC calls using \Fs2ClientCall\ and \Dispatcher\. Additionally, context-aware variants (\contextClientStreaming\, \contextServerStreaming\, \contextBidiStreaming\) are introduced, allowing RPC calls to operate within a \Kleisli\ context managed by \ClientContext\.
modules/fs2/src/main/scala/higherkindness/mu/rpc/internal/client · high confidence
New GRPCServiceDefBuilder for constructing gRPC service definitions
A new GRPCServiceDefBuilder object has been added to the internal service module, providing a functional way to build gRPC ServerServiceDefinition instances. This component allows users to define server methods by passing a sequence of method descriptors and handlers, handling the underlying gRPC builder operations within a Cats Effect Sync context.
modules/service/src/main/scala/higherkindness/mu/rpc/internal/service · high confidence
New GrpcServerHandler implementation for server lifecycle management
A new \GrpcServerHandler\ class has been added to the server handlers module, providing a concrete implementation of the \GrpcServer\ interface. This component wraps the underlying gRPC \Server\ instance, exposing lifecycle operations such as starting, shutting down, and checking termination status through the \GrpcServerOps\ effect type. It also provides access to registered service definitions, allowing users to inspect the server's configuration and state programmatically within the \cats-effect\ context.
modules/server/src/main/scala/higherkindness/mu/rpc/server/handlers · high confidence
New RPC benchmark suite for Protobuf and Avro serialization
Added a new shared benchmark module that measures the throughput of gRPC services using Protobuf and Avro serialization formats. The change introduces JMH benchmarks for a PersonService, including a composition-heavy scenario, alongside the necessary server runtime, protocol definitions, and in-memory persistence logic to support these performance tests.
benchmarks/shared · high confidence
New client caching mechanism for RPC connections
A new \ClientCache\ implementation has been added to the client module, providing a mechanism to cache and reuse RPC client instances. This feature allows clients to be created on demand and stored in a cache, with automatic cleanup of unused clients after a configurable idle timeout, reducing the overhead of establishing new connections repeatedly.
modules/client/cache · high confidence
New configuration module for MU RPC channels and servers
This change introduces a new \config\ module within the MU RPC library, providing structured configuration support for both client channels and servers. For channels, it adds \ChannelConfig\ and companion package objects (\channel.scala\) that allow users to load channel addresses (host/port) or targets from configuration files, with sensible defaults for localhost and standard ports. For servers, it adds \ServerConfig\ and companion package objects (\server.scala\) enabling the construction of \GrpcServer\ instances (including Netty-based servers) by reading port numbers from configuration. This provides a unified, type-safe way to configure RPC connectivity and server binding using Typesafe Config.
modules/config/src/main/scala/higherkindness/mu/rpc/config/channel · high confidence
New gRPC health-check service implementation
The health-check module now includes a new gRPC health service implementation. This adds a \HealthService\ trait and its \HealthServiceFS2Impl\ class, which manage service status via a reference map and a signaling reference. It exposes standard gRPC health-checking RPCs (\Check\ and \Watch\) defined in the newly added \health.proto\ file, allowing clients to query the serving status of specific services or the server as a whole, and to watch for status changes.
modules/health-check · high confidence
New implicit syntax for applying gRPC interceptors to service definitions
A new \implicits.scala\ file introduces the \InterceptorSyntax\ trait and \InterceptorOps\ value class, enabling a more ergonomic way to apply gRPC \ServerInterceptor\s to \ServerServiceDefinition\ instances via the \interceptWith\ method. This change allows users to chain interceptor application directly on service definitions using implicit conversions, simplifying server configuration code.
modules/server/src/main/scala/higherkindness/mu/rpc/server/interceptors · high confidence
New modular metrics, health-check, and configuration APIs
The library introduces dedicated modules for observability and configuration, allowing users to integrate with external monitoring systems and manage server/channel settings more flexibly. Users can now record metrics using Dropwizard or Prometheus via the new \DropWizardMetrics\ and \PrometheusMetrics\ implementations, which expose counters and histograms for active calls, message traffic, and latency. A new \MetricsServerInterceptor\ and \MetricsChannelInterceptor\ enable automatic instrumentation of server and client calls. Additionally, a rewritten health-check module provides \ServiceStatus\ reporting, while new \GrpcConfig\, \NettyChannelConfig\, and \ManagedChannelConfig\ data types offer a structured, composable way to configure gRPC server and client channels.
repository · high confidence
Support for contextual metadata propagation in gRPC client and server calls
The client and server internals now support passing contextual metadata through gRPC calls. On the client side, the new \HeaderAttachingClientCall\ merges extra headers into outgoing requests, and the \calls\ object provides a \contextUnary\ method that uses \ClientContext\ to attach this metadata. On the server side, the \handlers\ object introduces a \contextUnary\ handler that extracts context via \ServerContext\ and makes it available to the application logic. This enables features like distributed tracing or authentication tokens to be automatically propagated across RPC boundaries.
modules/service/src/main/scala/higherkindness/mu/rpc/internal/client · high confidence
Behavioural changes
Introduces Scala 3-specific Avro encoders for gRPC marshalling
The service module now includes a new Scala 3-specific implementation for Avro-based gRPC marshalling. This change adds \avro.scala\ to the \higherkindness.mu.rpc.internal.encoders\ package, providing \Marshaller\ instances for \Empty\ and generic Avro record types using \avro4s\. It supports both standard binary serialization and schema-aware data file formats, enabling the RPC framework to correctly encode and decode Avro messages in Scala 3 environments.
modules/service/src/main/scala-3/higherkindness/mu/rpc/internal · high confidence
Redesigns microsite navigation and visual theme
The documentation site now features a completely restructured navigation menu defined in \menu.yml\, organizing content into Introduction, Getting Started, Tutorials, How-To Guides, and Reference sections with specific entries for gRPC, Protobuf, and Avro workflows. Visually, the site adopts a new design system using the Montserrat font family and a primary brand color (\#001e38), supported by a new light-sidebar brand logo and updated SCSS styles for typography and code blocks.
microsite/src/main/resources · high confidence
Repository rebranding to mu-scala and infrastructure modernization
The project has been renamed from freestyle-rpc to mu-scala, updating all documentation, license headers, and contributor files to reflect the new identity. The build infrastructure has been modernized by migrating from Travis CI to GitHub Actions, removing the legacy .travis.yml and GPG signing keys, and introducing a .scala-steward.conf to manage dependency updates. Additionally, the Scala formatting configuration has been upgraded to scalafmt 3.9.4 with support for Scala 3 dialects, and the .gitignore has been expanded to cover modern IDE and build tool artifacts.
(repo-wide) · high confidence
Test coverage
Added Avro RPC and SSL integration tests; Added NoopServerCall test utility class; Added Scala 2 test suite for RPC macro annotations and protocol compatibility; Added test coverage for RPC module components; Added test utility for RPC metrics registration; Added testing utilities for gRPC interceptors and method descriptors; Added tests for Protobuf RPC and metrics interceptors; Added tests for channel and server configuration loading.
Dependencies
Major build infrastructure overhaul and dependency modernization
The project has been completely restructured with a modernized build system, upgrading sbt from version 0.13.15 to 1.11.6 and replacing the legacy sbt-freestyle plugin with sbt-mu-srcgen (0.34.0) for source generation. This change introduces a new ProjectPlugin that centralizes dependency management, updating core libraries such as gRPC to 1.75.0, Cats Effect to 3.6.3, and fs2 to 3.12.2, while also adding new plugins for cross-building (sbt-projectmatrix), benchmarking (sbt-jmh), and dependency analysis (sbt-missinglink).
project · high confidence
Reorganizes build into modular structure with Scala 3 support
The build system has been restructured from a simple two-module layout into a comprehensive multi-module architecture under a \modules\ directory, introducing distinct artifacts for service, client (Netty, OkHttp, cache), server, health-check, metrics (Prometheus, Dropwizard), and testing. This change upgrades the default Scala version to 3.4.3 (while maintaining 2.13.16 support) and switches to \projectMatrix\ for cross-building, enabling users to depend on granular, isolated components rather than a monolithic library.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 54.
Lenses
- Code Health 98
- Architecture 98
- Maturity 32
- Readiness 76
- Security 60
Changes since last survey
- 300 commits — 300 feature/other, 0 fixes
By area
- project/ProjectPlugin.scala — 184 commits
- project/plugins.sbt — 44 commits
- (root) — 37 commits
- project/build.properties — 24 commits
- modules/tests — 4 commits
- (repo) — 2 commits
- modules/haskell-integration-tests — 2 commits
- microsite/src — 1 commit
- modules/service — 1 commit
- modules/testing — 1 commit
Notable commits
- change: Adds some retries for the flaky tests (#1601)
- change: Bump sbt-microsites (#1600)
- change: Bumps Netty SSL (netty-tcnative-boringssl-static) (#1699)
- change: Merge pull request #1826 from higherkindness/remove-haskell-test
- change: Removes haskell tests
- change: Update avro4s-core to 4.1.1
- change: Update avro4s-core to 4.1.2
- change: Update avro4s-core to 5.0.10
- change: Update avro4s-core to 5.0.11
- change: Update avro4s-core to 5.0.13
- change: Update avro4s-core to 5.0.14
- change: Update avro4s-core to 5.0.4
- change: Update avro4s-core to 5.0.5
- change: Update avro4s-core to 5.0.6
- change: Update avro4s-core to 5.0.7
- change: Update avro4s-core to 5.0.8
- change: Update avro4s-core to 5.0.9
- change: Update cats-effect, cats-effect-testkit to 3.4.10
- change: Update cats-effect, cats-effect-testkit to 3.4.11
- change: Update cats-effect, cats-effect-testkit to 3.4.6
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
higherkindness/mu-scala was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 962060a6e8173617d70c85100d523a92b5fe22cf — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.