Skip to main content
The deepagents CLI, installed from the deepagents-cli package, provides deployment tooling for Managed Deep Agents. Use it to scaffold local agent projects, deploy them to LangSmith, manage Managed Deep Agent resources, and register MCP servers.
Managed Deep Agents is in private beta, available on LangSmith Cloud in the US region only. Join the waitlist to request access.
For the fastest end-to-end path, see the quickstart. For workflow guides, see Connect tools, Deploy an agent, and Run an agent.

Requirements

Managed Deep Agents requires deepagents-cli>=0.2.2.
Install deepagents-cli with uv (preferred) or pip:
To upgrade an existing uv install, run uv tool upgrade deepagents-cli. The CLI reads LANGSMITH_API_KEY. To create a key, see Create an API key. To override the default endpoint, set LANGSMITH_ENDPOINT.
Project .env files can set API keys. Project .env files cannot set endpoint, proxy, or TLS environment variables for managed API requests. Set those overrides in your shell or in ~/.deepagents/.env.

Command overview

Bare deepagents invocations do not start an interactive REPL. Install and run Deep Agents Code for interactive coding sessions.

Initialize projects

Use deepagents init to create a project directory:
If you omit the project name, the CLI prompts for it:
The init command creates the following files in the project directory:

Deploy projects

Run deepagents deploy from a project directory:
The first deploy creates a Managed Deep Agent. Later deploys update the same agent. Deploy state is user-local and stored outside your project, so files committed to the repository do not change which agent you deploy to. By default, deploy uploads the project, polls the agent health endpoint, and prints the agent name, ID, short revision, agent URL, and a post-deploy MCP health check. Use --detach to skip polling and exit immediately after create or update. deepagents deploy --dry-run prints JSON with:

Target existing agents

For shared repositories or intentional updates to an existing Managed Deep Agent, declare the target in agent.json:
On first use, the CLI asks you to confirm before updating that remote agent. Use --yes to skip the prompt.

Validate the project before deploy

Deploy fails before sending a request when the project is malformed. Common validation rules include:
  • agent.json and AGENTS.md are required.
  • agent.json must contain a non-empty name.
  • backend.sandbox_config requires backend.type to be sandbox.
  • backend.sandbox_config.scope must be thread or agent.
  • backend.sandbox_config.policy_ids must be an array of strings.
  • backend.sandbox_config.idle_ttl_seconds and backend.sandbox_config.delete_after_stop_seconds must be integers.
  • Symlinks are not allowed in deploy project inputs.
  • tools.json must contain a tools array.
  • Each tool in tools.json must include name and mcp_server_url.
  • Skill files require YAML frontmatter with name and description.
  • Subagent directories require agent.json and AGENTS.md.
  • Legacy deepagents.toml and mcp.json files produce migration hints instead of being deployed.
Before deploying, the CLI also validates referenced MCP server URLs. If a server URL is not registered, deploy fails with a command hint to add it. If an OAuth server is registered but the caller cannot invoke it, deploy fails with a hint to run deepagents mcp-servers connect <id|name|url>.

Manage agents

List agents:
The command prints tab-separated rows with agent ID, agent name, and update time:
Inspect an agent:
Include managed files in the response:
Delete an agent:
The delete command asks for confirmation. Skip the prompt with --yes:

Manage MCP servers

For a practical setup guide, see Connect tools. Commands that take <server> accept an MCP server ID, exact name, or URL. Non-ID values are resolved against deepagents mcp-servers list; URL matching ignores case and trailing slashes. If a name or URL matches more than one server, re-run the command with the server ID.

Add MCP servers

Register a static-header server:
Register an OAuth MCP server:
OAuth add supports the same OAuth flags as connect: --scope, --force-new, --timeout, and --no-browser.

List MCP server tools

List a registered server’s tools:
The command prints each tool name and the first line of its description, then prints a paste-ready tools.json snippet. For OAuth servers, connect first so the MCP server record includes the caller’s oauth_provider_id.

Update MCP servers

Update a server URL or headers:
The command requires at least one change flag. Delete an MCP server:
The delete command asks for confirmation. Skip the prompt with --yes:

Connect OAuth MCP servers

Start or reuse OAuth authorization:
If authorization is pending, the CLI prints the verification URL. When --timeout 0 is set, the CLI starts authorization and exits. Re-run deepagents mcp-servers connect <id|name|url> later to complete or reuse the connection.

Project file reference

Managed Deep Agents projects use this layout:

agent.json

agent.json configures the Managed Deep Agent resource:

Configure the backend

Managed Deep Agents projects generated by deepagents-cli>=0.2.2 use the state backend. Use a LangSmith sandbox backend when the agent needs an isolated environment for code execution, filesystem work, or long-running tasks. Sandbox backends can include optional sandbox settings:
backend.sandbox_config is valid only when backend.type is sandbox. For standalone sandbox features such as snapshots, service URLs, permissions, CLI commands, and SDK usage, see the LangSmith sandboxes overview.

Configure permissions

The optional permissions field in agent.json sets identity, visibility, and tenant access. Supported values are:

AGENTS.md

AGENTS.md contains the main agent instructions. The CLI sends this content as the agent system prompt and stores it in the managed file tree.

tools.json

tools.json configures MCP-backed tools. deepagents init creates this file with an empty tools array. Add tool entries after registering an MCP server:
Each tool requires name and mcp_server_url. mcp_server_name and display_name are optional. interrupt_config is optional and must be an object when present. Key each interrupt entry by "{mcp_server_url}::{tool_name}". Additional ::{mcp_server_name} components are accepted for compatibility.

skills

Each skill lives under skills/<name>/SKILL.md and requires YAML frontmatter:
The CLI recursively includes all other files in the skill directory, excluding hidden paths.

subagents

Each subagent lives under subagents/<name>/ and requires: Example subagent agent.json:
The legacy model_id key is still accepted in local subagent files, but new projects should use model. The REST API SubagentSpec uses model_id. Subagent names come from directory names. Names are checked case insensitively for duplicates.