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
a week ago (0.4.4)
class McpClient

MCPClient handles communication with MCP servers and tool execution

Constructors

new
McpClient(
context: ZypherContext,
serverEndpoint: McpServerEndpoint,
clientOptions?: McpClientOptions,
)

Creates a new MCPClient instance with separated server and client configuration

Properties

Sets the desired enabled state and triggers connection/disconnection

Checks if this client is connected to a server

Gets the desired enabled state

readonly
status: McpClientStatus

Gets the number of tools managed by this client

readonly
tools: Tool[]

Gets all tools managed by this client

Methods

Disposes of the client and cleans up all resources Should be called when the client is no longer needed

executeToolCall(toolCall: { name: string; input: Record<string, unknown>; }): Promise<CallToolResult>

Executes a tool call and returns the result

getTool(name: string): Tool | undefined

Gets a specific tool by name

Waits for the client to complete the full connection sequence

This method waits for the entire connection process to complete, including:

  1. Establishing connection to the MCP server
  2. Discovering and registering available tools (reaches connected.toolDiscovered state)

The connection sequence has substates:

  • connected.initial: Just connected, tool discovery not yet started
  • connected.toolDiscovered: Full connection complete, tools discovered and ready

Note: This method requires desiredEnabled to be set to true first. If desiredEnabled is false, this method will throw immediately rather than wait. If desiredEnabled is changed to false while waiting, the method will throw.

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 { McpClient } from "@corespeed/zypher";
or

Import directly with a jsr specifier

import { McpClient } 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 { McpClient } 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 { McpClient } from "@corespeed/zypher";

Add Package

vlt install jsr:@corespeed/zypher

Import symbol

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

Add Package

npx jsr add @corespeed/zypher

Import symbol

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

Add Package

bunx jsr add @corespeed/zypher

Import symbol

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