AxMCPClient
Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L191
Constructors
Constructor
new AxMCPClient(transport: AxMCPTransport, options: Readonly<AxMCPClientOptions>): AxMCPClient;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L227
Parameters
| Parameter | Type |
|---|---|
transport | AxMCPTransport |
options | Readonly<AxMCPClientOptions> |
Returns
AxMCPClient
Methods
acquireResourceSubscription()
acquireResourceSubscription(uri: string, owner: string): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1159
Acquires one logical owner for a resource subscription.
Parameters
| Parameter | Type |
|---|---|
uri | string |
owner | string |
Returns
Promise<void>
batch()
batch(requests: readonly Readonly<AxMCPBatchRequest<unknown>>[], options?: Readonly<AxMCPRequestOptions>): Promise<readonly AxMCPBatchResponse<unknown>[]>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L362
Parameters
| Parameter | Type |
|---|---|
requests | readonly Readonly<AxMCPBatchRequest<unknown>>[] |
options? | Readonly<AxMCPRequestOptions> |
Returns
Promise<readonly AxMCPBatchResponse<unknown>[]>
callTool()
callTool(
name: string,
args?: unknown,
options?: Readonly<AxMCPRequestOptions>): Promise<AxMCPToolCallResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L857
Parameters
| Parameter | Type |
|---|---|
name | string |
args? | unknown |
options? | Readonly<AxMCPRequestOptions> |
Returns
Promise<AxMCPToolCallResult>
callToolTask()
callToolTask(
name: string,
args?: unknown,
task?: AxMCPTaskMetadata,
options?: Readonly<AxMCPRequestOptions>): Promise<AxMCPCreateTaskResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L891
Parameters
| Parameter | Type |
|---|---|
name | string |
args? | unknown |
task? | AxMCPTaskMetadata |
options? | Readonly<AxMCPRequestOptions> |
Returns
Promise<AxMCPCreateTaskResult>
cancelRequest()
cancelRequest(id: string): void;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1235
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
cancelTask()
cancelTask(taskId: string): Promise<AxMCPTask>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L954
Parameters
| Parameter | Type |
|---|---|
taskId | string |
Returns
Promise<AxMCPTask>
close()
close(): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L468
Returns
Promise<void>
complete()
complete(
ref: AxMCPCompletionReference,
argument: AxMCPCompletionArgument,
context?: object): Promise<AxMCPCompletionResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1209
Parameters
| Parameter | Type |
|---|---|
ref | AxMCPCompletionReference |
argument | AxMCPCompletionArgument |
context? | { arguments?: Record<string, string>; } |
context.arguments? | Record<string, string> |
Returns
Promise<AxMCPCompletionResult>
getCapabilities()
getCapabilities(): object;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L799
Returns
object
| Name | Type |
|---|---|
prompts | boolean |
resources | boolean |
tools | boolean |
getCatalogRevision()
getCatalogRevision(): number;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L445
Returns
number
getEvaluationMode()
getEvaluationMode(): "record" | "live" | "replay" | "sandbox";Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L358
Returns
"record" | "live" | "replay" | "sandbox"
getKnownTasks()
getKnownTasks(): readonly AxMCPTask[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L964
Returns
readonly AxMCPTask[]
getNamespace()
getNamespace(): string;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L420
Returns
string
getNegotiatedExtensions()
getNegotiatedExtensions(): Readonly<Record<string, AxMCPExtensionCapability>>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L410
Returns
Readonly<Record<string, AxMCPExtensionCapability>>
getPrompt()
getPrompt(name: string, args?: Record<string, string>): Promise<AxMCPPromptGetResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1085
Parameters
| Parameter | Type |
|---|---|
name | string |
args? | Record<string, string> |
Returns
Promise<AxMCPPromptGetResult>
getPrompts()
getPrompts(): readonly AxMCPPrompt[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L433
Returns
readonly AxMCPPrompt[]
getProtocolVersion()
getProtocolVersion(): undefined | string;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L354
Returns
undefined | string
getResources()
getResources(): readonly AxMCPResource[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L437
Returns
readonly AxMCPResource[]
getResourceSubscriptions()
getResourceSubscriptions(): readonly string[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1192
Returns
readonly string[]
getResourceTemplates()
getResourceTemplates(): readonly AxMCPResourceTemplate[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L441
Returns
readonly AxMCPResourceTemplate[]
getServerCapabilities()
getServerCapabilities(): AxMCPServerCapabilities;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L406
Returns
getServerInfo()
getServerInfo():
| undefined
| AxMCPImplementationInfo;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L398
Returns
| undefined
| AxMCPImplementationInfo
getServerInstructions()
getServerInstructions(): undefined | string;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L402
Returns
undefined | string
getTask()
getTask(taskId: string): Promise<AxMCPTask>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L935
Parameters
| Parameter | Type |
|---|---|
taskId | string |
Returns
Promise<AxMCPTask>
getTaskResult()
getTaskResult<T>(taskId: string): Promise<T>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L945
Type Parameters
| Type Parameter | Default type |
|---|---|
T | AxMCPToolCallResult |
Parameters
| Parameter | Type |
|---|---|
taskId | string |
Returns
Promise<T>
getTools()
getTools(): readonly AxMCPTool[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L429
Returns
readonly AxMCPTool[]
hasCompletionsCapability()
hasCompletionsCapability(): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L825
Returns
boolean
hasExtension()
hasExtension(name: string): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L416
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
boolean
hasLoggingCapability()
hasLoggingCapability(): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L831
Returns
boolean
hasPromptsCapability()
hasPromptsCapability(): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L813
Returns
boolean
hasResourcesCapability()
hasResourcesCapability(): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L819
Returns
boolean
hasTasksCapability()
hasTasksCapability(): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L837
Returns
boolean
hasToolsCapability()
hasToolsCapability(): boolean;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L807
Returns
boolean
init()
init(): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L261
Returns
Promise<void>
inspectCatalog()
inspectCatalog(options: Readonly<{
refresh?: boolean;
}>): Promise<AxMCPCatalogSnapshot>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L449
Parameters
| Parameter | Type |
|---|---|
options | Readonly<{ refresh?: boolean; }> |
Returns
Promise<AxMCPCatalogSnapshot>
listPrompts()
listPrompts(cursor?: string): Promise<AxMCPPromptsListResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1071
Parameters
| Parameter | Type |
|---|---|
cursor? | string |
Returns
Promise<AxMCPPromptsListResult>
listResources()
listResources(cursor?: string): Promise<AxMCPResourcesListResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1101
Parameters
| Parameter | Type |
|---|---|
cursor? | string |
Returns
Promise<AxMCPResourcesListResult>
listResourceTemplates()
listResourceTemplates(cursor?: string): Promise<AxMCPResourceTemplatesListResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1115
Parameters
| Parameter | Type |
|---|---|
cursor? | string |
Returns
Promise<AxMCPResourceTemplatesListResult>
listTasks()
listTasks(cursor?: string): Promise<AxMCPTasksListResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L925
Parameters
| Parameter | Type |
|---|---|
cursor? | string |
Returns
Promise<AxMCPTasksListResult>
listTools()
listTools(cursor?: string): Promise<AxMCPToolsListResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L843
Parameters
| Parameter | Type |
|---|---|
cursor? | string |
Returns
Promise<AxMCPToolsListResult>
ping()
ping(timeout: number): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L770
Parameters
| Parameter | Type | Default value |
|---|---|---|
timeout | number | 3000 |
Returns
Promise<void>
readResource()
readResource(uri: string): Promise<AxMCPResourceReadResult>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1131
Parameters
| Parameter | Type |
|---|---|
uri | string |
Returns
Promise<AxMCPResourceReadResult>
refresh()
refresh(): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L321
Returns
Promise<void>
releaseResourceSubscription()
releaseResourceSubscription(uri: string, owner: string): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1176
Releases one logical owner without disturbing other subscribers.
Parameters
| Parameter | Type |
|---|---|
uri | string |
owner | string |
Returns
Promise<void>
setLoggingLevel()
setLoggingLevel(level: AxMCPLoggingLevel): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1226
Parameters
| Parameter | Type |
|---|---|
level | AxMCPLoggingLevel |
Returns
Promise<void>
startListening()
startListening(options: Readonly<AxMCPClientListeningOptions>): Promise<AxMCPListeningHandle>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L982
Parameters
| Parameter | Type |
|---|---|
options | Readonly<AxMCPClientListeningOptions> |
Returns
Promise<AxMCPListeningHandle>
subscribeEvents()
subscribeEvents(listener: (event: Readonly<AxMCPClientEvent>) => void | Promise<void>): () => void;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L975
Parameters
| Parameter | Type |
|---|---|
listener | (event: Readonly<AxMCPClientEvent>) => void | Promise<void> |
Returns
(): void;Returns
void
subscribeResource()
subscribeResource(uri: string): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1144
Parameters
| Parameter | Type |
|---|---|
uri | string |
Returns
Promise<void>
subscribeTaskStatus()
subscribeTaskStatus(listener: (task: Readonly<AxMCPTask>) => void | Promise<void>): () => void;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L968
Parameters
| Parameter | Type |
|---|---|
listener | (task: Readonly<AxMCPTask>) => void | Promise<void> |
Returns
(): void;Returns
void
toFunction()
toFunction(): AxFunction[];Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L791
Returns
unsubscribeResource()
unsubscribeResource(uri: string): Promise<void>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1151
Parameters
| Parameter | Type |
|---|---|
uri | string |
Returns
Promise<void>
waitForTask()
waitForTask<T>(taskId: string, options: Readonly<{
defaultPollIntervalMs?: number;
signal?: AbortSignal;
timeoutMs?: number;
}>): Promise<T>;Defined in: https://github.com/ax-llm/ax/blob/e4219a44b7581a55a40d9dd62d2c281062ff078d/src/ax/mcp/client.ts#L1031
Type Parameters
| Type Parameter | Default type |
|---|---|
T | AxMCPToolCallResult |
Parameters
| Parameter | Type |
|---|---|
taskId | string |
options | Readonly<{ defaultPollIntervalMs?: number; signal?: AbortSignal; timeoutMs?: number; }> |
Returns
Promise<T>