> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Develop locally with LangSmith Studio

> Run and test a Managed Deep Agent locally with mda dev and LangSmith Studio.

`mda dev` compiles a Managed Deep Agents project and runs it on a local Agent Server. It opens [LangSmith Studio](https://docs.langchain.com/langsmith/studio.md) so you can interact with the agent and inspect its behavior before deploying.

> [!NOTE]
>
> Managed Deep Agents is in **public [beta](https://docs.langchain.com/langsmith/release-stages.md)** on [LangSmith Cloud](https://docs.langchain.com/langsmith/cloud.md) and [Bring Your Own Cloud (BYOC)](https://docs.langchain.com/langsmith/byoc.md). Use Managed Deep Agents CLI and SDK v0.10 or later for BYOC.

## Start local Studio

Install the project dependencies and add the model provider credentials to `.env`.

From the project root, run:

```bash npm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
npx mda dev
```

```bash pnpm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
pnpm exec mda dev
```

```bash bun theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
bunx mda dev
```

The CLI prints the local server and Studio URLs and opens Studio in your browser. Send messages in Studio to inspect model responses, tool calls, state, and interrupts.

After changing project files, stop and rerun `mda dev` to recompile the project.

## What `mda dev` does

`mda dev`:

1. Validates the project and compiles it into `.mda/build`.
2. Copies the project `.env` into the local build and adds local-only identity configuration when needed.
3. Creates a local [Context Hub](https://docs.langchain.com/langsmith/javascript/managed-deep-agents-context-hub.md) mock for instructions, skills, and memory.
4. Starts the language-specific LangGraph development server.
5. Opens the agent in Studio.

Local development does not create or update a hosted deployment.

## Trace local runs

`mda dev` sends traces to the agent's **Local** environment. The project name is `{name}-local`, taken from the `name` you pass to `define_deep_agent` or `defineDeepAgent`.

In an [agent-based workspace](https://docs.langchain.com/langsmith/agent-registry.md), LangSmith rejects those traces until the agent record exists. [`mda deploy`](https://docs.langchain.com/langsmith/javascript/managed-deep-agents-deploy) creates that record. `mda dev` alone does not.

Before you rely on local traces, [create the agent](https://docs.langchain.com/langsmith/create-an-agent.md) once with that same identifier in the UI or API, or run `mda deploy` once. Studio chat still works while traces are rejected.

## Configure the local server

| Flag | Use |
| - | - |
| `--port PORT` | Set the local server port. |
| `--hostname HOSTNAME` | Set the hostname on which the server listens. |
| `--no-browser` | Start the server without opening Studio automatically. |
| `--no-reload` | Disable the LangGraph development server's hot reload. |

For all command details, see the [`mda dev` CLI reference](https://docs.langchain.com/langsmith/javascript/managed-deep-agents-cli#develop-locally).

## Understand local behavior

`mda dev` uses local defaults to make testing easier:

* If the agent uses identity, Studio provides a local test user automatically.
* If the configured sandbox is unavailable, the agent uses a temporary local folder instead. The CLI prints the folder path.
* [Schedules](https://docs.langchain.com/langsmith/javascript/managed-deep-agents-schedules.md) do not run. `mda dev` lists each schedule at startup but does not provision it, so no scheduled run fires locally.

These defaults differ from a deployed agent. Test identity and sandbox behavior in a development deployment before using the agent in production.

***

[Connect these docs](https://docs.langchain.com/use-these-docs.md) to your agent of choice via MCP for real-time answers.

[Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/managed-deep-agents-local-development.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
