Creates an HTTP connector.
MCP endpoint URL.
Authentication, transport, SDK, and reconnection options.
Instructions supplied by the connected server, if any.
Whether an SDK client currently exists for this connector.
The protocol version string negotiated for the active connection.
The negotiated protocol era for the active connection.
"legacy" — 2025-era server, sessionful initialize handshake."modern" — 2026-era server, stateless per-request.
undefined before the connection has negotiated.Returns fields that identify the endpoint and negotiated transport.
HTTP connector identity metadata.
Capabilities cached during initialization, or an empty object.
Server identity cached during initialization, or null.
Returns the tool list cached during initialization.
When BaseConnector.initialize has not completed.
Calls a tool on the connected server.
Tool name.
Tool arguments.
Optionaloptions: RequestOptions
Per-request timeout, cancellation, and progress options.
The tool result returned by the server.
Request completion suggestions for a prompt or resource template argument
Completion request parameters
Optionaloptions: RequestOptions
Request options
Completion suggestions from the server
Disconnects the SDK client and releases transport resources.
A promise that resolves after cleanup completes.
Gets a prompt with the supplied arguments.
Prompt name.
Prompt arguments.
The rendered prompt returned by the server.
Returns the roots currently advertised to the server.
A copy of the configured roots.
Returns the active transport type.
"streamable-http" after connection, otherwise null.
Initialise the MCP session after connect() has succeeded.
In the SDK, Client.connect(transport) automatically performs the
protocol‑level initialize handshake, so we only need to cache the list of
tools and expose some server info.
Options used while fetching the initial tool list.
The capabilities advertised by the server.
When BaseConnector.connect has not completed.
List all resources from the server, automatically handling pagination
Optionaloptions: RequestOptions
Request options
Complete list of all resources
Lists prompts exposed by the server.
The prompt list, or an empty list when prompts are unsupported.
List resources from the server with optional pagination
Optionalcursor: string
Optional cursor for pagination
Optionaloptions: RequestOptions
Request options
Resource list with optional nextCursor for pagination
List resource templates from the server
Optionaloptions: RequestOptions
Request options
List of available resource templates
List all available tools from the MCP server.
This method fetches fresh tools from the server, unlike the tools getter which returns cached tools.
Optionaloptions: RequestOptions
Optional request options
Array of available tools
Register a handler for server notifications
Function to call when a notification is received
Reads a resource by URI.
Resource URI to read.
Optionaloptions: RequestOptions
Per-request options.
The resource contents returned by the server.
Sends a raw, potentially non-standard request through the SDK client.
JSON-RPC method name.
Request parameters. Defaults to an empty object.
Optionaloptions: RequestOptions
Per-request options.
The unvalidated result returned by the server.
Set roots and notify the server. Roots represent directories or files that the client has access to.
Array of Root objects with uri (must start with "file://") and optional name
Subscribe to resource updates
URI of the resource to subscribe to
Optionaloptions: RequestOptions
Request options
Unsubscribe from resource updates
URI of the resource to unsubscribe from
Optionaloptions: RequestOptions
Request options
Connects to an MCP server using streamable HTTP.
The connector negotiates modern and legacy protocol eras by default and can route transport requests through an HTTP gateway.