mcp-use TypeScript API
    Preparing search index...

    Class RemoteAgent

    Executes a hosted MCP agent through the mcp-use remote API.

    Index
    • Releases local remote-agent state.

      Returns Promise<void>

    • Runs the remote agent and returns its final text.

      Parameters

      • options: RunOptions

        Input and per-run execution settings.

      Returns Promise<string>

      Final agent text.

    • Runs the remote agent and parses its result with options.schema.

      Type Parameters

      • T

      Parameters

      • options: RunOptions<T>

        Input, schema, and per-run execution settings.

      Returns Promise<T>

      The schema-validated result.

    • Runs the remote agent and returns a promise for the final result.

      Type Parameters

      • T = string

      Parameters

      • query: string
      • OptionalmaxSteps: number
      • OptionalmanageConnector: boolean
      • OptionalexternalHistory: BaseMessage[]
      • OptionaloutputSchema: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

      Returns Promise<T>

      Use the options object instead: run({ prompt, maxSteps, ... }).

    • Runs the remote agent through an async-generator interface.

      The current remote API does not emit intermediate values. Read the generator's return value for the final result.

      Parameters

      • options: RunOptions

        Input and per-run execution settings.

      Returns AsyncGenerator<any, string, void>

      An async generator whose return value is the final text.

    • Runs structured remote execution through an async-generator interface.

      Type Parameters

      • T

      Parameters

      • options: RunOptions<T>

        Input, schema, and per-run execution settings.

      Returns AsyncGenerator<any, T, void>

      An async generator whose return value is schema validated.

    • Streams the remote agent execution.

      Type Parameters

      • T = string

      Parameters

      • query: string
      • OptionalmaxSteps: number
      • OptionalmanageConnector: boolean
      • OptionalexternalHistory: BaseMessage[]
      • OptionaloutputSchema: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

      Returns AsyncGenerator<any, T, void>

      Use the options object instead: stream({ prompt, maxSteps, ... }).