Server lifecycle orchestration for the app.
Provides start_server_and_get_agent which handles the full flow of:
ServerConfig from application 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.
Lazy, per-server cache of persistent MCP sessions.
Discovery always happens through throwaway sessions. Live sessions are only created on the first real tool call inside the runtime event loop so sessions stay bound to the loop that owns their subprocess/transport handles, and so stdio servers are not restarted on every invocation.
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 streamed message-object conversion for
the Textual adapter and thread-ID normalization. State snapshots are
returned as provided by the server.
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 app to the server subprocess.
Serialized to/from DEEPAGENTS_CODE_SERVER_* environment variables so
that the server graph (which runs in a separate Python interpreter)
can reconstruct the app's intent without sharing memory.
Explicit user/project path context for project-sensitive behavior.