Server lifecycle orchestration for the CLI.
Provides start_server_and_get_agent which handles the full flow of:
ServerConfig from CLI argumentsServerConfig.to_env()langgraph dev serverRemoteAgent clientAlso provides server_session, an async context manager that wraps
server startup and guaranteed cleanup so callers don't need to
duplicate try/finally teardown.
Start a LangGraph server and return a connected remote agent client.
Async context manager that starts a server and guarantees cleanup.
Wraps start_server_and_get_agent so callers don't need to duplicate the
try/finally pattern for stopping the server.
Manages persistent MCP sessions for stateful stdio servers.
This manager creates and maintains persistent sessions for stdio MCP servers, preventing server restarts on every tool call. Sessions are kept alive until explicitly cleaned up.
Client that talks to a LangGraph server over HTTP+SSE.
Wraps langgraph.pregel.remote.RemoteGraph which handles SSE parsing,
stream-mode negotiation (messages-tuple), namespace extraction, and
interrupt detection. This class adds only message-object conversion for the
Textual adapter and thread-ID normalization.
Manages a langgraph dev server subprocess.
Focuses on subprocess lifecycle (start, stop, restart) and health checking.
Env-var management for restarts (e.g. configuration changes requiring a full
restart) is handled by _scoped_env_overrides, keeping this class focused
on process management.
Full configuration payload passed from the CLI to the server subprocess.
Serialized to/from DA_SERVER_* environment variables so that the server
graph (which runs in a separate Python interpreter) can reconstruct the
CLI's intent without sharing memory.
Explicit user/project path context for project-sensitive behavior.