Skip to content

@codesoul-co/hypha-mcp / index

Using this module

Aggregates the public entrypoint exports for @codesoul-co/hypha-mcp; applications import these symbols from the package entrypoint instead of internal file paths.

Import from the package entrypoint

ts
import {
  MockMCPGateway,
  classicMCPCapabilityDescriptors,
  classicMCPIntegrationSpec,
  mcpCapabilityDescriptorSchema,
  mcpIntegrationSpecDefinition,
  mcpIntegrationSpecExample,
  mcpIntegrationSpecJsonSchema,
  mcpIntegrationSpecSchema,
} from '@codesoul-co/hypha-mcp';

import type {
  ClassicMCPFetchResponse,
  ClassicMCPMockGatewayOptions,
  ClassicMCPSearchResult,
  MCPCapabilityDescriptor,
  MCPGateway,
  MCPGatewayToolRegistrationContext,
  MCPGatewayToolRegistrationOptions,
  MCPGatewayToolRegistrationResult,
} from '@codesoul-co/hypha-mcp';

// The complete export list is documented below.

Usage patterns

  • Use the 17 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.
  • The module exposes 4 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 10 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 { mcpCapabilityDescriptorSchema } from '@codesoul-co/hypha-mcp';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = mcpCapabilityDescriptorSchema.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
