MCPPlugins.Abstractions 1.0.0

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

MCPPlugins.Abstractions

Shared abstractions for building plugins for an MCP host application.

This package provides the minimal contracts a plugin must implement so a host can discover plugin metadata, register plugin services, and expose MCP tool types.

Target framework

  • .NET 10

Package contents

IMcpToolPlugin

Required interface for every plugin.

It defines:

  • Name - plugin display name
  • Description - plugin description
  • ToolTypes - MCP tool class types contributed by the plugin
  • Register(IServiceCollection services) - registration point for non-MCP dependencies

Hosts can use ToolTypes to attach plugin tools to a shared MCP server builder.

IConfigurablePlugin

Optional interface for plugins that need configuration metadata.

If implemented, the host can call:

  • Configure(IConfiguration metadata)

before Register(...) to pass plugin-specific settings, for example from appsettings.json.

JsonSchema

Small helper for parsing JSON schema content into a JsonElement:

var schema = JsonSchema.Parse("""
{
  \"type\": \"object\",
  \"properties\": {
    \"query\": { \"type\": \"string\" }
  },
  \"required\": [\"query\"]
}
""");

Installation

dotnet add package MCPPlugins.Abstractions

Example plugin

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MCPPlugins.Abstractions;

public sealed class SamplePlugin : IMcpToolPlugin, IConfigurablePlugin
{
    private string? _endpoint;

    public string Name => "Sample Plugin";
    public string Description => "Provides sample MCP tools.";
    public IReadOnlyList<Type> ToolTypes => [typeof(SampleTool)];

    public void Configure(IConfiguration metadata)
    {
        _endpoint = metadata["Endpoint"];
    }

    public void Register(IServiceCollection services)
    {
        services.AddHttpClient();
        services.AddSingleton(new SampleOptions { Endpoint = _endpoint });
    }
}

public sealed class SampleOptions
{
    public string? Endpoint { get; init; }
}

public sealed class SampleTool
{
}

Host expectations

Plugin implementations should follow these rules:

  • Implement IMcpToolPlugin
  • Return the MCP tool classes from ToolTypes
  • Register only supporting services inside Register(...)
  • Do not create or configure the MCP server inside the plugin; the host owns that lifecycle
  • Optionally implement IConfigurablePlugin if configuration metadata is needed

Typical host flow

A host application will usually:

  1. Load the plugin assembly
  2. Create the plugin instance
  3. Call Configure(...) if the plugin implements IConfigurablePlugin
  4. Call Register(...) to register services
  5. Add each type from ToolTypes to the host's MCP server builder

License

MIT

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.

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.0 132 3/13/2026