AxMCPTransport Generated TypeScript API reference. typescript api api/reference build/apidocs/Interface.AxMCPTransport.md interface AxMCPTransport

AxMCPTransport

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L8

Methods

connect()?

TypeScript
optional connect(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L48

Connects to the transport if needed This method is optional and only required for transports that need connection setup

Returns

Promise<void>


send()

TypeScript
send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): Promise<AxMCPJSONRPCResponse<unknown>>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L14

Sends a JSON-RPC request or notification and returns the response

Parameters

ParameterTypeDescription
messageReadonly<AxMCPJSONRPCRequest<unknown>>The JSON-RPC request or notification to send

Returns

Promise<AxMCPJSONRPCResponse<unknown>>

A Promise that resolves to the JSON-RPC response


sendNotification()

TypeScript
sendNotification(message: Readonly<AxMCPJSONRPCNotification>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L22

Sends a JSON-RPC notification

Parameters

ParameterTypeDescription
messageReadonly<AxMCPJSONRPCNotification>The JSON-RPC notification to send

Returns

Promise<void>


sendResponse()?

TypeScript
optional sendResponse(message: Readonly<AxMCPJSONRPCResponse>): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L28

Sends a JSON-RPC response for a server-initiated request. Transports that cannot receive server requests do not need to implement it.

Parameters

ParameterType
messageReadonly<AxMCPJSONRPCResponse>

Returns

Promise<void>


setMessageHandler()?

TypeScript
optional setMessageHandler(handler: (message: Readonly<AxMCPJSONRPCMessage>) => void | Promise<void>): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L34

Registers a handler for server-initiated JSON-RPC requests and notifications that arrive outside a direct client request response.

Parameters

ParameterType
handler(message: Readonly<AxMCPJSONRPCMessage>) => void | Promise<void>

Returns

void


setProtocolVersion()?

TypeScript
optional setProtocolVersion(protocolVersion: string): void;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/mcp/transport.ts#L42

Stores the negotiated MCP protocol version for transports that must emit it on later frames or HTTP requests.

Parameters

ParameterType
protocolVersionstring

Returns

void

Docs