Skip to main content
The mda CLI compiles and deploys code-first Managed Deep Agents. It is included with the managed-deepagents Python package.
Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.
For the fastest end-to-end path, see the quickstart. For workflow guidance, see Identity, Memory, Evals, Custom tools, Custom middleware, Sandboxes, Channels, Schedules, and Deploy an agent.

Install

Install the package for the language you use to author your agent. The package exposes the mda binary.
uv
uv tool install --prerelease allow managed-deepagents installs the mda CLI. A project generated by mda init has its own pyproject.toml; run uv sync inside that project to install project dependencies before local development or deploy. The package provides agent, identity, schedule, and sandbox authoring APIs with snake-case names, plus the mda console script.

Authentication

mda deploy reads API keys in this order:
  1. LANGGRAPH_HOST_API_KEY
  2. LANGSMITH_API_KEY
  3. LANGCHAIN_API_KEY
The CLI reads those values from the project .env file first, then from the process environment. If no key is found in an interactive terminal, mda deploy prompts for a LangSmith API key and saves it to the project .env file.
.env
To deploy with an organization-scoped key, set LANGSMITH_WORKSPACE_ID or pass --workspace-id to mda deploy. The LangSmith API key authenticates the deploy. The agent’s model provider also needs credentials at runtime. Set the provider key in .env, export it in your shell, or configure it as a LangSmith workspace secret. For example, openai:gpt-5.5 requires OPENAI_API_KEY. mda deploy forwards non-reserved .env entries, such as OPENAI_API_KEY, MCP tokens, and custom tool credentials, as hosted deployment secrets. Reserved platform variables, including LANGSMITH_API_KEY, LANGGRAPH_HOST_API_KEY, LANGCHAIN_API_KEY, and LANGSMITH_WORKSPACE_ID, are used for CLI authentication and deploy routing but are not uploaded as user-managed deployment secrets.

Command overview

Initialize projects

Use mda init to create a new project directory:
The command detects the language from the current directory: The scaffold creates: Eval tasks are opt-in and are not created by mda init. Managed Deep Agents evals are Harbor tasks under evals/tasks/. Run mda evals init <name> only when you want an optional starter task under evals/scaffold/.

Build projects

Use mda build to compile a project into a managed LangGraph app without deploying it:

Evaluate projects

evals/tasks/ is the canonical Harbor dataset. Author complete Harbor tasks there directly. The mda eval command, also available as mda evals, can scaffold a starter task and package the managed agent for Harbor. MDA prints a harbor run command but does not run trials.
Task names passed to mda evals init can contain ASCII letters, numbers, _, and -. mda evals compile flags: For Harbor task authoring, optional scaffolding, credentials, and running trials, see Evals.

Develop locally

Use mda dev to compile a project and run the local LangGraph dev server:
mda dev compiles into .mda/build, then starts the language-specific LangGraph dev server from that directory: Install uv before running mda dev. The CLI resolves the local LangGraph dev server automatically, so you do not need to install langgraph-cli[inmem] yourself. When a sandbox is configured, mda dev tries the configured provider. If provider credentials are unavailable or provider creation fails, it falls back to a local temp-directory sandbox and prints the chosen path. For local development, mda dev stages the project .env file into .mda/build/.env so LangGraph can load model provider keys and other runtime credentials.

Deploy projects

Use mda deploy to compile and deploy a project to LangSmith:
Deploy runs these steps:
  1. Validate the project directory and load the agent entry file.
  2. Resolve the LangSmith API key and optional workspace ID.
  3. Collect non-reserved .env values as hosted deployment secrets.
  4. Verify the model provider API key is available from .env, the shell environment, or LangSmith workspace secrets.
  5. Sync deploy-owned context to Context Hub.
  6. Compile the project into .mda/build and extract optional schedules/ declarations.
  7. Create or find a LangSmith hosted deployment by name.
  8. Archive the build, upload it, and trigger a remote build.
  9. Poll the revision until it reaches DEPLOYED unless --no-wait is set.
  10. Reconcile the managed LangSmith cron jobs for schedules unless --no-wait is set.
With --configure-slack, deploy requires exactly one Slack channel and a project-root slack-app-manifest.json. When the Slack credentials are missing, it writes .mda/slack/bootstrap-manifest.json and exits before changing remote state. After you create the app and add its credentials, rerun the waited deployment to write .mda/slack/app-manifest.json with the deployed Events URL. For the complete workflow, see Slack channels. On success, the CLI prints the LangSmith deployment dashboard URL. For secrets routing and deploy tips, see Deploy an agent.

Read deployment logs

Use mda logs to tail Agent Server logs for a deployed agent:

Delete deployments

Use mda delete to delete a deployed Managed Deep Agent and the LangSmith resources it created. mda destroy is an alias.

Troubleshooting