MockMCPGatewayclassnew MockMCPGateway(capabilities?: MCPCapabilityDescriptor[]): MockMCPGatewayMock MCP Gateway class with 11 public constructor or member entries; its exact declarations are listed below.
classicMCPCapabilityDescriptorsconstantconst classicMCPCapabilityDescriptors: MCPCapabilityDescriptor[]Classic MCP Capability Descriptors constant exported by the index module.
classicMCPIntegrationSpecconstantconst classicMCPIntegrationSpec: MCPIntegrationSpecClassic MCP Integration Spec constant exported by the index module.
mcpCapabilityDescriptorSchemaconstantconst mcpCapabilityDescriptorSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; owner: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; createdAt: z.ZodOptional<z.ZodString>; updatedAt: z.ZodOptional<z.ZodString>; } & { serverId: z.ZodString; capabilityId: z.ZodString; type: z.ZodEnum<["tool"...Runtime schema for MCP Capability Descriptor.
mcpIntegrationSpecDefinitionconstantconst mcpIntegrationSpecDefinition: SpecSchemaDefinition<MCPIntegrationSpec>Runtime validation entrypoint for the MCP Integration spec, combining its parser, example and JSON Schema.
mcpIntegrationSpecExampleconstantconst mcpIntegrationSpecExample: MCPIntegrationSpecValid example value for MCP Integration Spec.
mcpIntegrationSpecJsonSchemaconstantconst mcpIntegrationSpecJsonSchema: JsonSchemaJSON Schema for MCP Integration Spec.
mcpIntegrationSpecSchemaconstantconst mcpIntegrationSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; servers: z.ZodArray<z.ZodObject<{ id: z.ZodString; mode: z.ZodEnum<["local", "remote"]>; version: z.ZodOptional<z.ZodString>; endpoint: z.ZodOptional<z.ZodString>; command: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { id: string; mode: "local" | "remote"; version?: s...Runtime schema for MCP Integration Spec.
mcpServerSpecSchemaconstantconst mcpServerSpecSchema: z.ZodObject<{ id: z.ZodString; mode: z.ZodEnum<["local", "remote"]>; version: z.ZodOptional<z.ZodString>; endpoint: z.ZodOptional<z.ZodString>; command: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined...Runtime schema for MCP Server Spec.
mcpSpecDefinitionsconstantconst mcpSpecDefinitions: readonly [SpecSchemaDefinition<MCPIntegrationSpec>]MCP Spec Definitions constant exported by the index module.
mcpSpecJsonSchemasconstantconst mcpSpecJsonSchemas: Record<string, JsonSchema>MCP Spec JSON Schemas constant exported by the index module.
createClassicMCPMockGatewayfunctioncreateClassicMCPMockGateway(options?: ClassicMCPMockGatewayOptions): MockMCPGatewayCreate Classic MCP Mock Gateway function with 1 public call signature; parameters and return types are listed below.
normalizeMCPToolSpecfunctionnormalizeMCPToolSpec(capability: MCPCapabilityDescriptor): ToolSpecNormalize MCP Tool Spec function with 1 public call signature; parameters and return types are listed below.
registerMCPGatewayToolsfunctionregisterMCPGatewayTools(options: MCPGatewayToolRegistrationOptions): Promise<MCPGatewayToolRegistrationResult>Register MCP Gateway Tools function with 1 public call signature; parameters and return types are listed below.
validateMCPIntegrationSpecfunctionvalidateMCPIntegrationSpec(input: unknown): MCPIntegrationSpecValidate MCP Integration Spec function with 1 public call signature; parameters and return types are listed below.
ClassicMCPFetchResponseinterfaceinterface ClassicMCPFetchResponseClassic MCP Fetch Response interface with 4 public fields or methods.
ClassicMCPMockGatewayOptionsinterfaceinterface ClassicMCPMockGatewayOptionsClassic MCP Mock Gateway Options interface with 4 public fields or methods.
ClassicMCPSearchResultinterfaceinterface ClassicMCPSearchResultClassic MCP Search Result interface with 3 public fields or methods.
MCPCapabilityDescriptorinterfaceinterface MCPCapabilityDescriptor extends VersionedSpec, SpecMetadataMCP Capability Descriptor interface with 21 public fields or methods.
MCPGatewayinterfaceinterface MCPGatewayMCP Gateway interface with 7 public fields or methods.
MCPGatewayToolRegistrationContextinterfaceinterface MCPGatewayToolRegistrationContextMCP Gateway Tool Registration Context interface with 4 public fields or methods.
MCPGatewayToolRegistrationOptionsinterfaceinterface MCPGatewayToolRegistrationOptionsMCP Gateway Tool Registration Options interface with 6 public fields or methods.
MCPGatewayToolRegistrationResultinterfaceinterface MCPGatewayToolRegistrationResultMCP Gateway Tool Registration Result interface with 5 public fields or methods.
MCPIntegrationSpecinterfaceinterface MCPIntegrationSpecMCP Integration Spec interface with 13 public fields or methods.
MCPPromptRequestinterfaceinterface MCPPromptRequestMCP Prompt Request interface with 4 public fields or methods.
MCPPromptResultinterfaceinterface MCPPromptResultMCP Prompt Result interface with 3 public fields or methods.
MCPResourceReadRequestinterfaceinterface MCPResourceReadRequestMCP Resource Read Request interface with 3 public fields or methods.
MCPResourceResultinterfaceinterface MCPResourceResultMCP Resource Result interface with 2 public fields or methods.
MCPServerSpecinterfaceinterface MCPServerSpecMCP Server Spec interface with 6 public fields or methods.
MCPToolCallRequestinterfaceinterface MCPToolCallRequestMCP Tool Call Request interface with 4 public fields or methods.
NormalizedMCPCapabilityinterfaceinterface NormalizedMCPCapabilityNormalized MCP Capability interface with 6 public fields or methods.
MCPToolHandlertypetype MCPToolHandler = (request: MCPToolCallRequest<TInput>) => Promise<TOutput> | TOutputPublic type alias for MCP Tool Handler; the declaration contains its complete type expression.

MockMCPGateway

Mock MCP Gateway class with 11 public constructor or member entries; its exact declarations are listed below.

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

Declaration

text
export declare class MockMCPGateway implements MCPGateway {
    constructor(capabilities?: MCPCapabilityDescriptor[]);
    registerToolHandler(serverId: string, capabilityId: string, handler: MCPToolHandler): void;
    registerResource(serverId: string, uri: string, result: MCPResourceResult): void;
    registerPrompt(serverId: string, name: string, result: MCPPromptResult): void;
    discover(integration: MCPIntegrationSpec): Promise<MCPCapabilityDescriptor[]>;
    normalize(capability: MCPCapabilityDescriptor): Promise<NormalizedMCPCapability>;
    call(request: MCPToolCallRequest): Promise<unknown>;
    callTool(request: MCPToolCallRequest): Promise<unknown>;
    readResource(request: MCPResourceReadRequest): Promise<MCPResourceResult>;
    getPrompt(request: MCPPromptRequest): Promise<MCPPromptResult>;
    health(serverId?: string): Promise<Record<string, import('@codesoul-co/hypha-tools').ProviderHealth>>;
}

Public members

MemberKindSignatureDescription
callmethodcall(request: MCPToolCallRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.
callToolmethodcallTool(request: MCPToolCallRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.
constructorconstructor(capabilities?: MCPCapabilityDescriptor[]): MockMCPGatewayCreates an instance of this class.
discovermethoddiscover(integration: MCPIntegrationSpec): Promise<MCPCapabilityDescriptor[]>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, import("@codesoul-co/hypha-tools").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.
readResourcemethodreadResource(request: MCPResourceReadRequest): Promise<MCPResourceResult>Public method; parameters and return type are shown in the signature.
registerPromptmethodregisterPrompt(serverId: string, name: string, result: MCPPromptResult): voidPublic method; parameters and return type are shown in the signature.
registerResourcemethodregisterResource(serverId: string, uri: string, result: MCPResourceResult): voidPublic method; parameters and return type are shown in the signature.
registerToolHandlermethodregisterToolHandler(serverId: string, capabilityId: string, handler: MCPToolHandler): voidPublic method; parameters and return type are shown in the signature.

classicMCPCapabilityDescriptors

Classic MCP Capability Descriptors constant exported by the index module.

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

Declaration

text
export declare const classicMCPCapabilityDescriptors: MCPCapabilityDescriptor[];

classicMCPIntegrationSpec

Classic MCP Integration Spec constant exported by the index module.

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

Declaration

text
export declare const classicMCPIntegrationSpec: MCPIntegrationSpec;

mcpCapabilityDescriptorSchema

Runtime schema for MCP Capability Descriptor.

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

Declaration

text
export declare const mcpCapabilityDescriptorSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; owner: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; createdAt: z.ZodOptional<z.ZodString>; updatedAt: z.ZodOptional<z.ZodString>; } & { serverId: z.ZodString; capabilityId: z.ZodString; type: z.ZodEnum<["tool", "resource", "prompt"]>; inputSchema: z.ZodOptional<z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>>; outputSchema: z.ZodOptional<z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>>; sideEffectLevel: z.ZodOptional<z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>>; permissionScope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; capabilityHash: z.ZodOptional<z.ZodString>; trustLevel: z.ZodOptional<z.ZodEnum<["trusted", "reviewed", "untrusted"]>>; declarationSource: z.ZodOptional<z.ZodEnum<["framework", "user", "server", "unknown"]>>; }, "strip", z.ZodTypeAny, { id: string; type: "tool" | "resource" | "prompt"; version: string; serverId: string; capabilityId: string; name?: string | undefined; description?: string | undefined; owner?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; inputSchema?: JsonSchema | undefined; outputSchema?: JsonSchema | undefined; sideEffectLevel?: "none" | "read" | "write" | "external_effect" | "irreversible" | undefined; permissionScope?: string[] | undefined; capabilityHash?: string | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; declarationSource?: "unknown" | "framework" | "user" | "server" | undefined; }, { id: string; type: "tool" | "resource" | "prompt"; version: string; serverId: string; capabilityId: string; name?: string | undefined; description?: string | undefined; owner?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; inputSchema?: JsonSchema | undefined; outputSchema?: JsonSchema | undefined; sideEffectLevel?: "none" | "read" | "write" | "external_effect" | "irreversible" | undefined; permissionScope?: string[] | undefined; capabilityHash?: string | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; declarationSource?: "unknown" | "framework" | "user" | "server" | undefined; }>;

mcpIntegrationSpecDefinition

Runtime validation entrypoint for the MCP Integration spec, combining its parser, example and JSON Schema.

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

Declaration

text
export declare const mcpIntegrationSpecDefinition: SpecSchemaDefinition<MCPIntegrationSpec>;

mcpIntegrationSpecExample

Valid example value for MCP Integration Spec.

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

Declaration

text
export declare const mcpIntegrationSpecExample: MCPIntegrationSpec;

mcpIntegrationSpecJsonSchema

JSON Schema for MCP Integration Spec.

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

Declaration

text
export declare const mcpIntegrationSpecJsonSchema: JsonSchema;

mcpIntegrationSpecSchema

Runtime schema for MCP Integration Spec.

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

Declaration

text
export declare const mcpIntegrationSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; servers: z.ZodArray<z.ZodObject<{ id: z.ZodString; mode: z.ZodEnum<["local", "remote"]>; version: z.ZodOptional<z.ZodString>; endpoint: z.ZodOptional<z.ZodString>; command: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined; args?: string[] | undefined; }, { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined; args?: string[] | undefined; }>, "many">; allowedCapabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; deniedCapabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; trustPolicy: z.ZodOptional<z.ZodString>; importPolicy: z.ZodOptional<z.ZodString>; resourcePolicy: z.ZodOptional<z.ZodString>; toolPolicy: z.ZodOptional<z.ZodString>; promptPolicy: z.ZodOptional<z.ZodString>; versionPinning: z.ZodOptional<z.ZodBoolean>; capabilityHashing: z.ZodOptional<z.ZodBoolean>; driftPolicy: z.ZodOptional<z.ZodEnum<["quarantine", "accept"]>>; }, "strip", z.ZodTypeAny, { id: string; version: string; servers: { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined; args?: string[] | undefined; }[]; allowedCapabilities?: string[] | undefined; deniedCapabilities?: string[] | undefined; trustPolicy?: string | undefined; importPolicy?: string | undefined; resourcePolicy?: string | undefined; toolPolicy?: string | undefined; promptPolicy?: string | undefined; versionPinning?: boolean | undefined; capabilityHashing?: boolean | undefined; driftPolicy?: "quarantine" | "accept" | undefined; }, { id: string; version: string; servers: { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined; args?: string[] | undefined; }[]; allowedCapabilities?: string[] | undefined; deniedCapabilities?: string[] | undefined; trustPolicy?: string | undefined; importPolicy?: string | undefined; resourcePolicy?: string | undefined; toolPolicy?: string | undefined; promptPolicy?: string | undefined; versionPinning?: boolean | undefined; capabilityHashing?: boolean | undefined; driftPolicy?: "quarantine" | "accept" | undefined; }>;

mcpServerSpecSchema

Runtime schema for MCP Server Spec.

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

Declaration

text
export declare const mcpServerSpecSchema: z.ZodObject<{ id: z.ZodString; mode: z.ZodEnum<["local", "remote"]>; version: z.ZodOptional<z.ZodString>; endpoint: z.ZodOptional<z.ZodString>; command: z.ZodOptional<z.ZodString>; args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined; args?: string[] | undefined; }, { id: string; mode: "local" | "remote"; version?: string | undefined; endpoint?: string | undefined; command?: string | undefined; args?: string[] | undefined; }>;

mcpSpecDefinitions

MCP Spec Definitions constant exported by the index module.

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

Declaration

text
export declare const mcpSpecDefinitions: readonly [SpecSchemaDefinition<MCPIntegrationSpec>];

mcpSpecJsonSchemas

MCP Spec JSON Schemas constant exported by the index module.

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

Declaration

text
export declare const mcpSpecJsonSchemas: Record<string, JsonSchema>;

createClassicMCPMockGateway

Create Classic MCP Mock Gateway function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function createClassicMCPMockGateway(options?: ClassicMCPMockGatewayOptions): MockMCPGateway;

Call signature

text
createClassicMCPMockGateway(options?: ClassicMCPMockGatewayOptions): MockMCPGateway

Parameters

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

Returns

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

normalizeMCPToolSpec

Normalize MCP Tool Spec function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function normalizeMCPToolSpec(capability: MCPCapabilityDescriptor): ToolSpec;

Call signature

text
normalizeMCPToolSpec(capability: MCPCapabilityDescriptor): ToolSpec

Parameters

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

Returns

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

registerMCPGatewayTools

Register MCP Gateway Tools function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function registerMCPGatewayTools(options: MCPGatewayToolRegistrationOptions): Promise<MCPGatewayToolRegistrationResult>;

Call signature

text
registerMCPGatewayTools(options: MCPGatewayToolRegistrationOptions): Promise<MCPGatewayToolRegistrationResult>

Parameters

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

Returns

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

validateMCPIntegrationSpec

Validate MCP Integration Spec function with 1 public call signature; parameters and return types are listed below.

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

Declaration

text
export declare function validateMCPIntegrationSpec(input: unknown): MCPIntegrationSpec;

Call signature

text
validateMCPIntegrationSpec(input: unknown): MCPIntegrationSpec

Parameters

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

Returns

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

ClassicMCPFetchResponse

Classic MCP Fetch Response interface with 4 public fields or methods.

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

Declaration

text
export interface ClassicMCPFetchResponse {
    status?: number;
    headers?: Record<string, string>;
    body?: string;
    json?: unknown;
}

Contract members

MemberKindSignatureDescription
bodypropertybody?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
headerspropertyheaders?: Record<string, string>Public property; its type, readonly modifier and optionality are shown in the signature.
jsonpropertyjson?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ClassicMCPMockGatewayOptions

Classic MCP Mock Gateway Options interface with 4 public fields or methods.

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

Declaration

text
export interface ClassicMCPMockGatewayOptions {
    files?: Record<string, string>;
    fetchResponses?: Record<string, ClassicMCPFetchResponse>;
    now?: string;
    searchResults?: Record<string, ClassicMCPSearchResult[]>;
}

Contract members

MemberKindSignatureDescription
fetchResponsespropertyfetchResponses?: Record<string, ClassicMCPFetchResponse>Public property; its type, readonly modifier and optionality are shown in the signature.
filespropertyfiles?: Record<string, string>Public property; its type, readonly modifier and optionality are shown in the signature.
nowpropertynow?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
searchResultspropertysearchResults?: Record<string, ClassicMCPSearchResult[]>Public property; its type, readonly modifier and optionality are shown in the signature.

ClassicMCPSearchResult

Classic MCP Search Result interface with 3 public fields or methods.

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

Declaration

text
export interface ClassicMCPSearchResult {
    title: string;
    url: string;
    snippet: string;
}

Contract members

MemberKindSignatureDescription
snippetpropertysnippet: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
titlepropertytitle: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
urlpropertyurl: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPCapabilityDescriptor

MCP Capability Descriptor interface with 21 public fields or methods.

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

Declaration

text
export interface MCPCapabilityDescriptor extends VersionedSpec, SpecMetadata {
    serverId: string;
    capabilityId: string;
    type: 'tool' | 'resource' | 'prompt';
    inputSchema?: JsonSchema;
    outputSchema?: JsonSchema;
    sideEffectLevel?: SideEffectLevel;
    permissionScope?: string[];
    capabilityHash?: string;
    trustLevel?: 'trusted' | 'reviewed' | 'untrusted';
    declarationSource?: 'framework' | 'user' | 'server' | 'unknown';
    annotations?: Record<string, unknown>;
    protocolVersion?: string;
    serverIdentity?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
annotationspropertyannotations?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
capabilityHashpropertycapabilityHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
capabilityIdpropertycapabilityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
createdAtpropertycreatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
declarationSourcepropertydeclarationSource?: "unknown" | "user" | "framework" | "server"Public property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription?: stringPublic 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.
inputSchemapropertyinputSchema?: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
outputSchemapropertyoutputSchema?: JsonSchemaPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerpropertyowner?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
permissionScopepropertypermissionScope?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
protocolVersionpropertyprotocolVersion?: stringPublic 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.
serverIdentitypropertyserverIdentity?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
sideEffectLevelpropertysideEffectLevel?: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
tagspropertytags?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
trustLevelpropertytrustLevel?: "trusted" | "reviewed" | "untrusted"Public property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "tool" | "prompt" | "resource"Public property; its type, readonly modifier and optionality are shown in the signature.
updatedAtpropertyupdatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPGateway

MCP Gateway interface with 7 public fields or methods.

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

Declaration

text
export interface MCPGateway {
    discover(integration: MCPIntegrationSpec): Promise<MCPCapabilityDescriptor[]>;
    normalize(capability: MCPCapabilityDescriptor): Promise<NormalizedMCPCapability>;
    call(request: MCPToolCallRequest): Promise<unknown>;
    /** @deprecated Use call(). Kept for adapters migrating from the classic gateway contract. */
    callTool?(request: MCPToolCallRequest): Promise<unknown>;
    readResource?(request: MCPResourceReadRequest): Promise<MCPResourceResult>;
    getPrompt?(request: MCPPromptRequest): Promise<MCPPromptResult>;
    health(serverId?: string): Promise<Record<string, import('@codesoul-co/hypha-tools').ProviderHealth>>;
}

Contract members

MemberKindSignatureDescription
callmethodcall(request: MCPToolCallRequest): Promise<unknown>Public method; parameters and return type are shown in the signature.
callToolmethodcallTool?(request: MCPToolCallRequest): Promise<unknown>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.
getPromptmethodgetPrompt?(request: MCPPromptRequest): Promise<MCPPromptResult>Public method; parameters and return type are shown in the signature.
healthmethodhealth(serverId?: string): Promise<Record<string, import("@codesoul-co/hypha-tools").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.
readResourcemethodreadResource?(request: MCPResourceReadRequest): Promise<MCPResourceResult>Public method; parameters and return type are shown in the signature.

MCPGatewayToolRegistrationContext

MCP Gateway Tool Registration Context interface with 4 public fields or methods.

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

Declaration

text
export interface MCPGatewayToolRegistrationContext {
    runId: string;
    stepId?: string;
    sessionId?: string;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stepIdpropertystepId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPGatewayToolRegistrationOptions

MCP Gateway Tool Registration Options interface with 6 public fields or methods.

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

Declaration

text
export interface MCPGatewayToolRegistrationOptions {
    integration: MCPIntegrationSpec;
    gateway: MCPGateway;
    registry: ToolRegistry;
    trace?: TraceRecorder;
    traceContext?: MCPGatewayToolRegistrationContext;
    baselineStore?: MCPCapabilityBaselineStore;
}

Contract members

MemberKindSignatureDescription
baselineStorepropertybaselineStore?: MCPCapabilityBaselineStorePublic property; its type, readonly modifier and optionality are shown in the signature.
gatewaypropertygateway: MCPGatewayPublic property; its type, readonly modifier and optionality are shown in the signature.
integrationpropertyintegration: MCPIntegrationSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
registrypropertyregistry: ToolRegistryPublic 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?: MCPGatewayToolRegistrationContextPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPGatewayToolRegistrationResult

MCP Gateway Tool Registration Result interface with 5 public fields or methods.

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

Declaration

text
export interface MCPGatewayToolRegistrationResult {
    discoveredCapabilities: MCPCapabilityDescriptor[];
    normalizedCapabilities: NormalizedMCPCapability[];
    registeredTools: ToolSpec[];
    quarantinedCapabilities: MCPCapabilityDescriptor[];
    driftRecords: MCPDriftRecord[];
}

Contract members

MemberKindSignatureDescription
discoveredCapabilitiespropertydiscoveredCapabilities: MCPCapabilityDescriptor[]Public property; its type, readonly modifier and optionality are shown in the signature.
driftRecordspropertydriftRecords: MCPDriftRecord[]Public property; its type, readonly modifier and optionality are shown in the signature.
normalizedCapabilitiespropertynormalizedCapabilities: NormalizedMCPCapability[]Public property; its type, readonly modifier and optionality are shown in the signature.
quarantinedCapabilitiespropertyquarantinedCapabilities: MCPCapabilityDescriptor[]Public property; its type, readonly modifier and optionality are shown in the signature.
registeredToolspropertyregisteredTools: ToolSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.

MCPIntegrationSpec

MCP Integration Spec interface with 13 public fields or methods.

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

Declaration

text
export interface MCPIntegrationSpec {
    id: string;
    version: string;
    servers: MCPServerSpec[];
    allowedCapabilities?: string[];
    deniedCapabilities?: string[];
    trustPolicy?: string;
    importPolicy?: string;
    resourcePolicy?: string;
    toolPolicy?: string;
    promptPolicy?: string;
    versionPinning?: boolean;
    capabilityHashing?: boolean;
    driftPolicy?: MCPDriftPolicy;
}

Contract members

MemberKindSignatureDescription
allowedCapabilitiespropertyallowedCapabilities?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
capabilityHashingpropertycapabilityHashing?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
deniedCapabilitiespropertydeniedCapabilities?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
driftPolicypropertydriftPolicy?: MCPDriftPolicyPublic 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.
importPolicypropertyimportPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
promptPolicypropertypromptPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
resourcePolicypropertyresourcePolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
serverspropertyservers: MCPServerSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
toolPolicypropertytoolPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
trustPolicypropertytrustPolicy?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
versionPinningpropertyversionPinning?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPPromptRequest

MCP Prompt Request interface with 4 public fields or methods.

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

Declaration

text
export interface MCPPromptRequest {
    serverId: string;
    name: string;
    arguments?: Record<string, string>;
    context?: Partial<ToolCallContext>;
}

Contract members

MemberKindSignatureDescription
argumentspropertyarguments?: Record<string, string>Public property; its type, readonly modifier and optionality are shown in the signature.
contextpropertycontext?: Partial<ToolCallContext>Public property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname: stringPublic 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.

MCPPromptResult

MCP Prompt Result interface with 3 public fields or methods.

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

Declaration

text
export interface MCPPromptResult {
    description?: string;
    messages: unknown[];
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
descriptionpropertydescription?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
messagespropertymessages: unknown[]Public 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.

MCPResourceReadRequest

MCP Resource Read Request interface with 3 public fields or methods.

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

Declaration

text
export interface MCPResourceReadRequest {
    serverId: string;
    uri: string;
    context?: Partial<ToolCallContext>;
}

Contract members

MemberKindSignatureDescription
contextpropertycontext?: Partial<ToolCallContext>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.
uripropertyuri: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPResourceResult

MCP Resource Result interface with 2 public fields or methods.

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

Declaration

text
export interface MCPResourceResult {
    contents: Array<{
        uri: string;
        mimeType?: string;
        text?: string;
        blob?: string;
        metadata?: Record<string, unknown>;
    }>;
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
contentspropertycontents: { uri: string; mimeType?: string; text?: string; blob?: string; metadata?: Record<string, unknown>; }[]Public 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.

MCPServerSpec

MCP Server Spec interface with 6 public fields or methods.

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

Declaration

text
export interface MCPServerSpec {
    id: string;
    mode: 'local' | 'remote';
    version?: string;
    endpoint?: string;
    command?: string;
    args?: string[];
}

Contract members

MemberKindSignatureDescription
argspropertyargs?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
commandpropertycommand?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
endpointpropertyendpoint?: stringPublic 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.
modepropertymode: "local" | "remote"Public property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MCPToolCallRequest

MCP Tool Call Request interface with 4 public fields or methods.

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

Declaration

text
export interface MCPToolCallRequest<TInput = unknown> {
    serverId: string;
    capabilityId: string;
    input: TInput;
    context: ToolCallContext;
}

Contract members

MemberKindSignatureDescription
capabilityIdpropertycapabilityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contextpropertycontext: ToolCallContextPublic property; its type, readonly modifier and optionality are shown in the signature.
inputpropertyinput: TInputPublic 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.

NormalizedMCPCapability

Normalized MCP Capability interface with 6 public fields or methods.

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

Declaration

text
export interface NormalizedMCPCapability {
    serverId: string;
    capabilityId: string;
    type: 'tool' | 'resource' | 'prompt';
    normalizedSpecId: string;
    capabilityHash?: string;
    sideEffectLevel?: SideEffectLevel;
}

Contract members

MemberKindSignatureDescription
capabilityHashpropertycapabilityHash?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
capabilityIdpropertycapabilityId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
normalizedSpecIdpropertynormalizedSpecId: stringPublic 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.
sideEffectLevelpropertysideEffectLevel?: SideEffectLevelPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "tool" | "prompt" | "resource"Public property; its type, readonly modifier and optionality are shown in the signature.

MCPToolHandler

Public type alias for MCP Tool Handler; the declaration contains its complete type expression.

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

Declaration

text
export type MCPToolHandler<TInput = unknown, TOutput = unknown> = (request: MCPToolCallRequest<TInput>) => Promise<TOutput> | TOutput;