You can use a shared context from a same single repository to deploy multiple resources, mixing agents, MCP servers, batch jobs, etc.

Deploying multiple resources

With the --directory (-d) parameter in bl deploy, you can specify a subfolder containing your blaxel.toml and Dockerfile.

The Dockerfile defines how your deployment context is built and as such is required if you want to ensure proper mounting of shared dependencies between your different services.

This enables such mono-repo structure with shared libraries:

myrepo
|- myagent
    |- src
    |- blaxel.toml
    |- Dockerfile
|- myotheragent
    |- src
    |- blaxel.toml
    |- Dockerfile
|- mymcpserver
    |- src
    |- blaxel.toml
    |- Dockerfile
|- shared
    |- sharedfile

No changes are required to your blaxel.toml. However, in your Dockerfile, paths must be relative to the root context. For example, replace COPY src src withCOPY myagent/src src

This allows you to reference shared resources:

COPY myagent/src src
COPY shared shared

Deploy

To deploy, run these commands from the root folder:

bl deploy -d myagent
bl deploy -d myotheragent
bl deploy -d mymcpserver

For a complete example, see our sample repository.