Elarion 0.2.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Elarion --version 0.2.0
                    
NuGet\Install-Package Elarion -Version 0.2.0
                    
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="Elarion" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Elarion" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Elarion" />
                    
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 Elarion --version 0.2.0
                    
#r "nuget: Elarion, 0.2.0"
                    
#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 Elarion@0.2.0
                    
#: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=Elarion&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Elarion&version=0.2.0
                    
Install as a Cake Tool

<div align="center">

<picture> <source media="(prefers-color-scheme: dark)" srcset="docs/public/brand/elarion-banner-transparent-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="docs/public/brand/elarion-banner-transparent-light.svg"> <img src="docs/public/brand/elarion-banner-transparent-light.svg" width="640" alt="Elarion — Application framework for .NET"> </picture>

Module-based handler pipelines, compile-time registration, JSON-RPC hosting, MCP tools for AI agents, and scheduled jobs.

Declare intent next to your code; let source generators do the wiring. No runtime reflection scanning.

AI-native by design: the same handlers that power your API are exposed to AI agents as MCP tools — generated from your code at compile time, with no separate tool definitions or duplicated schemas.

CI NuGet npm .NET License

</div>


Elarion's central idea is simple: your application assemblies define modules and handlers; your host assembly only wires infrastructure, transport, and deployment. Everything that can be discovered from your code — handlers, validators, services, scheduled jobs, RPC methods, EF Core DbSets — is emitted by source generators at compile time instead of scanned by reflection at startup.

[RpcMethod("clients.get")]
public sealed class GetClient(IAppDbContext db)
    : IHandler<GetClient.Query, Result<GetClient.Response>> {
    public sealed record Query(Guid Id);
    public sealed record Response(Guid Id, string Name);

    public async ValueTask<Result<Response>> HandleAsync(Query query, CancellationToken ct) {
        var client = await db.Clients
            .Where(c => c.Id == query.Id)
            .Select(c => new Response(c.Id, c.Name))
            .FirstOrDefaultAsync(ct);

        return client is null
            ? AppError.NotFound($"Client {query.Id} was not found.")
            : client;
    }
}

That one class is a use case, a registered service, a JSON-RPC method, an MCP tool for AI agents, and (optionally) a schema-exported TypeScript contract — with no entry added to any Program.cs registration list.

Why Elarion

  • Compile-time, not reflection — handlers, services, validators, modules, RPC maps, and scheduled jobs become ordinary DI code. Startup is deterministic and AOT-friendly; missing wiring is a build error, not a runtime surprise.
  • Modules own their surface — a module is a namespace plus an [AppModule] marker. Add a handler under it and the module publishes it automatically.
  • Transport-neutral results — handlers return Result<T> with a transport-agnostic AppError; the host maps failures to JSON-RPC, HTTP, or anything else.
  • End-to-end JSON-RPC — mark a handler with [RpcMethod], export a schema at build time, and generate a typed TypeScript + Zod client.
  • AI-native, no extra code — expose the same [RpcMethod] handlers to AI agents as an MCP server, an independent transport with its own dispatcher. Tool names, descriptions, and input schemas are generated from your handlers and [Description] attributes at compile time — no separate tool layer, no duplicated schemas, no runtime reflection. Choose a handler's transports with [RpcMethod(Transports = …)] (JSON-RPC, MCP, or both) and rename a tool with [McpMethod].
  • In-process scheduling — source-generated scheduled jobs with explicit overlap, misfire, and resilience policies.
  • Observable by default — JSON-RPC, scheduling, caching, and resilience emit OpenTelemetry-compatible traces and metrics through System.Diagnostics, with no SDK dependency forced on you.

Install


<ItemGroup>
  <PackageReference Include="Elarion" Version="0.1.0" />
  <PackageReference Include="Elarion.Generators" Version="0.1.0" PrivateAssets="all" />
</ItemGroup>
// Turn the generators on, once per assembly
[assembly: UseElarion]

The Quickstart builds a module, a handler, and a working JSON-RPC endpoint end to end.

Packages

Package Purpose
Elarion.Abstractions Attributes and contracts: [AppModule], [Service], [ScheduledJob], IHandler<,>, Result<T>, AppError.
Elarion Runtime primitives: handler caches, decorators, the in-memory scheduler, resilience runtime, current-user access.
Elarion.Blobs Provider-neutral blob storage contracts and DTOs.
Elarion.Blobs.PostgreSql PostgreSQL-backed blob storage with EF Core model configuration and Npgsql content I/O.
Elarion.Generators Roslyn generators for handlers, services, validators, modules, RPC maps, HTTP endpoint maps, resilience policies, and scheduled jobs.
Elarion.JsonRpc Transport-neutral JSON-RPC dispatcher, envelopes, telemetry, and schema export.
Elarion.AspNetCore ASP.NET Core JSON-RPC endpoint mapping, [HttpEndpoint] minimal-API mapping, batch execution, and current-user middleware.
Elarion.AspNetCore.Mcp Exposes your JSON-RPC handlers as a Model Context Protocol (MCP) server for AI agents, over Streamable HTTP.
Elarion.AspNetCore.SchemaGeneration MSBuild package that exports rpc-schema.json during dotnet build.
Elarion.EntityFrameworkCore Marker attributes for generated DbSets and entity inclusion.
Elarion.EntityFrameworkCore.Generators Roslyn generator for DbSet properties and entity configuration.
@swimmesberger/elarion-jsonrpc-client-generator TypeScript CLI that turns a schema export into method contracts, Zod schemas, and a fetch client.

Documentation

Full guides live in docs/ and are structured for a documentation site:

Requirements

  • .NET 10 SDK or later
  • ASP.NET Core for the JSON-RPC HTTP transport
  • Node.js 18+ for the TypeScript client generator

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for the development workflow, validation commands, architecture boundaries, and the publishing process. By participating you agree to the Code of Conduct.

Security

Please report vulnerabilities privately — see the security policy.

License

Elarion is licensed under the Apache License 2.0.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 Elarion:

Package Downloads
Elarion.AspNetCore

ASP.NET Core integration for Elarion — JSON-RPC endpoint mapping, identity, batch dispatch, and HTTP transport support.

Elarion.Messaging.InMemory

The simple, best-effort in-memory integration-event (Plane B) bus for Elarion, commit-gated by the EF Core DbContext transaction. A non-durable sibling of the EF Core outbox: buffered per scope, flushed to an in-process delivery pump after commit and discarded on rollback via EF Core interceptors. Events flushed but undelivered at process exit are lost; use the outbox for at-least-once durability.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.1-preview.16.1 0 6/24/2026
0.2.1-preview.15.1 0 6/24/2026
0.2.1-preview.14.1 0 6/24/2026
0.2.1-preview.13.1 0 6/24/2026
0.2.1-preview.12.1 0 6/24/2026
0.2.0 76 6/19/2026
0.1.2-preview.11.1 0 6/24/2026
0.1.1-preview.10.1 0 6/24/2026
0.1.0-preview.42.1 28 6/23/2026
0.1.0-preview.41.1 30 6/23/2026
0.1.0-preview.40.1 48 6/23/2026
0.1.0-preview.38.1 52 6/21/2026
0.1.0-preview.37.1 63 6/21/2026
0.1.0-preview.36.1 53 6/21/2026
0.1.0-preview.35.1 45 6/20/2026
0.1.0-preview.34.1 51 6/20/2026
0.1.0-preview.33.1 49 6/19/2026
0.1.0-preview.5.1 17 6/23/2026
0.1.0-preview.4.1 18 6/23/2026
0.1.0-preview.3.1 19 6/23/2026
Loading failed