Documentation Index
Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
Use this file to discover all available pages before exploring further.
Remote agent implementation for executing agents via API.
RemoteAgent
from mcp_use.agents.remote import RemoteAgent
method init
Initialize remote agent.Parameters
The ID of the remote agent to execute
The ID of the chat session to use. If None, a new chat session will be created.
API key for authentication. If None, will check MCP_USE_API_KEY env var
base_url
str
default:"https://cloud.mcp-use.com"
Base URL for the remote API
Signaturedef __init__(agent_id: str, chat_id: str | None = None, api_key: str | None = None, base_url: str = "https://cloud.mcp-use.com"):
method close
Close the HTTP client.Signaturemethod run
Executes the agent and returns the final result.
This method uses HTTP streaming to avoid timeouts for long-running tasks.
It consumes the entire stream and returns only the final result.Parameters
external_history
list[langchain_core.messages.base.BaseMessage] | None
default:"None"
List of items
output_schema
type[~T] | None
default:"None"
Parameter value
Returns
returns
str | mcp_use.agents.remote.T
Signaturedef run(
query: str,
max_steps: int | None = None,
external_history: list[langchain_core.messages.base.BaseMessage] | None = None,
output_schema: type[~T] | None = None
):
method stream
Stream the execution of a query on the remote agent using HTTP streaming.Parameters
external_history
list[langchain_core.messages.base.BaseMessage] | None
default:"None"
List of items
output_schema
type[~T] | None
default:"None"
Parameter value
Returns
Signaturedef stream(
query: str,
max_steps: int | None = None,
external_history: list[langchain_core.messages.base.BaseMessage] | None = None,
output_schema: type[~T] | None = None
):