AxMCPHTTPSSETransport
Implements
Constructors
Constructor
new AxMCPHTTPSSETransport(sseUrl: string, options: Readonly<AxMCPStreamableHTTPTransportOptions>): AxMCPHTTPSSETransport;Parameters
| Parameter | Type |
|---|---|
sseUrl | string |
options | Readonly<AxMCPStreamableHTTPTransportOptions> |
Returns
AxMCPHTTPSSETransport
Methods
close()
close(): void;Returns
void
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
send()
send(message: Readonly<AxMCPJSONRPCRequest<unknown>>): 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 |
Returns
Promise<AxMCPJSONRPCResponse<unknown>>
A Promise that resolves to the JSON-RPC response
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
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