Skip to main content
Home

Built and signed on GitHub Actions

An open-source agent framework for building production-ready agentic AI agents

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
88%
Published
6 days ago (0.4.4)
function connectToRemoteServer
connectToRemoteServer(
client: Client,
remoteConfig: McpRemoteConfig,
options?: { signal?: AbortSignal; oauth?: OAuthOptions; },
): Promise<Transport>

Connects to a remote MCP server with automatic transport fallback

Implements the MCP specification for backwards compatibility by attempting multiple transport methods in sequence:

  1. First attempts StreamableHTTPClientTransport (modern streaming transport)
  2. If that fails with a 4xx HTTP error (excluding 401), falls back to SSEClientTransport

Both transports support OAuth authentication when oauth options are provided. If a 401 Unauthorized error occurs, the OAuth flow will be initiated automatically.

Parameters

client: Client

The MCP client instance

remoteConfig: McpRemoteConfig

The remote server endpoint configuration

optional
options: { signal?: AbortSignal; oauth?: OAuthOptions; }

Optional configuration including abort signal and OAuth settings

Return Type

Promise<Transport>

Promise that resolves to the connected transport

Throws

Error if connection fails on all transport attempts or OAuth is required but not provided

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@corespeed/zypher

Import symbol

import { connectToRemoteServer } from "@corespeed/zypher";
or

Import directly with a jsr specifier

import { connectToRemoteServer } from "jsr:@corespeed/zypher";

Add Package

pnpm i jsr:@corespeed/zypher
or (using pnpm 10.8 or older)
pnpm dlx jsr add @corespeed/zypher

Import symbol

import { connectToRemoteServer } from "@corespeed/zypher";

Add Package

yarn add jsr:@corespeed/zypher
or (using Yarn 4.8 or older)
yarn dlx jsr add @corespeed/zypher

Import symbol

import { connectToRemoteServer } from "@corespeed/zypher";

Add Package

vlt install jsr:@corespeed/zypher

Import symbol

import { connectToRemoteServer } from "@corespeed/zypher";

Add Package

npx jsr add @corespeed/zypher

Import symbol

import { connectToRemoteServer } from "@corespeed/zypher";

Add Package

bunx jsr add @corespeed/zypher

Import symbol

import { connectToRemoteServer } from "@corespeed/zypher";