PayrollEngine.Mcp.Core 0.10.0-beta.4

This is a prerelease version of PayrollEngine.Mcp.Core.
dotnet add package PayrollEngine.Mcp.Core --version 0.10.0-beta.4
                    
NuGet\Install-Package PayrollEngine.Mcp.Core -Version 0.10.0-beta.4
                    
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="PayrollEngine.Mcp.Core" Version="0.10.0-beta.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PayrollEngine.Mcp.Core" Version="0.10.0-beta.4" />
                    
Directory.Packages.props
<PackageReference Include="PayrollEngine.Mcp.Core" />
                    
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 PayrollEngine.Mcp.Core --version 0.10.0-beta.4
                    
#r "nuget: PayrollEngine.Mcp.Core, 0.10.0-beta.4"
                    
#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 PayrollEngine.Mcp.Core@0.10.0-beta.4
                    
#: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=PayrollEngine.Mcp.Core&version=0.10.0-beta.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PayrollEngine.Mcp.Core&version=0.10.0-beta.4&prerelease
                    
Install as a Cake Tool

Payroll Engine MCP Core

Part of the Payroll Engine open-source payroll automation framework. Full documentation at payrollengine.org.

Core infrastructure for building Payroll Engine MCP servers. Provides the base classes, isolation model, and permission system shared across all MCP server implementations — both read-only and write-enabled.


NuGet Package

Available as a private GitHub Package:

dotnet add package PayrollEngine.Mcp.Core

Overview

PayrollEngine.Mcp.Core is the foundation for any MCP server that exposes Payroll Engine data to AI agents. It defines:

  • Isolation model — tenant, division, and employee scoping enforced at the infrastructure level
  • Permission system — role-based tool visibility controlled at startup
  • ToolBase — abstract base class for all MCP tool classes; provides typed service factories, identifier resolvers, isolation-aware query helpers, and uniform error handling
  • ToolRegistrar — filters tool classes by role permission and isolation level compatibility at registration time

Isolation Level

Controls which records are returned at runtime. Enforcement is server-side and cannot be bypassed by the AI agent.

Value Description
MultiTenant Full access across all tenants (default)
Tenant All tool calls scoped to a single configured tenant
Division Scoped to a single division within a tenant. Requires TenantIdentifier and DivisionName.
Employee Self-service — single employee access. Requires TenantIdentifier and EmployeeIdentifier.

Roles and Permissions

Controls which tools are registered at startup. Each tool class is tagged with a [ToolRole] attribute declaring its role and minimum permission. A tool whose role is not granted is never registered — invisible to the AI agent.

Role Domain
HR Employee master data and case values
Payroll Payroll execution and results
Report Report execution
System Tenant and user management
Permission Description
None Tools not registered
Read Query tools registered (default)

Role × Isolation Level Compatibility

= role applicable = not applicable at this isolation level

Role MultiTenant Tenant Division Employee
HR
Payroll
Report
System

Architecture

IsolationContext

Singleton populated at startup from appsettings.json or environment variables. Holds the active IsolationLevel, tenant/division/employee identifiers, and McpPermissions. Injected into every tool class via the constructor.

ToolBase

Abstract base class for all MCP tool classes. Constructor injection: PayrollHttpClient + IsolationContext.

Key capabilities:

Category Members
Query helpers ActiveQuery, IsolatedTenantQuery, IsolatedEmployeeQuery, IsolatedPayrollQueryAsync, IsolatedDivisionQueryAsync
Isolation guards FilterEmployeesByIsolation, AssertEmployeeInDivision
Resolvers ResolveTenantAsync, ResolveEmployeeAsync, ResolveDivisionAsync, ResolvePayrollContextAsync, ResolveLookupContextAsync, ResolveReportAsync
Service factories TenantService, EmployeeService, PayrollService, PayrunJobService, ReportService, and more
Error handling Error(Exception) — serializes exceptions as structured JSON for MCP clients

ToolRegistrar

Scans an assembly for classes decorated with [McpServerToolType] and filters them by:

  1. [ToolRole] attribute — role and minimum permission check
  2. Role × IsolationLevel compatibility matrix

Classes without [ToolRole] are always registered (e.g. ServerInfoTools).

ToolRoleAttribute

Applied to MCP tool classes to declare their role and minimum required permission:

[McpServerToolType]
[ToolRole(McpRole.HR, McpPermission.Read)]
public sealed class EmployeeQueryTools(PayrollHttpClient http, IsolationContext iso)
    : ToolBase(http, iso) { ... }

Extending: Building a Custom MCP Server

Any MCP server — read-only or write-enabled — inherits the full infrastructure by referencing this package:

<PackageReference Include="PayrollEngine.Mcp.Core" Version="0.10.0-beta.3" />

A write tool follows the same pattern as a read tool:

[McpServerToolType]
[ToolRole(McpRole.Payroll, McpPermission.Read)]
public sealed class CaseChangeTools(PayrollHttpClient http, IsolationContext iso)
    : ToolBase(http, iso)
{
    [McpServerTool(Name = "create_case_change")]
    public async Task<string> CreateCaseChangeAsync(...)
    {
        try
        {
            var (context, employee) = await ResolveEmployeeAsync(...);
            // write logic
        }
        catch (Exception ex) { return Error(ex); }
    }
}

All isolation enforcement, resolver logic, and error handling are inherited automatically.


Repository Description
PayrollEngine.Mcp.Tools Read-only MCP tools built on this library
PayrollEngine.Mcp.Server Hosted MCP server using Core and Tools
PayrollEngine.Client.Core Payroll Engine REST API client

License

MIT License — free for personal and commercial use.

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 (1)

Showing the top 1 NuGet packages that depend on PayrollEngine.Mcp.Core:

Package Downloads
PayrollEngine.Mcp.Tools

Payroll Engine MCP tools

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.10.0-beta.4 33 4/1/2026