Skip to main content
A workspace’s resources are not fixed at creation time. MCP servers and skills can be added or removed while the workspace is running, and every change is persisted so it survives restarts. The lifecycle methods round out the picture, taking a workspace from provisioned to released.

Manage MCP Servers

MCP declarations are isolated by agent_id + session_id. Even when several sessions share one workspace, the connections, cookies and login state of a stateful MCP never leak into another session. The client is only connected the first time that session calls list_mcps:
Persistence follows the workspace’s own model: an ephemeral DockerWorkspace without a host workdir keeps the MCP list in memory only, and it is lost when the container goes away.

Manage Skills

Skills are isolated by agent_id. skill_paths first populates the skills/.seed template; the workspace creates a private partition for an agent the first time it accesses skills. add_skill, remove_skill and list_skills only operate on the given agent’s partition:

Manage the Lifecycle

Three methods take a workspace through its life, and the async with protocol wraps initialize / close for scoped use:
reset() deletes the MCP declarations, skill partitions and session state of every session. Afterwards, a session inherits default_mcps again the next time it accesses MCPs, but skill_paths is not re-seeded.

Allocate Workspaces in a Service

In a multi-tenant service, deciding which request gets which workspace (per user, per agent, or per session), caching live instances, and evicting idle ones is the job of the workspace manager, a separate service-side component. See its dedicated chapter:

Workspace Manager

Allocation, isolation policies, TTL eviction, and integration with the Agent Service.