Table of Contents

Property UserAgent

Namespace
LMKit.Mcp.Client
Assembly
LM-Kit.NET.dll

UserAgent

Gets or sets the User-Agent string sent with HTTP requests.

public string UserAgent { get; set; }

Property Value

string

A string identifying the client application. Default is "LMKitMCPClient/1.0". Setting this to null or empty restores the default value.

Examples

var client = new McpClient("https://api.example.com/mcp");
client.UserAgent = "MyApp/2.0 (https://myapp.com)";

Remarks

The User-Agent header helps servers identify the client application and version making requests. This can be useful for server-side logging, analytics, and debugging.

Changes to this property take effect immediately and are applied to the underlying HTTP client. If you're using an externally-provided HttpClient, malformed User-Agent values are silently ignored to prevent exceptions.