Skip to main content

Overview

Transport errors are thrown by the MCP transport layer — the component responsible for managing HTTP connections, sessions, and message framing. Most are internal errors except UnsupportedContentTypeError, which is a client-facing 400 error.

Error Reference

MethodNotImplementedError

Thrown when calling an abstract or placeholder method that has not been implemented.
PropertyTypeValue
codestringMETHOD_NOT_IMPLEMENTED
statusCodenumber500
isPublicbooleanfalse
new MethodNotImplementedError(className?: string, methodName?: string)
Example:
import { MethodNotImplementedError } from '@frontmcp/sdk';

throw new MethodNotImplementedError('CustomTransport', 'send');
// "CustomTransport.send() is not implemented"

UnsupportedTransportTypeError

Thrown when an unsupported transport type is specified in configuration.
PropertyTypeValue
codestringUNSUPPORTED_TRANSPORT_TYPE
statusCodenumber500
isPublicbooleanfalse
new UnsupportedTransportTypeError(transportType: string)
Example:
import { UnsupportedTransportTypeError } from '@frontmcp/sdk';

throw new UnsupportedTransportTypeError('websocket');
// "Unsupported transport type: "websocket""

TransportBusRequiredError

Thrown when a transport bus is required but not provided.
PropertyTypeValue
codestringTRANSPORT_BUS_REQUIRED
statusCodenumber500
isPublicbooleanfalse
new TransportBusRequiredError()

InvalidTransportSessionError

Thrown when a transport session is invalid or missing.
PropertyTypeValue
codestringINVALID_TRANSPORT_SESSION
statusCodenumber500
isPublicbooleanfalse
new InvalidTransportSessionError(message: string)
Example:
import { InvalidTransportSessionError } from '@frontmcp/sdk';

throw new InvalidTransportSessionError('Session ID missing from request headers');

TransportNotConnectedError

Thrown when an operation is attempted on a transport that is not connected.
PropertyTypeValue
codestringTRANSPORT_NOT_CONNECTED
statusCodenumber500
isPublicbooleanfalse
new TransportNotConnectedError(context?: string)
Example:
import { TransportNotConnectedError } from '@frontmcp/sdk';

throw new TransportNotConnectedError('SSE channel closed');

TransportAlreadyStartedError

Thrown when attempting to start a transport that is already running.
PropertyTypeValue
codestringTRANSPORT_ALREADY_STARTED
statusCodenumber500
isPublicbooleanfalse
new TransportAlreadyStartedError(message?: string)

UnsupportedContentTypeError

Thrown when a request uses an unsupported Content-Type header. This is a public error since it represents a client-side issue.
PropertyTypeValue
codestringUNSUPPORTED_CONTENT_TYPE
statusCodenumber400
isPublicbooleantrue
contentTypestringThe unsupported content type
new UnsupportedContentTypeError(contentType: string)
Example:
import { UnsupportedContentTypeError } from '@frontmcp/sdk';

throw new UnsupportedContentTypeError('text/xml');
// "Unsupported content-type: text/xml"