Table of Contents

Class McpJsonUtilities

Namespace
ModelContextProtocol.Utils.Json
Assembly
ModelContextProtocol.dll

Provides a collection of utility methods for working with JSON data in the context of MCP.

public static class McpJsonUtilities
Inheritance
McpJsonUtilities
Inherited Members

Properties

DefaultOptions

Gets the JsonSerializerOptions singleton used as the default in JSON serialization operations.

public static JsonSerializerOptions DefaultOptions { get; }

Property Value

JsonSerializerOptions

Remarks

For Native AOT or applications disabling IsReflectionEnabledByDefault, this instance includes source generated contracts for all common exchange types contained in the ModelContextProtocol library.

It additionally turns on the following settings:

  1. Enables string-based enum serialization as implemented by JsonStringEnumConverter.
  2. Enables WhenWritingNull as the default ignore condition for properties.
  3. Enables AllowReadingFromString as the default number handling for number types.