MCPPlugins.Abstractions
1.0.0
dotnet add package MCPPlugins.Abstractions --version 1.0.0
NuGet\Install-Package MCPPlugins.Abstractions -Version 1.0.0
<PackageReference Include="MCPPlugins.Abstractions" Version="1.0.0" />
<PackageVersion Include="MCPPlugins.Abstractions" Version="1.0.0" />
<PackageReference Include="MCPPlugins.Abstractions" />
paket add MCPPlugins.Abstractions --version 1.0.0
#r "nuget: MCPPlugins.Abstractions, 1.0.0"
#:package MCPPlugins.Abstractions@1.0.0
#addin nuget:?package=MCPPlugins.Abstractions&version=1.0.0
#tool nuget:?package=MCPPlugins.Abstractions&version=1.0.0
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 nameDescription- plugin descriptionToolTypes- MCP tool class types contributed by the pluginRegister(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
IConfigurablePluginif configuration metadata is needed
Typical host flow
A host application will usually:
- Load the plugin assembly
- Create the plugin instance
- Call
Configure(...)if the plugin implementsIConfigurablePlugin - Call
Register(...)to register services - Add each type from
ToolTypesto the host's MCP server builder
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. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.4)
- Microsoft.Extensions.DependencyInjection (>= 10.0.4)
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 |