logikonline 42a3e1e255 feat(mcp): add Icon, Options, and OptionsFrom to manifest models
Add Icon property to McpManifestServer. Add Options and OptionsFrom properties to McpManifestConfig for static and dynamic value lists. Add McpManifestOptionsFrom class with File and Path properties for JSONPath-based option resolution
2026-04-04 18:57:03 -04:00

MCP Manifest

McpManifest

Client SDK for discovering and parsing mcp-manifest.json files. Implements the mcp-manifest.dev autodiscovery protocol for .NET.

Install

dotnet add package McpManifest

Usage

Discover a manifest

using McpManifest;

// From a domain (tries well-known URL, then HTML link tag)
var result = await McpManifestDiscovery.DiscoverAsync("ironlicensing.com");

if (result.Manifest is not null)
{
    Console.WriteLine($"Found via {result.Source}");
    Console.WriteLine($"Server: {result.Manifest.Server.DisplayName}");
}
else
{
    Console.WriteLine("Discovery failed:");
    foreach (var error in result.Errors)
        Console.WriteLine($"  - {error}");
}

// From a direct URL
var result2 = await McpManifestDiscovery.DiscoverAsync(
    "https://example.com/mcp-manifest.json");

// From a local file
var result3 = await McpManifestDiscovery.DiscoverAsync("./mcp-manifest.json");

Parse a manifest directly

using McpManifest.Models;

// From a JSON string
var manifest = McpManifestDocument.Parse(jsonString);

// From a file
var manifest2 = await McpManifestDocument.LoadAsync("./mcp-manifest.json");

// Access fields
Console.WriteLine(manifest.Server.Name);
Console.WriteLine(manifest.Transport);
foreach (var install in manifest.Install)
    Console.WriteLine($"{install.Method}: {install.Package}");

Validate a manifest

using McpManifest;

var result = McpManifestValidator.Validate(manifest);

if (result.IsValid)
{
    Console.WriteLine("Manifest is valid");
}
else
{
    foreach (var error in result.Errors)
        Console.WriteLine($"Error: {error}");
}

Check if a command is available

using McpManifest;

var exists = await McpManifestDiscovery.CheckCommandAsync("ironlicensing-mcp");
Console.WriteLine(exists ? "Found on PATH" : "Not found");

Custom HttpClient

using var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromSeconds(30);
httpClient.DefaultRequestHeaders.Add("User-Agent", "MyApp/1.0");

var result = await McpManifestDiscovery.DiscoverAsync("example.com", httpClient);

Discovery Algorithm

  1. If input is a local file path and exists, parse as manifest JSON
  2. If input is a direct URL ending in .json, fetch and parse
  3. Normalize to base URL (prepend https:// if needed)
  4. Try well-known: GET {base_url}/.well-known/mcp-manifest.json
  5. Fetch HTML page, parse for <link rel="mcp-manifest" href="..."> tags
  6. Discovery failed

License

CC0 1.0 -- Public domain.

Description
Implements the mcp-manifest.dev autodiscovery protocol for .NET.
http://www.mcp-manifest.dev
Readme 36 KiB
Languages
C# 100%