Skip to navigation

Agent manifest

An agent manifest stores the settings that npx @runtypelabs/connect relay uses to reach a local agent or Model Context Protocol (MCP) server. With a manifest in your repository, you can run relay without flags. If your local server isn’t running, relay can start it and stop it again on exit.

File location and discovery

By default, relay looks for .runtype/agents.yaml at your git repository root, then checks .runtype/agents.yml. Outside a git repository, relay looks for .runtype/agents.yaml and .runtype/agents.yml in the current directory. To load a manifest from another path, pass --manifest PATH relative to the current directory.

Only relay reads the manifest. You write the file yourself and commit it with your code.

Example manifest

The following example defines a local chat agent in .runtype/agents.yaml with auto-start and a readiness check:

.runtype/agents.yaml
agents:
support-agent:
agentId: AGENT_ID
cwd: apps/support
command: pnpm dev
forwardTo: http://127.0.0.1:3030/chat
protocol: chat
healthPath: /health
readyTimeoutMs: 30000

Replace AGENT_ID with the ID of your agent in Runtype.

From the repository root, start the relay with this manifest:

Start the relay
npx @runtypelabs/connect relay --connect

Manifest fields

The relay command rejects a manifest that contains an unknown key. Every field after agents.ENTRY_NAME goes inside an entry under agents:

KeyTypeRequiredDefaultRules
agentsObjectYesNoneMust contain at least one entry.
agents.ENTRY_NAMEObjectYesNoneA name of your choice that you select with --entry.
agentIdStringConditionalNoneRequired when protocol is a2a or chat, unless you pass --agent. Not used when protocol is mcp.
forwardToStringYesNoneLoopback URL that receives forwarded calls. For a2a and chat, must use 127.0.0.1, localhost, or ::1 with no query string or fragment. For mcp, must use literal 127.0.0.1 or [::1] only (not localhost). Follows the same rules as --forward-to.
protocolStringNoa2aMust be a2a, chat, or mcp.
cwdStringNoRepository rootWorking directory for command, relative to the repository root. Must stay inside the repository.
commandStringNoNoneShell command that starts the local server in cwd when the server isn’t reachable.
healthPathStringNoNoneReadiness path resolved against the origin of forwardTo. Must start with /, must not start with //, and must contain no whitespace.
readyTimeoutMsIntegerNo15000Wait time in milliseconds before startup times out. Must be an integer from 500 to 120000.

Entry selection and CLI flags

Run relay with manifest options:

relay manifest usage
npx @runtypelabs/connect relay [--entry ENTRY_NAME] [--manifest PATH] [FLAGS]

Replace the following:

  • ENTRY_NAME: the key name of an entry under agents.
  • PATH: the path to a manifest file, relative to the current directory.
  • FLAGS: any other relay flags, such as --connect or --no-start.

Manifest flags

Pass the following flags to relay to control how it loads and runs a manifest:

  • --manifest PATH: loads the manifest from PATH, relative to the current directory.
  • --entry ENTRY_NAME: selects one entry from agents by key name.
  • --no-start: skips running command even when the local server isn’t reachable.

How relay loads and selects an entry

The relay command reads the manifest when any of the following conditions applies:

  • You pass --manifest or --entry.
  • You omit --forward-to.
  • You omit --agent for a protocol other than mcp.

If the manifest defines one entry, relay selects it automatically. With more than one entry, you must pass --entry ENTRY_NAME. Without --entry, relay exits with code 2 and lists the available entries (Multiple agents are defined in the manifest (a, b); pass --entry <name> to select one). If you pass --entry when no manifest exists, relay exits with code 2 and prints No .runtype/agents.yaml manifest found for --entry.

Explicit --agent, --forward-to, and --protocol flags override the corresponding fields from the manifest.

Auto-start and shutdown

When an entry defines command and you don’t pass --no-start, relay checks and starts your local server in three steps:

  1. relay sends an HTTP GET request to check readiness. When healthPath is set, relay resolves it against the origin of forwardTo and counts only a 2xx response as ready. Otherwise, relay sends GET to forwardTo and counts any HTTP response as ready.
  2. If the local server is already reachable, relay leaves that process running and doesn’t stop it on exit.
  3. If the local server isn’t reachable, relay runs command in cwd through a shell. It repeats the readiness check until the server responds or readyTimeoutMs passes, and prints Started local target (COMMAND) in DIR. when it starts the command.

If you pass --no-start or omit command, relay starts no process and pairs with forwardTo directly.

Shutdown

When relay exits, it stops the process that it started, including that process’s child processes. It never stops a server that was already running.

Errors

The following table lists the manifest validation and auto-start errors that relay can return, with each error’s code and reason fields:

CodeReasonExit codeMeaning and fix
configmanifest_parse_error2relay couldn’t parse the manifest YAML (Could not parse PATH: ...). Fix the YAML syntax. The manifest doesn’t support YAML anchors, aliases, or tab indentation.
configmanifest_invalid2One or more manifest fields failed validation (Invalid manifest in PATH: field: message; ...). Fix the reported fields and remove any unknown keys.
configmanifest_not_found2relay found no file at the --manifest path, or you passed --entry and the repository has no .runtype/agents.yaml. Create .runtype/agents.yaml or pass a valid --manifest path.
configmanifest_unreadable2relay couldn’t read the manifest file. Check file permissions and verify that the path points to a readable file.
invalid_valuemanifest_entry_not_found2relay found no entry matching --entry (No agent named "NAME" in the manifest). Select a name shown in the Available agents hint.
usagemanifest_entry_ambiguous2The manifest defines multiple entries and --entry is missing (Multiple agents are defined in the manifest (a, b); pass --entry <name> to select one). Re-run with --entry.
configmanifest_cwd_outside_repo2cwd is an absolute path or points outside the repository. Set cwd to a relative path inside the repository.
configrelay_start_failed2relay couldn’t start command (Could not start "CMD": ...). Check command and cwd in .runtype/agents.yaml.
configrelay_start_exited2The start command exited before becoming ready (Local target command "CMD" exited before becoming ready (exit code N)). Inspect the captured output in the hint.
timeoutrelay_start_timeout4The local server didn’t become ready before readyTimeoutMs elapsed (Local target did not become ready at URL within Nms). Increase readyTimeoutMs in .runtype/agents.yaml or verify that the server starts cleanly.
interruptedNone130A signal such as Ctrl-C interrupted startup before the server became ready.

Next steps

Continue with one of the following pages: