McpEndpointsTools 1.0.0-alpha

This is a prerelease version of McpEndpointsTools.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package McpEndpointsTools --version 1.0.0-alpha
                    
NuGet\Install-Package McpEndpointsTools -Version 1.0.0-alpha
                    
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="McpEndpointsTools" Version="1.0.0-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="McpEndpointsTools" Version="1.0.0-alpha" />
                    
Directory.Packages.props
<PackageReference Include="McpEndpointsTools" />
                    
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 McpEndpointsTools --version 1.0.0-alpha
                    
#r "nuget: McpEndpointsTools, 1.0.0-alpha"
                    
#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.
#addin nuget:?package=McpEndpointsTools&version=1.0.0-alpha&prerelease
                    
Install McpEndpointsTools as a Cake Addin
#tool nuget:?package=McpEndpointsTools&version=1.0.0-alpha&prerelease
                    
Install McpEndpointsTools as a Cake Tool

MCP Endpoints Tools

Library for ASP.NET Core Web API, which automatically turns each controller method into a tool for the MCP server.

Under the hood, MCP Endpoints Tools uses the Model Context Protocol C# SDK for working with tools.

Description

MCP Endpoints Tools scans the application build, finds all controllers and their public methods marked with HTTP attributes, and registers them as Model Context Protocol (MCP) tools. In this case, XML comments from the assembly are used to fill in the description (summary) of the tools.

Features

  • Automatic registration of all controller methods as MCP tools and resources
  • Support for method exclusion via the [McpIgnore] attribute
  • Автоматическое добавление описания инструмента из XML-комментариев сборки через XmlCommentsProvider
  • Flexible configuration via ServerOptions (path, name, description, version, XML path)
  • Easy integration into 'IServiceCollectionandIEndpointRouteBuilder' via extensions ServiceCollectionExtensions and EndpointRouteBuilderExtensions

Installation

  1. Add the McpEndpointsTools project to your solution or connect via NuGet (if there is a package):

    dotnet add package McpEndpointsTools
    
  2. In the file Program.cs (or Startup.cs), register the services and mapping:

    using McpEndpointsServer.Extensions;
    
    var builder = WebApplication.CreateBuilder(args);
    
    // MCP Server registration and controller scanning
    builder.Services.AddMcpEndpointsServer(opts =>
    {
           opts.PipelineEndpoint = "/mcp"; // path for the HTTP pipeline
           opts.ServerName = "My MCP Server"; // server name
           opts.ServerDescription = "API for MCP"; // description
           opts.ServerVersion = "1.2.3"; // version
           opts.XmlCommentsPath = "MyApp.xml "; // path to the XML documentation file
           opts.HostUrl = "https://api.mysite "; // base URL
    });
    
  3. Set up routing in the same or another location:

    var app = builder.Build();
    
    app.MapControllers(); // regular controllers
    app.MapMcpEndpointsServer(); // MCP endpoints (HTTP stream & SSE)
    
    app.Run();
    

Attributes

  • McpIgnoreAttribute It is placed above the controller method to exclude it from the list of generated MCP tools.
  • Authorize Methods and controllers marked with the Authorize attribute will not be added to the tools. In future versions, support for authentication authorization may be added.

License

MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
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.0.10-alpha 62 5/17/2025
1.0.8-alpha 61 5/17/2025
1.0.6-alpha 78 5/17/2025
1.0.4-alpha 177 5/15/2025
1.0.0-alpha 178 5/13/2025

Add core structure and functionalities for MCP Endpoints Tools
Introduced the initial implementation of the MCP Endpoints Tools project, including foundational classes for server options, XML documentation handling, operation registration, and hosting setup. Added support for extension methods, dependency injection, and endpoint routing to facilitate server configuration and behavior. Included project structure, solution setup, and necessary `.gitignore` entries.