mcp-use TypeScript API
    Preparing search index...

    Class BaseAdapter<T>Abstract

    Abstract base class for converting MCP tools to other framework formats.

    This class defines the common interface that all adapter implementations should follow to ensure consistency across different frameworks.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index
    • Type Parameters

      • T

      Parameters

      • OptionaldisallowedTools: string[]

        MCP tool names to omit during conversion.

      Returns BaseAdapter<T>

    • Create prompts from MCP prompts in all provided connectors.

      Parameters

      • connectors: BaseConnector[]

        List of MCP connectors to create prompts from.

      Returns Promise<T[]>

      A promise that resolves with all converted prompts.

    • Create resources from MCP resources in all provided connectors.

      Parameters

      • connectors: BaseConnector[]

        List of MCP connectors to create resources from.

      Returns Promise<T[]>

      A promise that resolves with all converted resources.

    • Create tools from MCP tools in all provided connectors.

      Parameters

      • connectors: BaseConnector[]

        List of MCP connectors to create tools from.

      Returns Promise<T[]>

      A promise that resolves with all converted tools.

    • Dynamically load prompts for a specific connector.

      Parameters

      Returns Promise<T[]>

      The list of prompts that were loaded in the target framework's format.

    • Dynamically load resources for a specific connector.

      Parameters

      Returns Promise<T[]>

      The list of resources that were loaded in the target framework's format.

    • Dynamically load tools for a specific connector.

      Parameters

      Returns Promise<T[]>

      The list of tools that were loaded in the target framework's format.

    • Create tools from an MCPClient instance.

      This is the recommended way to create tools from an MCPClient, as it handles session creation and connector extraction automatically.

      Type Parameters

      Parameters

      • this: new (disallowedTools?: string[]) => TAdapter
      • client: MCPClient

        The MCPClient to extract tools from.

      • OptionaldisallowedTools: string[]

        Optional list of tool names to exclude.

      Returns Promise<TTool[]>

      A promise that resolves with a list of converted tools.