Nexus MCP

CommerceMind.Nexus.Mcp exposes Nexus operations as an MCP HTTP server. It is intended for tools and agents that need to inspect or operate Nexus jobs, queues, functions, health checks, and instances without calling the REST API directly.

The MCP package is opt-in. Installing or enabling CommerceMind.Nexus.Api does not automatically add the MCP server.

Setup

Install/reference the MCP package in the application that hosts Nexus:

<PackageReference Include="CommerceMind.Nexus.Mcp" Version="x.y.z" />

Then register the MCP services and map the endpoint:

using CommerceMind.Nexus;
using CommerceMind.Nexus.Api.Extensions;

builder.Services
    .AddNexus()
    .AddApi()
    .AddMcp(options =>
    {
        // This is the default value
        options.McpEndpoint = "nexus-mcp";

        // Only allow agents to read. Set this to false to allow agents to update, delete and run jobs and functions.
        // The default is true.
        options.ReadOnly = true;
    })
    .Build();

var app = builder.Build();

app.MapControllers();
app.MapNexusMcp();

Security

The MCP endpoint is an ASP.NET Core endpoint, not an MVC controller. The Nexus API authorization filter does not automatically protect it.

Protect it using normal ASP.NET Core middleware and endpoint conventions:

app.UseAuthentication();
app.UseAuthorization();

app.MapNexusMcp().RequireAuthorization();

Many MCP tools can mutate Nexus state, such as starting jobs or updating/deleting queue items. The typical setup is to require an API key for the MCP endpoint.