AxMCPStreambleHTTPTransport
Implements
Constructors
Constructor
new AxMCPStreambleHTTPTransport(mcpEndpoint: string, options?: AxMCPStreamableHTTPTransportOptions): AxMCPStreambleHTTPTransport;
Parameters
| Parameter | Type |
|---|---|
mcpEndpoint | string |
options? | AxMCPStreamableHTTPTransportOptions |
Returns
AxMCPStreambleHTTPTransport
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
getHeaders()
getHeaders(): Record<string, string>;
Returns
Record<string, string>
openListeningStream()
openListeningStream(): Promise<void>;
Returns
Promise<void>
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
setAuthorization()
setAuthorization(authorization: string): void;
Parameters
| Parameter | Type |
|---|---|
authorization | string |
Returns
void
setHeaders()
setHeaders(headers: Record<string, string>): void;
Parameters
| Parameter | Type |
|---|---|
headers | Record<string, string> |
Returns
void
setMessageHandler()
setMessageHandler(handler: (message:
| AxMCPJSONRPCNotification
| AxMCPJSONRPCRequest<unknown>) => void): void;
Parameters
| Parameter | Type |
|---|---|
handler | (message: | AxMCPJSONRPCNotification | AxMCPJSONRPCRequest<unknown>) => void |
Returns
void
terminateSession()
terminateSession(): Promise<void>;
Returns
Promise<void>