Skip to content

@codesoul-co/hypha-mcp / connection-manager

Using this module

Use the Connection manager module for using the public contracts and operations for this capability boundary. It exports 2 classes, 4 constants, 2 functions, 9 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  MCPConnectionManager,
  SDKMCPConnectionSessionFactory,
  mcpConnectionRecordDefinition,
  mcpConnectionRecordExample,
  mcpConnectionRecordJsonSchema,
  mcpConnectionRecordSchema,
  assertRemoteEgressAllowed,
  createGuardedMCPFetch,
} from '@codesoul-co/hypha-mcp';

import type {
  GuardedMCPFetchOptions,
  MCPConnectionManagerOptions,
  MCPConnectionRecord,
  MCPConnectionSession,
  MCPConnectionSessionFactory,
  MCPConnectionStatus,
  MCPRemoteContentArtifact,
  MCPRemoteContentArtifactPort,
} from '@codesoul-co/hypha-mcp';

// The complete export list is documented below.

Usage patterns

  • Use the 10 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 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 4 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Runtime validation example

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

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = mcpConnectionRecordSchema.parse(input);

Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.

Public exports

SymbolKindSignatureDescription
MCPConnectionManagerclassnew MCPConnectionManager(options: MCPConnectionManagerOptions): MCPConnectionManagerMCP Connection Manager class with 16 public constructor or member entries; its exact declarations are listed below.
SDKMCPConnectionSessionFactoryclassnew SDKMCPConnectionSessionFactory(options?: SDKMCPConnectionSessionFactoryOptions): SDKMCPConnectionSessionFactorySDKMCP Connection Session Factory class with 2 public constructor or member entries; its exact declarations are listed below.
mcpConnectionRecordDefinitionconstantconst mcpConnectionRecordDefinition: SpecSchemaDefinition<MCPConnectionRecord>MCP Connection Record Definition constant exported by the connection-manager module.
mcpConnectionRecordExampleconstantconst mcpConnectionRecordExample: MCPConnectionRecordValid example value for MCP Connection Record.
mcpConnectionRecordJsonSchemaconstantconst mcpConnectionRecordJsonSchema: JsonSchemaJSON Schema for MCP Connection Record.
mcpConnectionRecordSchemaconstantconst mcpConnectionRecordSchema: z.ZodObject<{ id: z.ZodString; serverId: z.ZodString; revision: z.ZodNumber; state: z.ZodEnum<["disconnected", "starting", "initializing", "ready", "degraded", "reconnecting", "closing", "closed", "failed"]>; transportType: z.ZodEnum<["stdio", "streamable_http", "custom"]>; negotiatedProtocolVersion: z.ZodOptional<z.ZodString>; clientInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.Z...Runtime schema for MCP Connection Record.
assertRemoteEgressAllowedfunctionassertRemoteEgressAllowed(endpoint: string, policy: MCPServerProfile["egressPolicy"]): Promise<void>Assert Remote Egress Allowed function with 1 public call signature; parameters and return types are listed below.
createGuardedMCPFetchfunctioncreateGuardedMCPFetch(options?: GuardedMCPFetchOptions): MCPFetchApplies the remote MCP egress policy to every request and redirect hop. Credentials are resolved immediately before each request so rotations take effect without rebuilding declarative profiles.
GuardedMCPFetchOptionsinterfaceinterface GuardedMCPFetchOptionsGuarded MCP Fetch Options interface with 4 public fields or methods.
MCPConnectionManagerOptionsinterfaceinterface MCPConnectionManagerOptionsMCP Connection Manager Options interface with 12 public fields or methods.
MCPConnectionRecordinterfaceinterface MCPConnectionRecordMCP Connection Record interface with 18 public fields or methods.
MCPConnectionSessioninterfaceinterface MCPConnectionSessionMCP Connection Session interface with 9 public fields or methods.
MCPConnectionSessionFactoryinterfaceinterface MCPConnectionSessionFactoryMCP Connection Session Factory interface with 1 public fields or methods.
MCPConnectionStatusinterfaceinterface MCPConnectionStatusMCP Connection Status interface with 2 public fields or methods.
MCPRemoteContentArtifactinterfaceinterface MCPRemoteContentArtifactMCP Remote Content Artifact interface with 3 public fields or methods.
MCPRemoteContentArtifactPortinterfaceinterface MCPRemoteContentArtifactPortMCP Remote Content Artifact Port interface with 1 public fields or methods.
SDKMCPConnectionSessionFactoryOptionsinterfaceinterface SDKMCPConnectionSessionFactoryOptionsSDKMCP Connection Session Factory Options interface with 5 public fields or methods.
MCPConnectionStatetypetype MCPConnectionState = 'disconnected' | 'starting' | 'initializing' | 'ready' | 'degraded' | 'reconnecting' | 'closing' | 'closed' | 'failed'Public type alias for MCP Connection State; the declaration contains its complete type expression.

MCPConnectionManager

MCP Connection Manager class with 16 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class MCPConnectionManager implements MCPGateway {
    constructor(options: MCPConnectionManagerOptions);
    onListChanged(listener: (serverId: string) => Promise<void> | void): () => void;
    register(profile: MCPServerProfile): MCPConnectionRecord;
    connect(serverId: string): Promise<MCPConnectionRecord>;
    get(serverId: string): Promise<MCPConnectionRecord | null>;
    status(serverId: string): Promise<MCPConnectionStatus>;
    health(serverId?: string): Promise<Record<string, ProviderHealth>>;
    reconnect(serverId: string): Promise<MCPConnectionRecord>;
    cancelRequest(requestId: string): Promise<void>;
    disconnect(serverId: string, reason?: string): Promise<void>;
    closeAll(): Promise<void>;
    discover(integration: MCPIntegrationSpec): Promise<MCPCapabilityDescriptor[]>;
    normalize(capability: MCPCapabilityDescriptor): Promise<NormalizedMCPCapability>;
    call(request: MCPToolCallRequest): Promise<unknown>;
    readResource(request: MCPResourceReadRequest): Promise<MCPResourceResult>;
    getPrompt(request: MCPPromptRequest): Promise<MCPPromptResult>;
}

Public members

MemberKindSignatureDescription
callmethodcall(request: MCPToolCallRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.
cancelRequestmethodcancelRequest(requestId: string): Promise<void>Public method; parameters and return type are shown in the signature.
closeAllmethodcloseAll(): Promise<void>Public method; parameters and return type are shown in the signature.
connectmethodconnect(serverId: string): Promise<MCPConnectionRecord>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: MCPConnectionManagerOptions): MCPConnectionManagerCreates an instance of this class.
disconnectmethoddisconnect(serverId: string, reason?: string): Promise<void>Public method; parameters and return type are shown in the signature.
discovermethoddiscover(integration: MCPIntegrationSpec): Promise<MCPCapabilityDescriptor[]>Public method; parameters and return type are shown in the signature.
getmethodget(serverId: string): Promise<MCPConnectionRecord | null>Public method; parameters and return type are shown in the signature.
getPromptmethodgetPrompt(request: MCPPromptRequest): Promise<MCPPromptResult>Public method; parameters and return type are shown in the signature.
healthmethodhealth(serverId?: string): Promise<Record<string, ProviderHealth>>Public method; parameters and return type are shown in the signature.
normalizemethodnormalize(capability: MCPCapabilityDescriptor): Promise<NormalizedMCPCapability>Public method; parameters and return type are shown in the signature.
onListChangedmethodonListChanged(listener: (serverId: string) => Promise<void> | void): () => voidPublic method; parameters and return type are shown in the signature.
readResourcemethodreadResource(request: MCPResourceReadRequest): Promise<MCPResourceResult>Public method; parameters and return type are shown in the signature.
reconnectmethodreconnect(serverId: string): Promise<MCPConnectionRecord>Public method; parameters and return type are shown in the signature.
registermethodregister(profile: MCPServerProfile): MCPConnectionRecordPublic method; parameters and return type are shown in the signature.
statusmethodstatus(serverId: string): Promise<MCPConnectionStatus>Public method; parameters and return type are shown in the signature.

SDKMCPConnectionSessionFactory

SDKMCP Connection Session Factory class with 2 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class SDKMCPConnectionSessionFactory implements MCPConnectionSessionFactory {
    constructor(options?: SDKMCPConnectionSessionFactoryOptions);
    create(profile: MCPServerProfile): MCPConnectionSession;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options?: SDKMCPConnectionSessionFactoryOptions): SDKMCPConnectionSessionFactoryCreates an instance of this class.
createmethodcreate(profile: MCPServerProfile): MCPConnectionSessionPublic method; parameters and return type are shown in the signature.

mcpConnectionRecordDefinition

MCP Connection Record Definition constant exported by the connection-manager module.

  • Kind: constant
  • Import: import { mcpConnectionRecordDefinition } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
export declare const mcpConnectionRecordDefinition: SpecSchemaDefinition<MCPConnectionRecord>;

mcpConnectionRecordExample

Valid example value for MCP Connection Record.

  • Kind: constant
  • Import: import { mcpConnectionRecordExample } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
export declare const mcpConnectionRecordExample: MCPConnectionRecord;

mcpConnectionRecordJsonSchema

JSON Schema for MCP Connection Record.

  • Kind: constant
  • Import: import { mcpConnectionRecordJsonSchema } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
export declare const mcpConnectionRecordJsonSchema: JsonSchema;

mcpConnectionRecordSchema

Runtime schema for MCP Connection Record.

  • Kind: constant
  • Import: import { mcpConnectionRecordSchema } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const mcpConnectionRecordSchema: (typeof import('@codesoul-co/hypha-mcp'))['mcpConnectionRecordSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

assertRemoteEgressAllowed

Assert Remote Egress Allowed function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { assertRemoteEgressAllowed } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
export declare function assertRemoteEgressAllowed(endpoint: string, policy: MCPServerProfile['egressPolicy']): Promise<void>;

Call signature

text
assertRemoteEgressAllowed(endpoint: string, policy: MCPServerProfile["egressPolicy"]): Promise<void>

Parameters

ParameterTypeRequiredDescription
endpointstringYesRequired parameter; accepted values are defined by the type column.
policy{ allowedHosts?: string[]; denyPrivateNetworks?: boolean; requireTls?: boolean; maxRedirects?: number; allowCrossOriginRedirects?: boolean; }YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: Promise<void>
  • Description: The return contract is defined by the type shown above.

createGuardedMCPFetch

Applies the remote MCP egress policy to every request and redirect hop. Credentials are resolved immediately before each request so rotations take effect without rebuilding declarative profiles.

  • Kind: function
  • Import: import { createGuardedMCPFetch } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
export declare function createGuardedMCPFetch(options?: GuardedMCPFetchOptions): MCPFetch;

Call signature

text
createGuardedMCPFetch(options?: GuardedMCPFetchOptions): MCPFetch

Applies the remote MCP egress policy to every request and redirect hop. Credentials are resolved immediately before each request so rotations take effect without rebuilding declarative profiles.

Parameters

ParameterTypeRequiredDescription
optionsGuardedMCPFetchOptionsNoOptional parameter; accepted values are defined by the type column.

Returns

  • Type: MCPFetch
  • Description: The return contract is defined by the type shown above.

GuardedMCPFetchOptions

Guarded MCP Fetch Options interface with 4 public fields or methods.

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

Declaration

text
export interface GuardedMCPFetchOptions {
    policy?: MCPServerProfile['egressPolicy'];
    fetch?: MCPFetch;
    resolveHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
    resolveAuthorization?: () => Promise<string | undefined> | string | undefined;
}

Contract members

MemberKindSignatureDescription
fetchmethodfetch?(input: string | URL | Request, init?: RequestInit): Promise<Response>Public method; parameters and return type are shown in the signature.
policypropertypolicy?: { allowedHosts?: string[]; denyPrivateNetworks?: boolean; requireTls?: boolean; maxRedirects?: number; allowCrossOriginRedirects?: boolean; }Public property; its type, readonly modifier and optionality are shown in the signature.
resolveAuthorizationmethodresolveAuthorization?(): Promise<string | undefined> | string | undefinedPublic method; parameters and return type are shown in the signature.
resolveHeadersmethodresolveHeaders?(): Promise<Record<string, string>> | Record<string, string>Public method; parameters and return type are shown in the signature.

MCPConnectionManagerOptions

MCP Connection Manager Options interface with 12 public fields or methods.

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

Declaration

text
export interface MCPConnectionManagerOptions {
    sessionFactory: MCPConnectionSessionFactory;
    trace?: TraceRecorder;
    traceContext?: {
        runId: string;
        stepId?: string;
        sessionId?: string;
    };
    now?: () => string;
    monotonicNow?: () => number;
    sleep?: (ms: number) => Promise<void>;
    random?: () => number;
    onListChanged?: (serverId: string) => Promise<void> | void;
    telemetry?: TelemetryRecorder;
    contentArtifacts?: MCPRemoteContentArtifactPort;
    reconnectCoordinator?: MCPReconnectCoordinator;
    reconnectOwnerId?: string;
}

Contract members

MemberKindSignatureDescription
contentArtifactspropertycontentArtifacts?: MCPRemoteContentArtifactPortPublic property; its type, readonly modifier and optionality are shown in the signature.
monotonicNowmethodmonotonicNow?(): numberPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
onListChangedmethodonListChanged?(serverId: string): Promise<void> | voidPublic method; parameters and return type are shown in the signature.
randommethodrandom?(): numberPublic method; parameters and return type are shown in the signature.
reconnectCoordinatorpropertyreconnectCoordinator?: MCPReconnectCoordinatorPublic property; its type, readonly modifier and optionality are shown in the signature.
reconnectOwnerIdpropertyreconnectOwnerId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionFactorypropertysessionFactory: MCPConnectionSessionFactoryPublic property; its type, readonly modifier and optionality are shown in the signature.
sleepmethodsleep?(ms: number): Promise<void>Public method; parameters and return type are shown in the signature.
telemetrypropertytelemetry?: TelemetryRecorderPublic property; its type, readonly modifier and optionality are shown in the signature.
tracepropertytrace?: TraceRecorderPublic property; its type, readonly modifier and optionality are shown in the signature.
traceContextpropertytraceContext?: { runId: string; stepId?: string; sessionId?: string; }Public property; its type, readonly modifier and optionality are shown in the signature.

MCPConnectionRecord

MCP Connection Record interface with 18 public fields or methods.

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

Declaration

text
export interface MCPConnectionRecord {
    id: string;
    serverId: string;
    revision: number;
    state: MCPConnectionState;
    transportType: MCPTransportSpec['type'];
    negotiatedProtocolVersion?: string;
    clientInfo?: Record<string, unknown>;
    serverInfo?: Record<string, unknown>;
    serverCapabilities?: Record<string, unknown>;
    startedAt?: string;
    readyAt?: string;
    lastActivityAt?: string;
    lastHealthCheckAt?: string;
    closedAt?: string;
    activeRequestCount: number;
    reconnectAttempts: number;
    error?: NormalizedMCPError;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
activeRequestCountpropertyactiveRequestCount: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
clientInfopropertyclientInfo?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
closedAtpropertyclosedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror?: NormalizedMCPErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastActivityAtpropertylastActivityAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
lastHealthCheckAtpropertylastHealthCheckAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
negotiatedProtocolVersionpropertynegotiatedProtocolVersion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
readyAtpropertyreadyAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reconnectAttemptspropertyreconnectAttempts: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
serverCapabilitiespropertyserverCapabilities?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
serverIdpropertyserverId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
serverInfopropertyserverInfo?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
startedAtpropertystartedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statepropertystate: MCPConnectionStatePublic property; its type, readonly modifier and optionality are shown in the signature.
transportTypepropertytransportType: "custom" | "stdio" | "streamable_http"Public property; its type, readonly modifier and optionality are shown in the signature.

MCPConnectionSession

MCP Connection Session interface with 9 public fields or methods.

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

Declaration

text
export interface MCPConnectionSession {
    connect(signal?: AbortSignal): Promise<{
        negotiatedProtocolVersion?: string;
        serverInfo?: Record<string, unknown>;
        serverCapabilities?: Record<string, unknown>;
    }>;
    listCapabilities(signal?: AbortSignal): Promise<MCPCapabilityDescriptor[]>;
    callTool(capabilityId: string, input: unknown, options?: {
        signal?: AbortSignal;
        timeoutMs?: number;
        onProgress?: (progress: unknown) => void;
    }): Promise<unknown>;
    readResource?(uri: string, options?: {
        signal?: AbortSignal;
        timeoutMs?: number;
    }): Promise<MCPResourceResult>;
    getPrompt?(name: string, args?: Record<string, string>, options?: {
        signal?: AbortSignal;
        timeoutMs?: number;
    }): Promise<MCPPromptResult>;
    ping(signal?: AbortSignal): Promise<void>;
    close(): Promise<void>;
    onClose?: (error?: Error) => void;
    onListChanged?: () => void;
}

Contract members

MemberKindSignatureDescription
callToolmethodcallTool(capabilityId: string, input: unknown, options?: { signal?: AbortSignal; timeoutMs?: number; onProgress?: (progress: unknown) => void; }): Promise<unknown>Public method; parameters and return type are shown in the signature.
closemethodclose(): Promise<void>Public method; parameters and return type are shown in the signature.
connectmethodconnect(signal?: AbortSignal): Promise<{ negotiatedProtocolVersion?: string; serverInfo?: Record<string, unknown>; serverCapabilities?: Record<string, unknown>; }>Public method; parameters and return type are shown in the signature.
getPromptmethodgetPrompt?(name: string, args?: Record<string, string>, options?: { signal?: AbortSignal; timeoutMs?: number; }): Promise<MCPPromptResult>Public method; parameters and return type are shown in the signature.
listCapabilitiesmethodlistCapabilities(signal?: AbortSignal): Promise<MCPCapabilityDescriptor[]>Public method; parameters and return type are shown in the signature.
onClosemethodonClose?(error?: Error): voidPublic method; parameters and return type are shown in the signature.
onListChangedmethodonListChanged?(): voidPublic method; parameters and return type are shown in the signature.
pingmethodping(signal?: AbortSignal): Promise<void>Public method; parameters and return type are shown in the signature.
readResourcemethodreadResource?(uri: string, options?: { signal?: AbortSignal; timeoutMs?: number; }): Promise<MCPResourceResult>Public method; parameters and return type are shown in the signature.

MCPConnectionSessionFactory

MCP Connection Session Factory interface with 1 public fields or methods.

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

Declaration

text
export interface MCPConnectionSessionFactory {
    create(profile: MCPServerProfile): MCPConnectionSession;
}

Contract members

MemberKindSignatureDescription
createmethodcreate(profile: MCPServerProfile): MCPConnectionSessionPublic method; parameters and return type are shown in the signature.

MCPConnectionStatus

MCP Connection Status interface with 2 public fields or methods.

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

Declaration

text
export interface MCPConnectionStatus {
    record: MCPConnectionRecord | null;
    health: ProviderHealth;
}

Contract members

MemberKindSignatureDescription
healthpropertyhealth: ProviderHealthPublic property; its type, readonly modifier and optionality are shown in the signature.
recordpropertyrecord: MCPConnectionRecordPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPRemoteContentArtifact

MCP Remote Content Artifact interface with 3 public fields or methods.

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

Declaration

text
export interface MCPRemoteContentArtifact {
    artifactRef: string;
    contentHash: string;
    sizeBytes: number;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPRemoteContentArtifactPort

MCP Remote Content Artifact Port interface with 1 public fields or methods.

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

Declaration

text
export interface MCPRemoteContentArtifactPort {
    store(input: {
        serverId: string;
        kind: 'resource' | 'prompt';
        capabilityId: string;
        mediaType: string;
        bytes: Uint8Array;
        contentHash: string;
        provenance: Record<string, unknown>;
    }): Promise<MCPRemoteContentArtifact>;
}

Contract members

MemberKindSignatureDescription
storemethodstore(input: { serverId: string; kind: "resource" | "prompt"; capabilityId: string; mediaType: string; bytes: Uint8Array; contentHash: string; provenance: Record<string, unknown>; }): Promise<MCPRemoteContentArtifact>Public method; parameters and return type are shown in the signature.

SDKMCPConnectionSessionFactoryOptions

SDKMCP Connection Session Factory Options interface with 5 public fields or methods.

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

Declaration

text
export interface SDKMCPConnectionSessionFactoryOptions {
    clientInfo?: {
        name: string;
        version: string;
    };
    resolveHeadersRef?: (ref: string) => Promise<Record<string, string>> | Record<string, string>;
    resolveAuthorizationRef?: (ref: string) => Promise<string> | string;
    resolveWorkingDirectoryRef?: (ref: string) => Promise<string> | string;
    resolveEnvironmentRefs?: (refs: string[]) => Promise<Record<string, string>> | Record<string, string>;
}

Contract members

MemberKindSignatureDescription
clientInfopropertyclientInfo?: { name: string; version: string; }Public property; its type, readonly modifier and optionality are shown in the signature.
resolveAuthorizationRefmethodresolveAuthorizationRef?(ref: string): Promise<string> | stringPublic method; parameters and return type are shown in the signature.
resolveEnvironmentRefsmethodresolveEnvironmentRefs?(refs: string[]): Promise<Record<string, string>> | Record<string, string>Public method; parameters and return type are shown in the signature.
resolveHeadersRefmethodresolveHeadersRef?(ref: string): Promise<Record<string, string>> | Record<string, string>Public method; parameters and return type are shown in the signature.
resolveWorkingDirectoryRefmethodresolveWorkingDirectoryRef?(ref: string): Promise<string> | stringPublic method; parameters and return type are shown in the signature.

MCPConnectionState

Public type alias for MCP Connection State; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { MCPConnectionState } from '@codesoul-co/hypha-mcp';
  • Source module: connection-manager

Declaration

text
export type MCPConnectionState = 'disconnected' | 'starting' | 'initializing' | 'ready' | 'degraded' | 'reconnecting' | 'closing' | 'closed' | 'failed';