Skip to content
Effect Days 2026 Get your ticket

McpProtocol

Defines the MCP protocol implementations that an McpServer can support.

11 exports Added in v4.0.0 Source

Models

AnyProtocolAdapter interface

Added in v4.0.0 Source

The operational shape shared by protocol adapters.

Signature

interface AnyProtocolAdapter<out Version extends string = string, HandlerRequirements = unknown> {
readonly clientNotificationRpcs: ErasedRpcGroup;
readonly clientRpcs: ErasedClientRpcGroup;
readonly installHandlers: (core: any, lifecycle: any, target: any) => Effect<void, never, HandlerRequirements>;
readonly makeReverseClient: (profile: any) => Effect<McpReverseClient, never, Scope | Protocol>;
readonly normalizeCancellation: (payload: unknown) => Effect<any, unknown>;
readonly payloadCodecs: (rpc: AnyWithProps) => PayloadCodecs;
readonly projectNotification: (notification: any) => Effect<ProjectedNotification | undefined, any>;
readonly protocolVersion: Version;
readonly serverNotificationRpcs: ErasedRpcGroup<AnyWithProps>;
readonly serverRequestRpcs: Any;
readonly transport: {
readonly acceptsJsonRpcBatches: boolean;
readonly requiresVersionHeader: boolean;
};
}

ErasedClientRpcGroup interface

Added in v4.0.0 Source

The additional operation required from the complete client RPC group.

Signature

interface ErasedClientRpcGroup extends ErasedRpcGroup {
readonly prefix: (prefix: string) => RpcGroup<any>;
}

ErasedRpcGroup interface

Added in v4.0.0 Source

The operations required from an RPC group after its RPC union is erased.

Signature

interface ErasedRpcGroup<RpcType extends Rpc.Any = Rpc.Any> {
readonly requests: ReadonlyMap<string, RpcType>;
}

PayloadCodecs interface

Added in v4.0.0 Source

Payload codecs used by a protocol adapter.

Signature

interface PayloadCodecs {
readonly decode: (input: unknown) => Effect<unknown, SchemaError>;
readonly encode: (input: unknown) => Effect<unknown, SchemaError>;
}

ProjectedNotification interface

Added in v4.0.0 Source

A notification projected into a protocol-specific payload.

Signature

interface ProjectedNotification {
readonly payload: unknown;
readonly tag: string;
}

ProtocolAdapter interface

Added in v4.0.0 Source

An MCP protocol adapter that can be supplied to McpServer.

Signature

interface ProtocolAdapter<out Version extends ProtocolVersion = ProtocolVersion> extends AnyProtocolAdapter<Version> {}

ProtocolVersion type

Added in v4.0.0 Source

The MCP protocol versions implemented by this release.

Signature

type ProtocolVersion = "2024-11-05" | "2025-03-26" | "2025-06-18" | "2025-11-25"

Protocols

v2024_11_05

Added in v4.0.0 Source

The MCP 2024-11-05 protocol implementation.

Details

It provides the dated schema and stdio behavior. When supplied to McpServer.layerHttp, the server uses its single-endpoint Streamable HTTP compatibility transport; it does not implement the historical two-endpoint HTTP+SSE transport.

Signature

declare const v2024_11_05: ProtocolAdapter<"2024-11-05">

v2025_03_26

Added in v4.0.0 Source

The MCP 2025-03-26 protocol implementation.

Signature

declare const v2025_03_26: ProtocolAdapter<"2025-03-26">

v2025_06_18

Added in v4.0.0 Source

The MCP 2025-06-18 protocol implementation.

Signature

declare const v2025_06_18: ProtocolAdapter<"2025-06-18">

v2025_11_25

Added in v4.0.0 Source

The MCP 2025-11-25 protocol implementation.

Signature

declare const v2025_11_25: ProtocolAdapter<"2025-11-25">