Skip to content

InMemoryMcpServerStore

Namespace AgentPrism · Assembly AgentPrism.Core.dll

A store that keeps MCP server definitions in process memory.

public sealed class InMemoryMcpServerStore : IMcpServerStore

objectInMemoryMcpServerStore

IMcpServerStore

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

Use AgentPrism.PostgreSql in production.

public InMemoryMcpServerStore()

DeleteAsync(string, string, CancellationToken)

Section titled “ DeleteAsync(string, string, CancellationToken)”

Deletes a server.

public ValueTask<bool> DeleteAsync(string tenantId, string name, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

name string

The server name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<bool>

true if the record was deleted.

GetAsync(string, string, CancellationToken)

Section titled “ GetAsync(string, string, CancellationToken)”

Fetches a server by name.

public ValueTask<McpServerDefinition?> GetAsync(string tenantId, string name, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

name string

The server name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<McpServerDefinition?>

The server; null if none exists.

Lists a tenant’s servers, ordered by name.

public ValueTask<IReadOnlyList<McpServerDefinition>> ListAsync(string tenantId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<McpServerDefinition>>

The servers.

SaveAsync(McpServerDefinition, CancellationToken)

Section titled “ SaveAsync(McpServerDefinition, CancellationToken)”

Adds or updates a server. The key is the (tenant, name) pair.

public ValueTask<McpServerDefinition> SaveAsync(McpServerDefinition server, CancellationToken cancellationToken = default)

server McpServerDefinition

The server to write.

cancellationToken CancellationToken

The cancellation token.

ValueTask<McpServerDefinition>

The persisted record.