meshagent service with service manifests. Use Deploy a built in Agent when you want to deploy a process-backed agent from CLI flags instead.
In MeshAgent, you can deploy services project-wide or to specific rooms. A service can run a container, connect to an external service, or publish a toolkit. See Intro to Services for more on containers and external services.
The examples below show four common cases.
- a
Servicewith acontainer - a
ServiceTemplatewith acontainer - a
Servicewith anexternalruntime - a
Servicewith a Pythontoolkit
Example 1: Service with container
Use kind: Service when the configuration is fixed at deploy time.
kind: Service with a container. MeshAgent runs the meshagent/cli:default image, and the container starts meshagent process join ... inside it.
Validate and deploy it:
bash
--global instead of --room myroom to deploy the same manifest as a project service.
Example 2: ServiceTemplate with container
Use kind: ServiceTemplate when the manifest shape stays the same but some values should be supplied during deployment or install.
language variable and uses {{ language }} inside the container.command.
Validate and deploy it:
bash
--global instead of --room myroom to deploy the rendered service project-wide.
If you want to inspect the rendered YAML first, use meshagent service render-template --file meshagent.yaml --value language=Spanish.
Example 3: Service with external
Use external when MeshAgent should route to a service you already host elsewhere instead of running a container for you.
Service that routes to an MCP server hosted outside MeshAgent. MeshAgent does not run the MCP server. It uses the external.url and ports.endpoints config to register that server’s tools in the room.
Validate and deploy it:
bash
external inside a ServiceTemplate too.
For a longer walkthrough, see Connect to an External MCP Server.
Example 4. Service with a Python toolkit
The service’s metadata.name is the toolkit name. Each tool has its own name, input schema, and source. Tools with type: python run in the same Monty sandbox as managed-agent Python tools.
toolkit.connections, toolkit.environment, and toolkit.run_as.
Use room data in a Python tool
Monty provides ameshagent client in room toolkit functions. Use datasets.for_room(), files.for_room(), and sqlite.for_room() with the project ID and room name of the invocation. The clients use the REST endpoints with the caller’s permissions. A denied operation raises PermissionError.
pyarrow module supports Arrow tables, record batches, schemas, arrays, and scalars backed by Rust. Use async for to consume query and file streams incrementally. Keep Arrow results in Arrow when passing them between clients. Convert results to Python values before returning them from a tool.
Follow Test with the CLI for a runnable toolkit spec that exercises all three clients and shows how to inspect the service logs, traces, and metrics.
Each toolkit invocation produces a trace span. Outbound HTTP requests made by the script produce child spans with request timings. Metrics record invocation counts, execution latency, and outbound HTTP latency. Output from print() and calls such as logging.getLogger("room-helpers").info("Looking up a record") is sent to OpenTelemetry with the invocation’s trace and span IDs.
View service telemetry
Open a service’s options menu in Studio and select View Telemetry to inspect recent logs, traces, and metrics. The CLI commands use the deployment ID frommeshagent service list.
--room for a project-wide service. Use --attrs to show telemetry attributes or --output json to get the original records. Recorded telemetry is available even when the room is stopped.
The REST API serves logs, traces, and metrics from GET /accounts/projects/{project_id}/services/{service_id}/telemetry/{signal}. For a room deployment, use GET /accounts/projects/{project_id}/rooms/{room_name}/services/{service_id}/telemetry/{signal}.
Container services receive their deployment ID as the OpenTelemetry resource attribute meshagent.service.id. Telemetry an instrumented container sends to MeshAgent appears alongside service lifecycle spans. Use meshagent room container log --room ROOM --id CONTAINER_ID to read raw stdout and stderr from a container.
Manage deployed services
Usemeshagent service after deployment to inspect and manage what you deployed.
bash
--room myroom when you are updating, listing, or deleting a project service instead.
Service configuration field reference
Top-level fields
* Either
container or external is required, but not both.
metadata
Identifies the service and provides information displayed in the UI.agents
Declares the participant identities this service provides. MeshAgent uses this to route requests, apply policies, and display agents in the UI.agents.channels
Usechannels when one deployed agent should participate in more than one entry point.
Queue channel entries support:
Messaging channel entries support:
agents.email
Useemail when the agent identity itself should have mailbox settings attached to it.
agents.heartbeat
Useheartbeat when the agent should enqueue a recurring turn for itself without creating a separate scheduled-task resource by hand.
Heartbeat
prompt items use the same typed content model as agent turns:
Example:
files
Top-levelfiles seed room storage before the service starts. MeshAgent creates each file only if it does not already exist, which makes this useful for editable starter content such as prompts, rules, or templates.
Use top-level
files when the content should live in room storage and remain editable after deploy. Use container.storage.files when the file should be mounted inside the running container itself.
container
Defines a container for MeshAgent to run. Fields marked † are only available inService, not ServiceTemplate.
container.template
container.template controls the MeshAgent runtime defaults added when the container starts:
"agent"(default): mount room storage at/data, create a participant token for the container name with roleagentand default agent API permissions, and inject MeshAgent/OpenAI/Anthropic runtime environment variables."none": do not add those defaults. Only values explicitly configured in the manifest or container start request are passed through.
"agent" template sets defaults only when the environment variable is not already configured. Values in container.environment override template defaults.
The "agent" template may set:
container.run_as
container.run_as selects the service account identity used by the container.
The default scope list grants access to the HTTP/MCP secret proxy without
granting broad project administration.
container.environment
Each entry sets an environment variable in the container. A variable can come from a literalvalue, a MeshAgent token, or a service-account secret.
Use:
valuefor plain configurationtokenfor MeshAgent API accesssecretfor service-account credentials.container.run_asis required when any environment variable usessecret.
token fields:
secret fields:
This pattern is common for services:
token gives the service access to MeshAgent, while secret gives it an external credential through its service account.
container.storage
Mounts storage volumes into the container.
Room and project mount fields:
Image mount fields:
File mount fields:
Empty directory mount fields:
Config mount fields:
Config mounts are useful when a shell tool or helper process inside the container needs access to runtime files such as
spec.json and members.json.
external
Routes traffic to a service running outside MeshAgent. Requiresports to define how MeshAgent reaches the service.
ports
Defines network ports the service listens on and how MeshAgent routes HTTP traffic to them.
For HTTP ports, set
liveness to the path MeshAgent should poll to decide whether the service port is ready. For example, liveness: /healthz tells MeshAgent to request that path on the running service. A 2xx response reports the port as ready; failed checks report not ready; ports without a liveness path report no liveness in meshagent room service list.
ports.endpoints
Each endpoint maps a URL path to either a MeshAgent-native service or an MCP server.meshagent endpoint
Connects the endpoint to a MeshAgent participant identity.mcp endpoint
Registers an MCP server as a toolkit in the room.allowed_tools entries:
oauth fields:
variables (ServiceTemplate only)
Defines user-provided inputs for aServiceTemplate. Values are substituted into the YAML using {{ variable_name }} syntax.
Template values are rendered into the manifest before validation, so they can be used anywhere the resulting YAML remains valid.
Annotations
Annotations are key-value strings attached to services, agents, or variables. MeshAgent and Powerboards use specific annotation keys to control behavior. You can also define custom annotations.Service annotations
Set inmetadata.annotations.
Agent annotations
Set inagents[].annotations.
Variable annotations
Set invariables[].annotations.
Event annotations
Set inagents[].annotations. Subscribe an agent to room events. The value is the name of a queue that a queue-consuming agent can process.
Read next
- Build and Deploy Images: build and deploy images with
meshagent buildandmeshagent deploy - Secrets and Credentials: manage user-owned and service-account-owned secrets
- Observability: inspect logs, traces, metrics, and custom OpenTelemetry output
- Webhook Handoffs: handle
room.callwebhook handoffs in your own services