Documentation

Build LLM-powered agents
with production-ready TypeScript

DSPy for TypeScript. Working with LLMs is complex—they don't always do what you want. DSPy makes it easier to build amazing things with LLMs. Just define your inputs and outputs (signature) and an efficient prompt is auto-generated and used. Connect together various signatures to build complex systems and workflows using LLMs.

15+ LLM Providers
End-to-end Streaming
Auto Prompt Tuning

AxMCPClient

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L76

Constructors

Constructor

new AxMCPClient(transport: AxMCPTransport, options: Readonly<AxMCPClientOptions>): AxMCPClient;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L89

Parameters

ParameterType
transportAxMCPTransport
optionsReadonly<AxMCPClientOptions>

Returns

AxMCPClient

Methods

cancelRequest()

cancelRequest(id: string): void;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L506

Parameters

ParameterType
idstring

Returns

void


getCapabilities()

getCapabilities(): object;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L397

Returns

object

NameType
promptsboolean
resourcesboolean
toolsboolean

getPrompt()

getPrompt(name: string, args?: Record<string, string>): Promise<AxMCPPromptGetResult>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L431

Parameters

ParameterType
namestring
args?Record<string, string>

Returns

Promise<AxMCPPromptGetResult>


hasPromptsCapability()

hasPromptsCapability(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L409

Returns

boolean


hasResourcesCapability()

hasResourcesCapability(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L413

Returns

boolean


hasToolsCapability()

hasToolsCapability(): boolean;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L405

Returns

boolean


init()

init(): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L104

Returns

Promise<void>


listPrompts()

listPrompts(cursor?: string): Promise<AxMCPPromptsListResult>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L417

Parameters

ParameterType
cursor?string

Returns

Promise<AxMCPPromptsListResult>


listResources()

listResources(cursor?: string): Promise<AxMCPResourcesListResult>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L447

Parameters

ParameterType
cursor?string

Returns

Promise<AxMCPResourcesListResult>


listResourceTemplates()

listResourceTemplates(cursor?: string): Promise<AxMCPResourceTemplatesListResult>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L461

Parameters

ParameterType
cursor?string

Returns

Promise<AxMCPResourceTemplatesListResult>


ping()

ping(timeout: number): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L368

Parameters

ParameterTypeDefault value
timeoutnumber3000

Returns

Promise<void>


readResource()

readResource(uri: string): Promise<AxMCPResourceReadResult>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L477

Parameters

ParameterType
uristring

Returns

Promise<AxMCPResourceReadResult>


subscribeResource()

subscribeResource(uri: string): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L490

Parameters

ParameterType
uristring

Returns

Promise<void>


toFunction()

toFunction(): AxFunction[];

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L389

Returns

AxFunction[]


unsubscribeResource()

unsubscribeResource(uri: string): Promise<void>;

Defined in: https://github.com/ax-llm/ax/blob/05ff5bd88d050f7ba85a3fcc6eb0ed2975ad7d51/src/ax/mcp/client.ts#L498

Parameters

ParameterType
uristring

Returns

Promise<void>