LabAcacia.McpIngress 1.0.0-alpha.16

Suggested Alternatives

LabAcacia.NPS.NWP.Bridge

Additional Details

architecture adjustment

This is a prerelease version of LabAcacia.McpIngress.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package LabAcacia.McpIngress --version 1.0.0-alpha.16
                    
NuGet\Install-Package LabAcacia.McpIngress -Version 1.0.0-alpha.16
                    
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="LabAcacia.McpIngress" Version="1.0.0-alpha.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LabAcacia.McpIngress" Version="1.0.0-alpha.16" />
                    
Directory.Packages.props
<PackageReference Include="LabAcacia.McpIngress" />
                    
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 LabAcacia.McpIngress --version 1.0.0-alpha.16
                    
#r "nuget: LabAcacia.McpIngress, 1.0.0-alpha.16"
                    
#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 LabAcacia.McpIngress@1.0.0-alpha.16
                    
#: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=LabAcacia.McpIngress&version=1.0.0-alpha.16&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LabAcacia.McpIngress&version=1.0.0-alpha.16&prerelease
                    
Install as a Cake Tool

English | 中文版

LabAcacia.McpIngress

NuGet License Release NCP NWP NIP NDP NOP

An ASP.NET Core library that turns one or more NPS NWP nodes into a single Model Context Protocol (MCP) server. MCP-speaking clients — Claude Desktop, IDE agents, the Anthropic SDK — can read from NWP Memory Nodes and invoke NWP Action Nodes without knowing anything about NPS.

  • Protocol: JSON-RPC 2.0 over HTTP POST (MCP 2024-11-05).
  • Target: .NET 10, ASP.NET Core.
  • NWP spec: spec/NPS-2-NWP.md v0.14 (Memory Node §5, Action Node §7).

What it does

MCP method NWP call Notes
initialize — Returns server info + capabilities (resources, tools).
resources/list GET /.nwm on every configured upstream Emits one resource per upstream where node_type == "memory".
resources/read POST /query with { "limit": N } Wraps the CapsFrame body as one MCP text content (MIME application/json).
tools/list GET /.nwm + GET /actions Emits one tool per action on upstreams with node_type in ("action", "complex").
tools/call POST /invoke Forwards arguments as the action params; isError=true on non-2xx.
ping — Keep-alive.

Addressing conventions:

  • Resource URIs: nwp://<upstream-name>/
  • Tool names: <upstream-name>__<action-id-with-dots-replaced-by-underscores>
    • Dots are forbidden in MCP tool names, so orders.create on upstream orders becomes orders__orders_create.

Install

dotnet add package LabAcacia.McpIngress

Quick start

using LabAcacia.NPS.McpIngress;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddMcpIngress(o =>
{
    o.ServerName    = "my-agent-gateway";
    o.ServerVersion = "1.0.0";
    o.Upstreams     = new[]
    {
        new NwpUpstream
        {
            Name       = "products",
            BaseUrl    = new Uri("https://memory.example.com/products"),
            AgentNid   = "urn:nps:nid:agent:my-gateway",
            AuthHeader = "Bearer <service-token>",
        },
        new NwpUpstream
        {
            Name    = "orders",
            BaseUrl = new Uri("https://action.example.com/orders"),
        },
    };
});

var app = builder.Build();
app.MapMcpIngress("/mcp");   // POST /mcp — JSON-RPC 2.0
app.Run();

Point any MCP client at https://<host>/mcp. No agent code needs to be changed.


Configuration

McpIngressOptions:

Property Default Purpose
ServerName labacacia-mcp-ingress serverInfo.name returned by initialize.
ServerVersion 0.1.0 serverInfo.version returned by initialize.
Upstreams (required, ≥1) List of NWP nodes to expose.
ResourceReadLimit 100 limit passed to /query when an MCP client calls resources/read.

NwpUpstream:

Property Purpose
Name Host segment in generated URIs / tool names. Must be unique.
BaseUrl Root URL where /.nwm, /actions, /query, /invoke are mounted.
AgentNid Sent as X-NWP-Agent on every call (optional).
AuthHeader Sent verbatim as the Authorization header on every call (optional).

Error mapping

Errors are returned as JSON-RPC 2.0 errors. In addition to the standard codes (-32700 parse, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal), the ingress defines:

Code Meaning
-32000 Upstream NWP node returned a non-success status.
-32001 Resource URI did not resolve to a configured upstream.
-32002 Tool name did not resolve to a configured upstream.

JSON-RPC notifications (requests without id) receive HTTP 204 No Content per the spec.


Testing

dotnet test tests/LabAcacia.McpIngress.Tests/LabAcacia.McpIngress.Tests.csproj

The test suite exercises every MCP handler against a fake NWP backend (HttpMessageHandler stubs) — no network required.


Further reading


License

Apache 2.0. See LICENSE and NOTICE at the repo root.

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.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated