AxMCPRecordingTransport
Implements
Constructors
Constructor
new AxMCPRecordingTransport(inner: AxMCPTransport): AxMCPRecordingTransport;Parameters
| Parameter | Type |
|---|---|
inner | AxMCPTransport |
Returns
AxMCPRecordingTransport
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
evaluationMode | readonly | "record" | Indicates whether optimizer/evaluation use can cause live side effects. |
Methods
close()
close(): Promise<void>;Releases transport resources. Implementations should be idempotent.
Returns
Promise<void>
Implementation of
connect()
connect(): Promise<void>;Connects to the transport if needed This method is optional and only required for transports that need connection setup
Returns
Promise<void>
Implementation of
getRecording()
getRecording(): readonly AxMCPTransportRecordingEntry[];Returns
readonly AxMCPTransportRecordingEntry[]
send()
send(message: Readonly<AxMCPJSONRPCRequest<unknown>>, options?: Readonly<AxMCPRequestOptions>): Promise<AxMCPJSONRPCResponse<unknown>>;Sends a JSON-RPC request or notification and returns the response
Parameters
| Parameter | Type | Description |
|---|---|---|
message | Readonly<AxMCPJSONRPCRequest<unknown>> | The JSON-RPC request or notification to send |
options? | Readonly<AxMCPRequestOptions> | - |
Returns
Promise<AxMCPJSONRPCResponse<unknown>>
A Promise that resolves to the JSON-RPC response
Implementation of
sendBatch()
sendBatch(messages: readonly Readonly<AxMCPJSONRPCRequest<unknown>>[], options?: Readonly<AxMCPRequestOptions>): Promise<readonly AxMCPJSONRPCResponse<unknown>[]>;Sends one version-gated JSON-RPC batch on transports that support it.
Parameters
| Parameter | Type |
|---|---|
messages | readonly Readonly<AxMCPJSONRPCRequest<unknown>>[] |
options? | Readonly<AxMCPRequestOptions> |
Returns
Promise<readonly AxMCPJSONRPCResponse<unknown>[]>
Implementation of
sendNotification()
sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;Sends a JSON-RPC notification
Parameters
| Parameter | Type | Description |
|---|---|---|
message | Readonly<AxMCPJSONRPCNotification> | The JSON-RPC notification to send |
Returns
Promise<void>
Implementation of
AxMCPTransport.sendNotification
sendResponse()
sendResponse(message: Readonly<AxMCPJSONRPCResponse>): Promise<void>;Sends a JSON-RPC response for a server-initiated request. Transports that cannot receive server requests do not need to implement it.
Parameters
| Parameter | Type |
|---|---|
message | Readonly<AxMCPJSONRPCResponse> |
Returns
Promise<void>
Implementation of
setLifecycleHandler()
setLifecycleHandler(handler: (state: "reconnected") => void | Promise<void>): void;Registers transport lifecycle events that require client-level recovery.
Parameters
| Parameter | Type |
|---|---|
handler | (state: "reconnected") => void | Promise<void> |
Returns
void
Implementation of
AxMCPTransport.setLifecycleHandler
setMessageHandler()
setMessageHandler(handler: (message: Readonly<AxMCPJSONRPCMessage>) => void | Promise<void>): void;Registers a handler for server-initiated JSON-RPC requests and notifications that arrive outside a direct client request response.
Parameters
| Parameter | Type |
|---|---|
handler | (message: Readonly<AxMCPJSONRPCMessage>) => void | Promise<void> |
Returns
void
Implementation of
AxMCPTransport.setMessageHandler
setProtocolVersion()
setProtocolVersion(protocolVersion: string): void;Stores the negotiated MCP protocol version for transports that must emit it on later frames or HTTP requests.
Parameters
| Parameter | Type |
|---|---|
protocolVersion | string |
Returns
void
Implementation of
AxMCPTransport.setProtocolVersion
startListening()
startListening(options?: Readonly<AxMCPListeningOptions>):
| AxMCPListeningHandle
| Promise<AxMCPListeningHandle>;Starts a nonblocking server-message listener when the transport needs one.
Parameters
| Parameter | Type |
|---|---|
options? | Readonly<AxMCPListeningOptions> |
Returns
| AxMCPListeningHandle
| Promise<AxMCPListeningHandle>
Implementation of
takeRequestMetadata()
takeRequestMetadata(id: string | number):
| undefined
| Readonly<{
retryCount?: number;
}>;One-shot metadata for the most recently completed request ID.
Parameters
| Parameter | Type |
|---|---|
id | string | number |
Returns
| undefined
| Readonly<{
retryCount?: number;
}>
Implementation of
AxMCPTransport.takeRequestMetadata
terminateSession()
terminateSession(): Promise<void>;Terminates a negotiated transport session when supported.
Returns
Promise<void>