Native.Mcp.ApiGateway
2.1.0
dotnet add package Native.Mcp.ApiGateway --version 2.1.0
NuGet\Install-Package Native.Mcp.ApiGateway -Version 2.1.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="Native.Mcp.ApiGateway" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Native.Mcp.ApiGateway" Version="2.1.0" />
<PackageReference Include="Native.Mcp.ApiGateway" />
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 Native.Mcp.ApiGateway --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Native.Mcp.ApiGateway, 2.1.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 Native.Mcp.ApiGateway@2.1.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=Native.Mcp.ApiGateway&version=2.1.0
#tool nuget:?package=Native.Mcp.ApiGateway&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Native.Mcp.ApiGateway
Direct API Gateway HTTP API v2 transport for Native.Mcp,
for Lambdas that front an MCP server without NativeLambdaRouter.
Prefer
Native.Mcp.NativeLambdaRouterfor new Swepay services — it reuses the shared routing/edge stack. Use this package when you want a minimal, router-free entry point.
Quickstart
using Amazon.Lambda.APIGatewayEvents;
using Amazon.Lambda.Core;
using Amazon.Lambda.RuntimeSupport;
using Amazon.Lambda.Serialization.SystemTextJson;
using Microsoft.Extensions.DependencyInjection;
using Native.Mcp;
using Native.Mcp.ApiGateway;
var services = new ServiceCollection();
services.AddNativeMcpServer(o =>
{
o.ServerName = "swepay-sample-mcp";
o.ServerVersion = "1.0.0";
o.AddDiscoveredTools(AppJsonContext.Default);
});
services.AddNativeMcpTelemetry();
services.AddNativeMcpApiGatewayHandler(); // registers McpLambdaHandler
await using var provider = services.BuildServiceProvider();
var mcp = provider.GetRequiredService<McpLambdaHandler>();
var serializer = new SourceGeneratorLambdaJsonSerializer<AppJsonContext>();
var handler = (APIGatewayHttpApiV2ProxyRequest req, ILambdaContext _) => mcp.HandleAsync(req);
await LambdaBootstrapBuilder.Create(handler, serializer).Build().RunAsync();
What's in the package
McpLambdaHandler— entry point: creates a per-invocation DI scope, adapts the proxy event, dispatches, and builds the proxy response.ApiGatewayRequestAdapter— decodes the body (base64 aware), extracts the bearer token,x-correlation-idandx-idempotency-key, and the JWT claims.ApiGatewayClaimsExtractor— pulls claims validated by the upstream JWT Authorizer.ApiGatewayResponseBuilder— wraps the dispatcher result into the proxy response.
Authentication is the API Gateway JWT Authorizer's job (edge); per-tool authorization lives in the
tools (McpExecutionContext.HasRole).
License
MIT.
| Product | Versions 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
- Amazon.Lambda.APIGatewayEvents (>= 3.0.0)
- Amazon.Lambda.Core (>= 3.1.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Native.Mcp (>= 2.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.