mcp-use TypeScript API
    Preparing search index...

    Class BaseCodeExecutorAbstract

    Abstract base class for code executors. Provides shared functionality for connecting to MCP servers and building tool contexts.

    Hierarchy (View Summary)

    Index
    • Clean up resources used by the executor. Should be called when the executor is no longer needed.

      Returns Promise<void>

    • Create a search function for discovering available MCP tools. Used by code execution environments to find tools at runtime.

      Returns SearchToolsFunction

    • Execute code with access to MCP tools.

      Parameters

      • code: string

        The code to execute

      • Optionaltimeout: number

        Execution timeout in milliseconds

      Returns Promise<ExecutionResult>