SwaggerMcp 1.1.1

Suggested Alternatives

ZeroMCP

Additional Details

Package name changed. Alternate package ZeroMCP, is the same product with upgrades.

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

SwaggerMcp

Expose your ASP.NET Core API as an MCP (Model Context Protocol) server. Tag controller actions with [McpTool] or minimal APIs with .WithMcpTool(...); SwaggerMcp discovers them, builds JSON Schema for inputs, and exposes a single POST /mcp endpoint that speaks the MCP Streamable HTTP transport. Tool calls are dispatched in-process through your real pipeline (filters, validation, authorization run as normal).

Full documentation (configuration, governance, observability, minimal APIs, limitations): repository README or your GitLab repo root README.md.


Install

<PackageReference Include="SwaggerMcp" Version="1.0.2" />

Quick Start

1. Register and map

// Program.cs
builder.Services.AddSwaggerMcp(options =>
{
    options.ServerName = "My API";
    options.ServerVersion = "1.0.0";
});

// After UseRouting(), UseAuthorization()
app.MapSwaggerMcp();  // GET and POST /mcp

2. Tag controller actions

[HttpGet("{id}")]
[McpTool("get_order", Description = "Retrieves a single order by ID.")]
public ActionResult<Order> GetOrder(int id) { ... }

[HttpPost]
[McpTool("create_order", Description = "Creates a new order.")]
public ActionResult<Order> CreateOrder([FromBody] CreateOrderRequest request) { ... }

3. Optional: minimal APIs

app.MapGet("/api/health", () => Results.Ok(new { status = "ok" }))
   .WithMcpTool("health_check", "Returns API health status.");

If you use both controllers and minimal APIs, add builder.Services.AddEndpointsApiExplorer(); and app.MapControllers(); so controller tools are discovered.

Point any MCP client (e.g. Claude Desktop) at your app’s /mcp URL.


Configuration (summary)

Option Default Description
RoutePrefix "/mcp" Endpoint path
ServerName / ServerVersion Shown in MCP handshake
ForwardHeaders ["Authorization"] Headers copied to tool dispatch
ToolFilter null Discovery-time filter by tool name
ToolVisibilityFilter null Per-request filter (name, ctx) => bool
CorrelationIdHeader "X-Correlation-ID" Request/response correlation ID
EnableOpenTelemetryEnrichment false Tag Activity.Current with MCP tool details

Governance: Use [McpTool(..., Roles = new[] { "Admin" }, Policy = "RequireEditor")] or .WithMcpTool(..., roles: ..., policy: ...) to restrict which tools appear in tools/list per user.

Metrics: Implement IMcpMetricsSink and register it after AddSwaggerMcp() to record tool invocations (name, status code, duration, success/failure).


Versioning

We follow Semantic Versioning. Breaking changes are documented in the repository (e.g. VERSIONING.md).

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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

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
1.1.1 139 2/26/2026 1.1.1 is deprecated.
1.1.0 124 2/25/2026 1.1.0 is deprecated.
1.0.2 118 2/24/2026 1.0.2 is deprecated.
1.0.1 118 2/24/2026 1.0.1 is deprecated.
1.0.0 122 2/24/2026 1.0.0 is deprecated.