@ainulabs/ainu - v0.0.5
    Preparing search index...

    Class MCP

    MCP creates an interface between Agent and the Model Context Protocol (MCP) SDK.

    Index

    Constructors

    Properties

    client: Client

    The MCP client instance

    connected: boolean = false

    Whether the client is connected

    promptMap: Record<string, string> = {}

    The prompts available to the client

    resourceMap: Record<string, Tool> = {}

    The resources available to the client

    toolMap: Record<string, Tool> = {}

    The tools available to the client

    Methods

    • Attach the MCP Client instance to the transport. Does nothing if the client is already connected.

      Returns Promise<void>

    • Disconnects the MCP client.

      Returns Promise<void>

    • Fetches the tools from the MCP client and converts them to Tool instances.

      Returns Promise<Result<Record<string, Tool>>>