Skip to content

@codesoul-co/hypha-mcp / coordination

Using this module

Use the Coordination module for using the public contracts and operations for this capability boundary. It exports 1 class, 3 interfaces.

Import from the package entrypoint

ts
import {
  RedisMCPReconnectCoordinator,
} from '@codesoul-co/hypha-mcp';

import type {
  MCPReconnectCoordinator,
  MCPReconnectLease,
  RedisLikeMCPLeaseClient,
} from '@codesoul-co/hypha-mcp';

Usage patterns

  • Use the 3 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
RedisMCPReconnectCoordinatorclassnew RedisMCPReconnectCoordinator(client: RedisLikeMCPLeaseClient, namespace?: string, now?: () => number): RedisMCPReconnectCoordinatorA per-server Redis lease that prevents reconnect storms across workers.
MCPReconnectCoordinatorinterfaceinterface MCPReconnectCoordinatorMCP Reconnect Coordinator interface with 1 public fields or methods.
MCPReconnectLeaseinterfaceinterface MCPReconnectLeaseMCP Reconnect Lease interface with 6 public fields or methods.
RedisLikeMCPLeaseClientinterfaceinterface RedisLikeMCPLeaseClientRedis Like MCP Lease Client interface with 2 public fields or methods.

RedisMCPReconnectCoordinator

A per-server Redis lease that prevents reconnect storms across workers.

  • Kind: class
  • Import: import { RedisMCPReconnectCoordinator } from '@codesoul-co/hypha-mcp';
  • Source module: coordination

Declaration

text
export declare class RedisMCPReconnectCoordinator implements MCPReconnectCoordinator {
    constructor(client: RedisLikeMCPLeaseClient, namespace?: string, now?: () => number);
    acquire(input: {
            serverId: string;
            ownerId: string;
            ttlMs: number;
        }): Promise<MCPReconnectLease | null>;
}

Public members

MemberKindSignatureDescription
acquiremethodacquire(input: { serverId: string; ownerId: string; ttlMs: number; }): Promise<MCPReconnectLease | null>Public method; parameters and return type are shown in the signature.
constructorconstructor(client: RedisLikeMCPLeaseClient, namespace?: string, now?: () => number): RedisMCPReconnectCoordinatorCreates an instance of this class.

MCPReconnectCoordinator

MCP Reconnect Coordinator interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { MCPReconnectCoordinator } from '@codesoul-co/hypha-mcp';
  • Source module: coordination

Declaration

text
export interface MCPReconnectCoordinator {
    acquire(input: {
        serverId: string;
        ownerId: string;
        ttlMs: number;
    }): Promise<MCPReconnectLease | null>;
}

Contract members

MemberKindSignatureDescription
acquiremethodacquire(input: { serverId: string; ownerId: string; ttlMs: number; }): Promise<MCPReconnectLease | null>Public method; parameters and return type are shown in the signature.

MCPReconnectLease

MCP Reconnect Lease interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { MCPReconnectLease } from '@codesoul-co/hypha-mcp';
  • Source module: coordination

Declaration

text
export interface MCPReconnectLease {
    serverId: string;
    ownerId: string;
    fencingToken: string;
    expiresAt: string;
    assertCurrent(): Promise<void>;
    release(): Promise<void>;
}

Contract members

MemberKindSignatureDescription
assertCurrentmethodassertCurrent(): Promise<void>Public method; parameters and return type are shown in the signature.
expiresAtpropertyexpiresAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
fencingTokenpropertyfencingToken: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
releasemethodrelease(): Promise<void>Public method; parameters and return type are shown in the signature.
serverIdpropertyserverId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

RedisLikeMCPLeaseClient

Redis Like MCP Lease Client interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { RedisLikeMCPLeaseClient } from '@codesoul-co/hypha-mcp';
  • Source module: coordination

Declaration

text
export interface RedisLikeMCPLeaseClient {
    set(key: string, value: string, mode: 'PX', ttlMs: number, condition: 'NX'): Promise<string | null>;
    eval(script: string, numberOfKeys: number, ...args: Array<string | number>): Promise<number | string | null>;
}

Contract members

MemberKindSignatureDescription
evalmethodeval(script: string, numberOfKeys: number, ...args: Array<string | number>): Promise<number | string | null>Public method; parameters and return type are shown in the signature.
setmethodset(key: string, value: string, mode: "PX", ttlMs: number, condition: "NX"): Promise<string | null>Public method; parameters and return type are shown in the signature.