MonumentalSystems.Mcp
0.1.10
dotnet add package MonumentalSystems.Mcp --version 0.1.10
NuGet\Install-Package MonumentalSystems.Mcp -Version 0.1.10
<PackageReference Include="MonumentalSystems.Mcp" Version="0.1.10" />
<PackageVersion Include="MonumentalSystems.Mcp" Version="0.1.10" />
<PackageReference Include="MonumentalSystems.Mcp" />
paket add MonumentalSystems.Mcp --version 0.1.10
#r "nuget: MonumentalSystems.Mcp, 0.1.10"
#:package MonumentalSystems.Mcp@0.1.10
#addin nuget:?package=MonumentalSystems.Mcp&version=0.1.10
#tool nuget:?package=MonumentalSystems.Mcp&version=0.1.10
MonumentalSystems.Mcp
Model Context Protocol (MCP) client library for Microsoft Extensions.AI. Provides extensible transport providers for connecting to MCP servers and exposing tools as AIFunction instances.
Overview
MonumentalSystems.Mcp is a lightweight MCP client that integrates with the Microsoft Extensions.AI (AIFunction) ecosystem. It supports:
- HTTP transport with SSE streaming and session tracking
- Stdio transport for subprocess-based MCP servers
- Custom transport providers for extensibility (e.g., tunneled transports)
- Dynamic AIFunction generation via Reflection.Emit for proper schema discovery
Quick Start
Prerequisites
Installation
dotnet add package MonumentalSystems.Mcp
Usage
using MonumentalSystems.Mcp;
// Configure an MCP server
var config = new McpServerConfig
{
Type = "http",
Url = "http://localhost:8080/mcp"
};
// Create client
var client = new McpClient(config, httpClient, logger);
// Initialize and list tools
await client.InitializeAsync();
var tools = await client.ListToolsAsync();
// Create AIFunction instances from MCP tools
var functions = await McpAIFunctionFactory.CreateFromMcpClientAsync(client, logger);
Architecture
MonumentalSystems.Mcp/
├── McpClient.cs # Core client with transport provider pattern
├── McpConfig.cs # Configuration models
├── McpModels.cs # JSON-RPC models, tool definitions
├── McpAIFunctionFactory.cs # MCP tools -> AIFunction via Reflection.Emit
├── McpStdioTransport.cs # Stdio subprocess transport
├── McpHttpTransport.cs # HTTP POST + SSE transport
├── IMcpTransport.cs # Transport interface
├── IMcpTransportProvider.cs # Transport provider extension point
└── ToolResult.cs # Structured tool result formatting
Development
Build & Test
dotnet restore
dotnet build
dotnet test
Build Configuration
global.json— Pins the .NET SDK versionDirectory.Build.props— Shared build settings (nullable, warnings-as-errors)Directory.Packages.props— Central package version management
License
This project is licensed under the MIT License — see LICENSE for details.
| 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.AI (>= 10.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 10.6.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MonumentalSystems.Mcp:
| Package | Downloads |
|---|---|
|
MonumentalSystems.Sprites
A Semantic Kernel plugin for Sprites containerized development environment integration. Provides tools for managing sprites, executing commands, creating checkpoints, and establishing port forwarding tunnels. |
GitHub repositories
This package is not used by any popular GitHub repositories.