Skip to content

McpServerDefinition

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

A registered remote MCP server. Its tools are discovered at connection time and listed alongside the tools registered in code.

public sealed record McpServerDefinition : IEquatable<McpServerDefinition>

objectMcpServerDefinition

IEquatable<McpServerDefinition>

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Carries no secret. The value of the authentication header is not stored in this record; only the name of the configuration key the value is read from (AuthorizationConfigurationKey) is stored. The value is resolved at run time through IConfiguration, so it stays in dotnet user-secrets or an environment variable. It never enters a database backup, an audit trail, or a UI response.

public McpServerDefinition()

The configuration key the Authorization header’s value is read from. Example: AgentPrism:McpSecrets:GithubToken. If left empty, the header is not sent.

public string? AuthorizationConfigurationKey { get; init; }

string?

The creation time (UTC).

public DateTimeOffset CreatedAt { get; init; }

DateTimeOffset

The description.

public string? Description { get; init; }

string?

Whether the server is enabled. Its tools are not discovered while disabled.

public bool Enabled { get; init; }

bool

The server address. Only http and https are accepted.

public required Uri Endpoint { get; init; }

Uri

Extra request headers. Must not carry a secret — these values are stored as-is and shown in the UI.

public IReadOnlyDictionary<string, string> Headers { get; init; }

IReadOnlyDictionary<string, string>

The server identifier. A time-ordered UUID (v7).

public required Guid Id { get; init; }

Guid

The server name. Discovered tools are named as {name}.{tool}, so tools with the same name on two servers never collide.

public required string Name { get; init; }

string

The OAuth authorization flow.

[JsonPropertyName("oauthAuthorizationMode")]
public McpOAuthAuthorizationMode OAuthAuthorizationMode { get; init; }

McpOAuthAuthorizationMode

The OAuth client identifier. Not a secret, stored as-is.

[JsonPropertyName("oauthClientId")]
public string? OAuthClientId { get; init; }

string?

The configuration key the OAuth client secret’s value is read from. The value is never written to the database, under the same rule as AuthorizationConfigurationKey.

[JsonPropertyName("oauthClientSecretConfigurationKey")]
public string? OAuthClientSecretConfigurationKey { get; init; }

string?

Whether OAuth authentication is on. When on, it cannot be used at the same time as AuthorizationConfigurationKey — both would try to manage the Authorization header.

[JsonPropertyName("oauthEnabled")]
public bool OAuthEnabled { get; init; }

bool

[JsonPropertyName] is given deliberately: System.Text.Json’s camelCase policy lowercases only the first letter, and since “OAuth” starts with two uppercase letters, the default output would be oAuthEnabled (not the expected oauthEnabled). The same constraint applies to all four OAuth fields below.

The space-separated OAuth scope list. Example: "repo read:user".

[JsonPropertyName("oauthScopes")]
public string? OAuthScopes { get; init; }

string?

Whether this server’s tools require explicit approval before each call. Defaults to true: the tool definition comes from outside and is treated as untrusted.

public bool RequiresApproval { get; init; }

bool

The tenant the server belongs to.

public required string TenantId { get; init; }

string

The transport format.

public McpTransportMode Transport { get; init; }

McpTransportMode

The last-updated time (UTC).

public DateTimeOffset UpdatedAt { get; init; }

DateTimeOffset

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(McpServerDefinition? other)

other McpServerDefinition?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(McpServerDefinition?, McpServerDefinition?)

Section titled “ operator ==(McpServerDefinition?, McpServerDefinition?)”
public static bool operator ==(McpServerDefinition? left, McpServerDefinition? right)

left McpServerDefinition?

right McpServerDefinition?

bool

operator !=(McpServerDefinition?, McpServerDefinition?)

Section titled “ operator !=(McpServerDefinition?, McpServerDefinition?)”
public static bool operator !=(McpServerDefinition? left, McpServerDefinition? right)

left McpServerDefinition?

right McpServerDefinition?

bool