logikonline b23eb815d2 feat(types): add icon, options, and options_from to TypeScript types
Add icon field to McpManifestServer. Add options and options_from fields to McpManifestConfig. Add McpManifestOptionsFrom interface with file and path properties for JSONPath-based dynamic options
2026-04-04 18:57:21 -04:00

MCP Manifest

@mcp-manifest/sdk

TypeScript SDK for discovering and parsing mcp-manifest.json files. Built for MCP client developers who want to auto-discover, validate, and consume server manifests.

Install

npm install @mcp-manifest/sdk

Usage

Discover a manifest from a domain, URL, or file path

import { discover } from '@mcp-manifest/sdk';

// From a domain (tries well-known URL, then HTML link tag)
const result = await discover('ironlicensing.com');

// From a direct URL
const result = await discover('https://example.com/mcp-manifest.json');

// From a local file
const result = await discover('./mcp-manifest.json');

if (result.manifest) {
  console.log(`Found via ${result.source}`);
  console.log(result.manifest.server.displayName);
} else {
  console.error('Discovery failed:', result.errors);
}

Validate a manifest

import { validate } from '@mcp-manifest/sdk';

const { valid, errors } = validate(manifest);

if (!valid) {
  console.error('Validation errors:', errors);
}

Parse JSON

import { parse, loadFile } from '@mcp-manifest/sdk';

// Parse a JSON string
const manifest = parse(jsonString);

// Load from a file
const manifest = await loadFile('./mcp-manifest.json');

Check if a command exists on PATH

import { checkCommand } from '@mcp-manifest/sdk';

const exists = await checkCommand('ironlicensing-mcp');

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 URL: GET {base_url}/.well-known/mcp-manifest.json
  5. Fetch HTML page, parse for <link rel="mcp-manifest" href="..."> tags.
  6. Discovery failed.

Types

The SDK exports full TypeScript types for the manifest spec:

  • McpManifest — top-level manifest
  • McpManifestServer — server metadata
  • McpManifestInstall — installation method
  • McpManifestConfig — configuration parameter
  • McpManifestSettingsTemplate — client settings template
  • DiscoveryResult — result from discover()
  • ValidationResult — result from validate()

License

CC0 1.0 -- Public domain.

Description
Built for MCP client developers who want to auto-discover, validate, and consume server manifests.
http://www.mcp-manifest.dev
Readme 34 KiB
Languages
TypeScript 100%