MCPify 0.0.4
See the version list below for details.
dotnet add package MCPify --version 0.0.4
NuGet\Install-Package MCPify -Version 0.0.4
<PackageReference Include="MCPify" Version="0.0.4" />
<PackageVersion Include="MCPify" Version="0.0.4" />
<PackageReference Include="MCPify" />
paket add MCPify --version 0.0.4
#r "nuget: MCPify, 0.0.4"
#:package MCPify@0.0.4
#addin nuget:?package=MCPify&version=0.0.4
#tool nuget:?package=MCPify&version=0.0.4
MCPify
MCPify is a library that bridges the gap between ASP.NET Core APIs and the Model Context Protocol (MCP). It allows you to effortlessly expose your existing REST endpoints (OpenAPI/Swagger) and internal Minimal APIs as MCP Tools, making them accessible to AI agents like Claude Desktop, Cursor, and others.
๐ Features
- OpenAPI Bridge: Automatically converts any Swagger/OpenAPI specification (JSON/YAML) into MCP Tools.
- Local Endpoint Bridge: Automatically discovers and exposes your application's ASP.NET Core Minimal APIs as MCP Tools.
- Zero-Config Stdio Support: Built-in support for standard input/output (Stdio) transport, perfect for local integration with AI desktop apps.
- HTTP (SSE) Support: Full support for Server-Sent Events (SSE) for remote or multi-client scenarios.
- Schema Generation: Automatic JSON schema generation for API parameters and request bodies.
๐ฆ Installation
Install the package via NuGet:
dotnet add package MCPify
๐ Quick Start
1. Setup in Program.cs
Configure MCPify in your ASP.NET Core application:
using MCPify.Core;
using MCPify.Hosting;
var builder = WebApplication.CreateBuilder(args);
// 1. Add MCPify Services
builder.Services.AddMcpify(options =>
{
// Choose Transport (Stdio for local tools, Http for remote)
options.Transport = McpTransportType.Stdio;
// Enable automatic discovery of local Minimal API endpoints
options.LocalEndpoints = new()
{
Enabled = true,
ToolPrefix = "local_" // Prefix for generated tools (e.g., local_get_user)
};
// (Optional) Register external APIs via Swagger
options.ExternalApis.Add(new()
{
SwaggerUrl = "https://petstore.swagger.io/v2/swagger.json",
ApiBaseUrl = "https://petstore.swagger.io/v2",
ToolPrefix = "petstore_"
});
});
var app = builder.Build();
// 2. Map your APIs as usual
app.MapGet("/api/users/{id}", (int id) => new { Id = id, Name = "John Doe" });
// 3. Register MCP Tools (Must be called after endpoints are mapped but before Run)
var registrar = app.Services.GetRequiredService<McpifyServiceRegistrar>();
await registrar.RegisterToolsAsync(((IEndpointRouteBuilder)app).DataSources);
// 4. Map the MCP Endpoint
app.MapMcpifyEndpoint();
app.Run();
2. Connect with Claude Desktop
To use your app as a local tool in Claude Desktop:
Publish your app to a single executable or DLL.
dotnet publish -c ReleaseUpdate your Claude config (
%APPDATA%\Claude\claude_desktop_config.json):{ "mcpServers": { "my-api": { "command": "dotnet", "args": [ "C:/Path/To/YourApp/bin/Release/net9.0/publish/YourApp.dll" ] } } }Restart Claude. Your API endpoints will now appear as tools (e.g.,
local_api_users_get)!
๐ Configuration
Transport Modes
- Stdio (
McpTransportType.Stdio): Default for local tools. Uses Standard Input/Output.- Note: Console logging is automatically disabled in this mode to prevent protocol corruption.
- Http (
McpTransportType.Http): Uses Server-Sent Events (SSE).- Default endpoints:
/sse(connection) and/messages(requests).
- Default endpoints:
Local Endpoints
MCPify inspects your application's routing table to generate tools.
Enabled: Set totrueto enable.ToolPrefix: A string to prepend to tool names (e.g., "api_").Filter: A function to select which endpoints to expose.
External APIs
Proxy external services by providing their OpenAPI spec.
SwaggerUrl: URL to theswagger.json.ApiBaseUrl: The base URL where API requests should be sent.DefaultHeaders: Custom headers (e.g., Authorization) to include in requests.OpenApiDownloadTimeout: Configurable timeout for downloading OpenAPI specifications. Defaults to 30 seconds.
Authentication
Secure your external or local endpoints using built-in authentication providers.
using MCPify.Core.Auth;
// ...
options.ExternalApis.Add(new()
{
// ...
Authentication = new ApiKeyAuthentication("api-key", "secret", ApiKeyLocation.Header)
});
// Supported Providers:
// - ApiKeyAuthentication(name, value, location)
// - BearerAuthentication(token)
// - BasicAuthentication(username, password)
๐งช Tests
To run the unit tests, navigate to the project root and execute the following command:
dotnet test Tests/MCPify.Tests/MCPify.Tests.csproj
The test suite covers:
- Core authentication providers (
ApiKeyAuthentication,BearerAuthentication,BasicAuthentication). - Integration of authentication with the
OpenApiProxyTool. - Basic functionality of the
OpenApiProxyTool(e.g., URL construction).
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License.
| Product | Versions 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 was computed. 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. |
-
net9.0
- Microsoft.OpenApi.Readers (>= 1.6.28)
- ModelContextProtocol (>= 0.4.1-preview.1)
- ModelContextProtocol.AspNetCore (>= 0.4.1-preview.1)
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 |
|---|---|---|
| 0.0.8-preview | 0 | 12/26/2025 |
| 0.0.7 | 66 | 12/23/2025 |
| 0.0.7-preview | 70 | 12/20/2025 |
| 0.0.6-preview | 109 | 12/13/2025 |
| 0.0.5-preview | 156 | 12/7/2025 |
| 0.0.4 | 621 | 12/3/2025 |
| 0.0.4-preview | 608 | 12/2/2025 |
| 0.0.3 | 613 | 12/3/2025 |
| 0.0.3-preview | 129 | 11/24/2025 |
| 0.0.2 | 614 | 12/2/2025 |
| 0.0.2-preview | 106 | 11/23/2025 |
| 0.0.1 | 112 | 11/23/2025 |
| 0.0.1-preview | 100 | 11/23/2025 |