Nall.Hangfire.Mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Nall.Hangfire.Mcpshow me the current Hangfire statistics"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Nall.Hangfire.Mcp
Remote MCP server for Hangfire — exposes background jobs as MCP tools, in-process with the Hangfire server.
📖 Documentation: https://nikiforovall.github.io/hangfire-mcp-dotnet/
Design
In-process. Runs inside the ASP.NET host that runs Hangfire. No out-of-process assembly loading.
Remote. Streamable HTTP endpoint at
/mcp. Any MCP client (VS Code, Claude Desktop, custom agents) can connect.Zero ceremony. No attributes, no shim interfaces — discovery reads what you already register with Hangfire.
Schema from
MethodInfo. JSON Schema generated per method. Required vs. optional respects both C# defaults and nullable annotations (int?,string?).
Related MCP server: LSP-MCP
Getting started
Install:
dotnet add package Nall.Hangfire.McpMinimum host setup — three lines on top of an existing Hangfire app:
builder.Services.AddHangfireMcp(); // registers MCP server + JobCatalog
var app = builder.Build();
app.MapHangfireMcp("/mcp"); // streamable HTTP endpointFull minimal example:
using Hangfire;
using Nall.Hangfire.Mcp;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHangfire(cfg => cfg.UsePostgreSqlStorage(...));
builder.Services.AddHangfireServer();
builder.Services.AddHangfireMcp();
var app = builder.Build();
app.MapHangfireDashboard();
app.MapHangfireMcp("/mcp");
app.Services.GetRequiredService<IRecurringJobManager>()
.AddOrUpdate<IReportJob>("report.daily", j => j.GenerateAsync(2026, "pdf", null), Cron.Daily);
app.Run();Every recurring job is now an MCP tool: Run_report.daily with a JSON Schema derived from GenerateAsync's parameters.
VS Code MCP config:
{
"servers": {
"hangfire": { "url": "https://your-host/mcp" }
}
}Discovery sources
Source | What it sees | When to use |
|
| Every recurring job is a tool. |
| Compile-time scan of | Expose helper methods you only ever one-shot enqueue, or jobs not yet registered as recurring. |
| Union of both, deduped by | Most apps. |
Configure via AddHangfireMcp:
builder.Services.AddHangfireMcp(o =>
{
o.Sources = JobDiscoverySources.All; // default: RecurringStorage
o.Filter = rj => rj.Id.StartsWith("public."); // optional storage filter
});To populate the manifest, install the generator package in each project that contains Hangfire registration calls:
dotnet add package Nall.Hangfire.Mcp.GeneratorBuilt-in maintenance tools
Every MCP server hosted by AddHangfireMcp() also exposes a fixed set of hangfire_* tools for inspecting and managing jobs alongside the dynamic Run_* tools:
Tool | Purpose |
| Global counters: Enqueued/Failed/Processing/Scheduled/Succeeded/Deleted/Recurring/Retries/Servers. |
| Page jobs by |
| Full details + state history for one id. |
| Move one job to Deleted. |
| Requeue one job (covers retry of Failed). |
| Bulk delete by |
| Bulk requeue by |
Filter shape (used by list_jobs, delete_jobs, requeue_jobs):
{
"state": "Failed",
"queue": "default",
"jobType": "ReportJob",
"method": "Generate",
"messageContains": "timeout",
"exceptionContains": "SqlException"
}jobType and method are case-insensitive substring matches. messageContains / exceptionContains are most useful for Failed.
Parameter binding
For each tool call:
C# default → used when the argument is omitted.
Nullable type (
T?value or annotated reference) and no default → bound tonullwhen omitted.Otherwise required; missing argument returns an MCP error.
Authentication
MapHangfireMcp returns IEndpointConventionBuilder — the library is auth-agnostic. Chain any ASP.NET Core auth scheme:
app.MapHangfireMcp("/mcp")
.RequireAuthorization(p => p.RequireAuthenticatedUser()
.AddAuthenticationSchemes(McpAuthenticationDefaults.AuthenticationScheme));OAuth 2.1 / OIDC —
samples/Webwires Keycloak + JwtBearer +AddMcp()fromModelContextProtocol.AspNetCore.Authenticationto advertise RFC 9728 protected-resource-metadata. End-to-end flow, standards, and gotchas: docs/authentication.md.API keys / custom schemes — nothing MCP-specific required. Implement an
AuthenticationHandler<T>, register it, and pass its scheme toRequireAuthorizationabove. TheRun_*andhangfire_*tools work the same regardless of how the principal got there.
Sample
samples/Web exercises overloads, complex objects, enums, collections, defaults, nullable optionals, and manifest-only one-shot jobs. GET /jobs lists the discovered catalog.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server to read and manage your Atako AI agents, messages, files, and integrations.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceConverts VSCode into an MCP server that enables external clients to remotely execute VSCode internal commands, query workspace information, and interact with the editor through HTTP streaming. Built on the FastMCP framework with security controls and real-time monitoring.63-
- FlicenseAqualityDmaintenanceMinimal MCP server bridging a Roslyn C# language server to AI agents, exposing tools for diagnostics, call hierarchy, and type hierarchy.1-
- AlicenseNot gradedqualityCmaintenanceEnables monitoring and managing Hangfire background jobs, including job lists, retries, recurring tasks, and statistics, directly from VS Code Copilot and other MCP clients.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with VS Code's language server protocol features (definitions, references, diagnostics) and debugger (breakpoints, stepping, variable inspection) via an MCP server.121MIT