.NET API
McpServerStoreContract
Tracon.Testing.Contracts.Xunit.dllBehavior tests for the IMcpServerStore contract.
public abstract class McpServerStoreContract : TenantIsolationContract<IMcpServerStore>, IAsyncLifetime, IAsyncDisposableInheritance
Section titled “Inheritance”object ← TenantIsolationContract<IMcpServerStore> ← McpServerStoreContract
Implements
Section titled “Implements”IAsyncLifetime, IAsyncDisposable
Inherited Members
Section titled “Inherited Members”TenantIsolationContract<IMcpServerStore>.TenantA, TenantIsolationContract<IMcpServerStore>.TenantB, TenantIsolationContract<IMcpServerStore>.CreateStoreAsync(), TenantIsolationContract<IMcpServerStore>.UseAmbientTenant(MutableTenantContext), TenantIsolationContract<IMcpServerStore>.InitializeAsync(), TenantIsolationContract<IMcpServerStore>.DisposeAsync(), TenantIsolationContract<IMcpServerStore>.OnDisposeAsync(), TenantIsolationContract<IMcpServerStore>.SeedAsync(string, string), TenantIsolationContract<IMcpServerStore>.ExistsAsync(string, object), TenantIsolationContract<IMcpServerStore>.CountAsync(string), TenantIsolationContract<IMcpServerStore>.TryDeleteAsync(string, object), TenantIsolationContract<IMcpServerStore>.TryOverwriteAsync(string, string), TenantIsolationContract<IMcpServerStore>.Tenant_cannot_read_another_tenants_record(), TenantIsolationContract<IMcpServerStore>.Tenant_reads_its_own_record(), TenantIsolationContract<IMcpServerStore>.Tenant_does_not_see_another_tenants_record_in_the_list(), TenantIsolationContract<IMcpServerStore>.Tenant_cannot_delete_another_tenants_record(), TenantIsolationContract<IMcpServerStore>.Same_name_lives_independently_across_two_tenants(), TenantIsolationContract<IMcpServerStore>.AmbientTenant, TenantIsolationContract<IMcpServerStore>.Store, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”An MCP server registration accepts a tool definition from an external source; one tenant’s server showing up in another tenant’s catalog is a security boundary. The record never carries a secret – it only stores the name of the configuration key the value will be read from.
Constructors
Section titled “Constructors”McpServerStoreContract()
Section titled “ McpServerStoreContract()”protected McpServerStoreContract()Methods
Section titled “Methods”CountAsync(string)
Section titled “ CountAsync(string)”Reports how many records the given tenant sees through the listing endpoint.
protected override ValueTask<int> CountAsync(string tenantId)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
Returns
Section titled “Returns”The number of records seen.
Deleting_a_nonexistent_record_returns_false()
Section titled “ Deleting_a_nonexistent_record_returns_false()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 210)]public Task Deleting_a_nonexistent_record_returns_false()Returns
Section titled “Returns”ExistsAsync(string, object)
Section titled “ ExistsAsync(string, object)”Reports whether the record is visible from the given tenant’s viewpoint.
protected override ValueTask<bool> ExistsAsync(string tenantId, object key)Parameters
Section titled “Parameters”tenantId string
The reading tenant.
key object
The key returned by TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”true if the record is visible.
Nonexistent_server_returns_null()
Section titled “ Nonexistent_server_returns_null()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 206)]public Task Nonexistent_server_returns_null()Returns
Section titled “Returns”Saved_server_is_read_back()
Section titled “ Saved_server_is_read_back()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 183)]public Task Saved_server_is_read_back()Returns
Section titled “Returns”Saving_the_same_name_a_second_time_overwrites_it()
Section titled “ Saving_the_same_name_a_second_time_overwrites_it()”[Fact("/Users/farukatasoy/Desktop/projects/Tracon/src/Tracon.Testing.Contracts.Xunit/Contracts/ToolApprovalRuleStoreContract.cs", 196)]public Task Saving_the_same_name_a_second_time_overwrites_it()Returns
Section titled “Returns”SeedAsync(string, string)
Section titled “ SeedAsync(string, string)”Writes a sample record for the given tenant.
protected override ValueTask<object> SeedAsync(string tenantId, string name)Parameters
Section titled “Parameters”tenantId string
The tenant that owns the record.
name string
The name distinguishing the record. The same name may be used by two tenants.
Returns
Section titled “Returns”The key to use for reading the record back.
TryDeleteAsync(string, object)
Section titled “ TryDeleteAsync(string, object)”Attempts to delete the record on behalf of the given tenant.
protected override ValueTask<bool?> TryDeleteAsync(string tenantId, object key)Parameters
Section titled “Parameters”tenantId string
The tenant attempting the delete.
key object
The key returned by TenantIsolationContract.SeedAsync.
Returns
Section titled “Returns”true if the delete succeeded, false if the record was not found; null if the store does not offer deletion.