MCP exposure
An MCP exposure makes selected parts of a running Peppy stack available to Model Context Protocol clients. A client can read camera pictures, look through a camera, call services, and run long-running actions through one HTTP endpoint. The client does not need a Peppy session, access to the messaging layer, or knowledge that the system uses Peppy.
An exposure is an allowlist. In one document, you choose the contract members to publish and give each one a stable public name, a description, and operational policies. A launcher names the exposures to serve, and the daemon runs the MCP server that is built into the peppy binary for them: one process, one loopback port, one endpoint per exposure. Nothing is generated or built. Anything you do not name is not reachable through the endpoint. This remains true even if a client guesses a name or knows the internal one. A client sees only the selected members, even when the underlying stack contains more.
You do not write the public request and response schemas by hand. Peppy derives them from the referenced contracts and daemon interfaces, at check time and again when the server starts, so the published schemas cannot drift from the definitions behind them.
What an exposure publishes
Section titled “What an exposure publishes”An exposure draws from contracts, which node instances implement, and from the daemon interfaces that peppy serves. Each Peppy communication type has an MCP equivalent:
| Contract member | Published as | What a client can do |
|---|---|---|
| Topic | Resource | Read the latest policy-approved snapshot and subscribe to updates |
Topic with a picture | Picture tool, beside the resource | Call it and get the latest picture as an image, with the rest of the message |
| Service | Tool | Call it and get the answer in the same request; under a representation, the answer’s picture as an image |
| Action | Action-backed tool | Run the goal inside the call, or as an MCP task: get a task handle, watch progress, confirm, cancel, and reconnect |
An exposure that declares a call_record also publishes one tool of its own: the last calls of every tool that is not read-only, with the client that made each and how it ended.
The server supports MCP revision 2026-07-28 over Streamable HTTP. It includes the tasks extension (SEP-2663), which a client opts into per request; an action-backed tool runs as a task for a client that declares it and inside the call for one that does not.
The exposure document
Section titled “The exposure document”An exposure is a standalone JSON5 document with peppy_schema: "mcp_exposure/v1". Its filename does not matter. The name:tag in its manifest identifies it, peppy repo index discovers it by its content, and a launcher lists it by that name:tag. The manifest may also carry labels, a list of free-form strings for whoever browses the repository.
Here is a complete example with two targets. The camera provides an image resource, the picture tool that shows its picture, and two tools. The recorder provides a record_episode tool that creates a task and requires confirmation.
// The public MCP surface of one robot: a live camera to look through and an// episode recorder to drive. Everything an MCP client can ever see is named// in this file; anything the running stack also carries stays private.//// This document is the whole artifact. A launcher lists it under// `source: { exposures: [...] }` and the daemon serves it from the server// built into peppy; `peppy repo index --check --validate-mcp-exposures`// checks it against the contracts it references, and `peppy mcp catalog`// prints what an endpoint for it advertises.{ peppy_schema: "mcp_exposure/v1", manifest: { name: "camera_and_recording", tag: "v1" },
// Advertised to clients through `server/discover`. `instructions` is the // prose a model reads before it decides what to call. server: { title: "OpenArm camera and recording", instructions: "Observe the front camera and record teleoperation episodes.", },
targets: { // A LOGICAL target, not an instance. `front_camera` becomes the `link_id` // of a `depends_on.contracts` slot of the server's node, so the launcher // decides which running instance fills it. The same exposure serves a // simulated camera and a real one. front_camera: { contract: { name: "rgb_camera", tag: "v1", // An optional author pin: the sha256 of the exact contract document // this file was written against (`sha256sum contracts/rgb_camera.json5`). // With it, a launch that resolves other bytes for `rgb_camera:v1` // refuses instead of publishing schemas this file never saw. sha256: "44527ab0542ac56389806315f21c6977c535a1874527926fcc480dd57fb736ab", },
// A topic becomes a resource: the latest policy-approved snapshot, // which clients read and subscribe to. Under a representation a read // serves the message without its picture, and the picture as a blob. topics: [ { member: "video_stream", resource: "front_camera.latest_frame", description: "Latest picture from the front-facing camera, JPEG encoded.", // A snapshot older than this reads as stale rather than serving // yesterday's picture as if it were current. freshness: { max_age_ms: 2000 }, // Pictures arriving faster than this are dropped before any decoding // or transcoding runs. A 30 Hz camera does not become 30 Hz of // JPEG encoding for a client that reads twice a minute. update: { max_hz: 2 }, // Interpret the message as an image and publish it as JPEG. The // roles name members of THIS topic's message format. representation: { image: "jpeg", quality: 80, fields: { data: "data", encoding: "encoding", width: "width", height: "height", }, }, // The picture is a variable-length byte array, so its serialized size // has no static maximum and the runtime size policy is mandatory. max_result_bytes: 524288, on_oversize: "downscale", // The same picture through a tool: a model that calls it gets the // picture as an image, beside the rest of the message. It reads // the snapshot the resource serves and takes no argument. picture: { tool: "front_camera.look", description: "Look through the front-facing camera: its latest picture.", }, }, ],
// A service becomes a tool that answers within one request. services: [ { member: "video_stream_info", tool: "front_camera.info", description: "Report the camera's resolution, frame rate, and encoding.", operation: "read_only", deadline_ms: 2000, }, { member: "set_brightness", tool: "front_camera.set_brightness", description: "Set the camera brightness in device units.", operation: "mutating", deadline_ms: 2000, // Narrows what the published input schema accepts. The contract's // `i8` would allow -128..127; this exposure allows -64..64, and the // refusal happens at the endpoint, before the Peppy graph is // touched. restrict: { value: { min: -64, max: 64 } }, }, ], },
recorder: { // No pin: the exposure follows `episode_recording:v1` as its repository // evolves, and each launch validates it against the bytes it resolves. contract: { name: "episode_recording", tag: "v1" },
// An action becomes a tool. For a client that declares the MCP tasks // extension the call returns a task handle, feedback drives the // status message, and `tasks/cancel` forwards to the action's cancel // path; for any other client the goal runs inside the call. actions: [ { member: "record_episode", tool: "recorder.record_episode", description: "Record one teleoperation episode to the local dataset.", operation: "long_running", // Advertised to the client: this one moves the robot. safety_sensitive: true, // The task parks in `input_required` until the client confirms // through `tasks/update`. No goal is sent before that, and only // a client with the tasks extension can call the tool. confirmation_required: true, deadline_ms: 900000, }, ], // `finish_session` is live on the recorder and deliberately absent // here. A member that is not selected is not reachable through the // endpoint at all. }, },}It selects from these two contracts:
{ peppy_schema: "contract/v1", manifest: { name: "rgb_camera", tag: "v1", description: ["A color camera: its pictures, the settings of its stream and its brightness."], }, interfaces: { topics: [ { name: "video_stream", description: "Each picture of the camera, with its size and its encoding.", qos_profile: "sensor_data", message_format: { data: { $type: "array", $items: "u8", $description: "The pixels of the picture, in its encoding." }, encoding: "string", width: "u32", height: "u32", }, }, ], services: [ { name: "video_stream_info", description: "The size, the frame rate and the encoding of the stream.", response_message_format: { width: "u32", height: "u32", frames_per_second: "u8", encoding: "string", }, }, { name: "set_brightness", description: "Set the brightness of the camera, and give the brightness that it applied.", request_message_format: { value: "i8" }, response_message_format: { applied: "i8" }, }, ], },}{ peppy_schema: "contract/v1", manifest: { name: "episode_recording", tag: "v1", description: ["A recorder of episodes: it records one episode for each goal, and counts the episodes of its session."], }, interfaces: { actions: [ { name: "record_episode", description: "Record an episode. The goal gives the name of the episode, each feedback gives the last frame that the recorder wrote, and the result gives the number of frames of the episode.", goal_service: { request_message_format: { episode_name: "string" } }, feedback_topic: { message_format: { frame: "u32" } }, result_service: { response_message_format: { frames: "u32" } }, }, ], services: [ { name: "finish_session", description: "End the session, and give the number of episodes that it recorded.", response_message_format: { episodes_recorded: "u32" }, }, ], },}finish_session is live on the running recorder and absent from the exposure. It stays private.
Targets are logical, not instances
Section titled “Targets are logical, not instances”Each key under targets names a role, not a running node. A target names exactly one source: contract for the members of a contract, or daemon for the members of a daemon interface. The server’s manifest declares one depends_on.contracts slot per contract target, with the target name as its link_id, and the launcher connects that slot to a running instance at deploy time. The same exposure can therefore work with a simulated camera or a real one without being changed. A target name follows the rules of a node name, because it becomes a slot’s link_id.
A target must select at least one member, and an exposure must declare at least one target.
Contracts are referenced by identity and, optionally, by content
Section titled “Contracts are referenced by identity and, optionally, by content”A target’s contract names the contract by name:tag, and selects members of the contract that resolves under that identity. A contract can change under its tag: the fields of a message, or the failure kinds it declares. The sha256 is optional. It is an author pin with the meaning pins have everywhere in Peppy:
- Present: the contract resolved for the exposure must fingerprint to exactly that value. A launch or a repository check that resolves different bytes refuses, naming the pinned fingerprint and the resolved one.
- Absent: the launch pins the contract bytes it resolves, and the exposure is validated against those. The exposure follows the contract as its repository evolves.
The value is the SHA-256 hash of the contract document’s exact bytes: sha256sum contracts/rgb_camera.json5. Pin when the schemas you published to clients must not change under you without a deliberate republication of the exposure.
Daemon targets
Section titled “Daemon targets”A daemon target uses daemon: { name, tag } instead of contract to expose built-in Peppy daemon operations (such as adding or removing robots in the stack). Daemon interfaces are compiled into peppy in contract format and served directly by the coordinating daemon.
// An exposure whose two targets name daemon interfaces:// `robot_membership:v1`, the copies of the launch, and `robot_leases:v1`, the// fleet of the stack and its halt. The peppy daemon of the coordinator serves// them, and no node implements them, so the targets take no `links`: the// launcher gives each a scope. The scope of `stack` gives the robot options a// client may add, the features of each, and the most robots of them on the// stack; the scope of `fleet` names the members its client may call.{ peppy_schema: "mcp_exposure/v1", manifest: { name: "framework_controls", tag: "v1" },
server: { title: "Robot stack (peppy framework)", instructions: "Add robots to the stack and remove them. stack.list reports the robot options this stack offers with their features, the machines of the stack and the robots it can remove. A robot and each of its features run on a machine: a peppy daemon, named by its core node name.", },
call_record: { tool: "stack.recent_calls", description: "List the last calls of this endpoint that could change the stack, newest first, each with its outcome, and the failure kind and message of a refused or failed call.", keep: 200, },
targets: { stack: { // A daemon interface is compiled into peppy and is never pinned: // `daemon` takes a name and a tag, and no `sha256`. daemon: { name: "robot_membership", tag: "v1" }, services: [ { member: "list", tool: "stack.list", description: "Report the robot options this stack can add with their features, the machines of the stack and this stack's machine, the robots of these options on the stack with their features and machines, the most robots it holds, and the addition or removal of a robot that runs now. launch_copies lists the robots of these options that the launch of this stack started, each as the launch started it, in the form of an item of copies without its running field: they stay listed whether or not each one is on the stack now, from the launch of the stack until its reset, the next launch or the end of this machine's daemon, and stack.join and stack.remove do not change them; the list is empty after a reset, until the next launch. Each item of launch_copies, and each item of copies with its running field left out, is a valid stack.join input: for a robot that stack.join added, it makes the same robot on the same machines; a robot that the command line added can differ from the robot that its item makes.", operation: "read_only", deadline_ms: 5000, }, ], actions: [ { member: "join", tool: "stack.join", description: "Add a robot of option to the stack under name on the machine core_node, with the features it names, each on its own machine, and wait until its software runs on each of its machines.", operation: "long_running", progress_timeout_ms: 660000, }, { member: "remove", tool: "stack.remove", description: "Remove a robot from the stack, and wait until its software has stopped.", operation: "long_running", progress_timeout_ms: 660000, }, ], }, fleet: { daemon: { name: "robot_leases", tag: "v1" }, services: [ { member: "list", tool: "fleet.list", description: "Report the robots of this stack with their software and their leases, and the halt of the stack.", operation: "read_only", deadline_ms: 5000, }, { member: "halt", tool: "fleet.halt", description: "Halt the stack: end every lease, and refuse every move until fleet.clear_halt.", operation: "mutating", deadline_ms: 5000, }, { member: "clear_halt", tool: "fleet.clear_halt", description: "Clear the halt of the stack. It starts nothing again.", operation: "mutating", deadline_ms: 5000, }, ], }, },}Key rules for daemon targets:
- No
sha256pin: Each Peppy release serves exactly one tag per daemon interface. - Same exposure syntax: Public names, descriptions, and policies work just like contract targets.
- Fixed surfaces only: Cannot appear on a per-robot surface (those route every tool by
robot). - Scoped, not linked: The daemon binds the slot automatically on startup, so the launcher supplies
daemon_scopesinstead oflinks. - Coordinator only: Must run on the coordinating daemon (no
core_node, not inside a copy).
Nodes can also call daemon interfaces directly through depends_on.daemon (Daemon targets).
The interfaces peppy serves
Section titled “The interfaces peppy serves”| Interface | Members | Purpose |
|---|---|---|
robot_membership:v1 | list (service), join / remove (actions) | List, add, and remove robot copies within the allowed options/features across federated machines. |
robot_leases:v1 | list, contract, take, release, offer, open, close, check_move, halt, clear_halt (services); changes, lease (actions) | Inspect the fleet, manage robot leases, check motion permissions, and halt the stack (Robot leases and the halt). |
Every MCP server automatically gets a robot_leases:v1 slot (named fleet unless the exposure already declares one, so fleet is reserved for that interface) to enforce moves_robot rules. All daemon calls are authorized against the verified signed sender (The senders of the calls to a daemon).
robot_membership:v1 members:
list(service, no request): Returnsoptions(allowed{ option, model, description, features, kind }),core_nodes(all live federated daemons),this_core_node, activecopies({ name, option, core_node, features, running }),max_copies, activechange({ action, name, option }while a join/remove is in flight),launcher, andlaunch_copies(initial copies started by the launch).join(action): Request{ name, option, core_node, features: [{ feature, core_node }] }. Streams{ step, line }feedback (launch,add,build,run) and completes with an empty result (or fails with a failure kind, reason, and log paths). Equivalent topeppy stack join OPTION:NAME@CORE_NODE --with ....remove(action): Request{ name }. Streams{ step, line }feedback as instances stop and completes with an empty result. Equivalent topeppy stack remove NAME.
In addition to Peppy’s five built-in failure kinds, robot_membership:v1 defines busy (another stack/node op is running), halted (stack is halted), and leased (another client leases the robot; see Leases).
Scopes
Section titled “Scopes”The launcher configures each daemon target’s permissions in daemon_scopes (or set_daemon_scopes). For robot_membership:v1:
// Deploying an exposure with a daemon target: the robots run as copies, and// the framework's endpoint lets a client add and remove them.//// peppy stack launch mcp_framework_controls{ peppy_schema: "launcher/v1", description: ["Simulated robots that run as copies, OpenArm or SO-101, and the MCP endpoint framework_controls:v1, through which a client adds and removes them. It needs a machine that runs the simulation."], components: [ { name: "robot", cardinality: "zero_or_more", options: { // Its fragment declares the own axis `brain`, whose option // `ai_brain_vla` deploys the brain's instance. openarm_sim: "robots/fragments/openarm_sim.json5", so101_sim: "robots/fragments/so101_sim.json5", }, }, ], deployments: [ { source: { exposures: ["framework_controls:v1"] }, instances: [ { instance_id: "framework_controls_inst", arguments: { port: 8903 }, // The daemon targets take no link. Each takes a scope, keyed by // the target's name. The instance has no `core_node`: an instance // that serves a daemon target runs on the coordinator. daemon_scopes: { // The members of robot_leases:v1 that the endpoint calls: a client // lists the fleet and halts the stack. Without `clear_halt`, the // endpoint serves no fleet.clear_halt, and the halt ends with // `peppy fleet clear-halt`. fleet: { members: ["list", "halt"] }, stack: { max_copies: 4, options: [ { option: "openarm_sim", // The robot model a robot of the option is, which a // client reads before it adds one. model: "openarm_v2", description: "A simulated OpenArm v2 standing on the floor: two arms with grippers", // A feature selects one option of one own axis of the // option, here `brain=ai_brain_vla`. A client adds a robot // with it, and names the machine of its part. features: [ { feature: "ai_brain", axis: "brain", option: "ai_brain_vla", description: "An AI brain that finds items by words, then grabs and places them", }, ], }, { option: "so101_sim", model: "so101", description: "A simulated SO-101 clamped on the edge of a table: one arm with a gripper", }, ], }, }, }, ], }, ],}options: Non-empty list of unique copy-axis options, each withmodel(model ID, e.g.openarm_v2),description(up to 200 chars), and optionalfeatures(1 to 6 items;features: []is refused; unique names and unique axes per option; each mapsfeature->{ axis, option, description }).max_copies: Integer1to65535capping concurrent copies of these options.
At launch and during peppy stack resolve, Peppy validates the scope in three gated stages:
- Every
optionbelongs to a copy axis (zero_or_more/one_or_more). - Every
featureselects a valid own axis and non-empty option on that robot option. - Every combination of features composes cleanly as a join over the bare stack, and the base (no-feature) copy does not already include any listed feature. All nodes across these combinations are pre-built on the coordinator as joinable nodes.
Schema narrowing: The running MCP server narrows its published JSON Schemas to the active scope (join.option restricted to scoped options; features restricted to scoped features or []; names validated as core node names excluding self; robot_leases exposes only scoped tools). Out-of-scope calls are rejected before reaching the daemon and logged as refused in the call record. (peppy mcp catalog prints un-narrowed schemas since scopes are per-instance.)
What the tools of robot_membership do
Section titled “What the tools of robot_membership do”list: Reads the live stack and federation presence on every call (so newly online or offline machines appear immediately). Returnschangewhile any join or removal of a scoped option is in flight, andlaunch_copiesfor the copies started by the original launch (each item is a validjoininput).join: Validates option, features, name uniqueness, andmax_copies; checks target machine liveness; runs the join with default CLI timeouts,env_vars, and keptenv_from_launchvalues. Local coordinator joins reuse pre-built artifacts in seconds; remote parts or--no-prebuildlaunches build on demand. Only onerobot_membershipjoinruns at a time (concurrent calls returnbusy). Failed joins roll back and report log paths.remove: Refuses names outside the scope (rejected), stops instances across machines in reverse start order, and returnsprecondition_failedif stack rules forbid removal (such as aone_or_morefloor or an active clock publisher) orbusyif another op is running.- Cancellation & timeouts: Cancelling via
tasks/cancel, closing a direct call, or exceedingprogress_timeout_mscancels the daemon goal (joinrolls back;removehalts further stops). Wait forlist.changeto clear before starting another change.
| Call outcome in call record | outcome | failure_kind |
|---|---|---|
| Outside narrowed schema | refused | |
| Invalid feature, unknown copy, or unauthorized sender | refused | rejected |
Duplicate copy name or max_copies reached | refused | precondition_failed |
Concurrent join or other stack/node op running | refused | busy |
| Blocked by a lease or halt | refused | leased or halted |
| Completed | completed | |
| Failed (including offline machine) | failed | Daemon failure kind |
| Cancelled by client | cancelled | |
| Silent daemon or goal dropped | failed |
Public names
Section titled “Public names”resource, tool and picture.tool set the names that clients see. You choose these names, and they do not need to match the internal member names. All public names share one namespace across the whole exposure. A resource and a tool cannot share a name, even across targets. Names must be 1 to 128 characters long and use only ASCII letters, digits, _, -, or .. A . cannot be the first or last character or appear next to another ..
A resource’s URI is derived from its name as peppy://resource/<name>.
Each exposure is its own endpoint with its own catalog, so two exposures served by one process may reuse a public name without conflict.
Policies
Section titled “Policies”Policies limit how each published member can be used. You declare them for each member, and the running server enforces them.
Topic policies
Section titled “Topic policies”| Field | Required | What it does |
|---|---|---|
freshness.max_age_ms | yes | Treat a snapshot older than this as stale instead of returning it as current |
update.max_hz | yes | Limit how often the snapshot refreshes and notifies subscribers. Faster messages are dropped before decoding or transcoding |
representation | no | Interpret the message as an image and publish its picture in a codec, as a blob apart from the rest of the message (see below) |
max_result_bytes | conditional | Cap on the snapshot content after representation runs: the serialized document plus, under a representation, the base64 text of the blob |
on_oversize | conditional | What to do when the content exceeds that cap: downscale (re-encode small enough to fit) or reject (report the read as failed) |
picture | no | Publish the picture through a picture tool as well. Requires a jpeg representation |
The message format determines whether the size policy is required:
- A payload with a static maximum size contains only fixed-size scalars, fixed-length arrays, or nested objects made from those types.
max_result_bytesis optional. If you set it, it must be at least the maximum possible size. Do not seton_oversize, because the payload cannot exceed that limit. - A payload with no static maximum size contains a
string,bytes, or a variable-length array, such as a camera picture. You must set bothmax_result_bytesandon_oversizeto limit what a read can return.
An image representation names members of the topic’s own message format by role:
representation: { image: "jpeg", // `png16` for a 16-bit single-channel picture, or `raw`, which passes the picture bytes through untouched quality: 80, // `jpeg` only; `png16` is lossless and `raw` has no encode step fields: { data: "data", // `bytes` or an array of `u8` encoding: "encoding", // `string` width: "width", // `u8`, `u16`, or `u32` height: "height", // `u8`, `u16`, or `u32` }, depth_range: { near: 100, far: 10000 }, // `jpeg` only; how a `z16` depth picture renders}All four fields must refer to required, non-$optional top-level members of the correct type. The runtime needs all four values to interpret a picture. jpeg transcodes rgb8 and bgr8 pictures, and z16 depth pictures under a depth_range; png16 transcodes pictures of one unsigned 16-bit little-endian sample per pixel, labeled z16, mono16 or 16UC1, such as a depth map, and writes the picture as a 16-bit PNG under the encoding png. A picture already labeled jpeg or mjpeg under jpeg passes through untouched; a png picture under png16 passes through once it decodes as 16-bit single-channel, and any other PNG is refused. A 16-bit picture keeps one source sample per output pixel.
A jpeg representation renders rgb8 and bgr8 pictures in color, and 16-bit depth pictures, labelled z16, mono16 or 16UC1 (one little-endian u16 reading per pixel, 0 for a pixel with no reading) as a grayscale picture. depth_range sets the readings that picture spans, in the depth picture’s own counts, so one shade means one distance on every picture a client reads: a reading at near or nearer renders white, one at far or farther black, readings between them in linear proportion, and 0 black. near must be above 0 and below far. A z16 picture that arrives on a representation without a depth_range is refused, and a depth_range on a raw representation is a parse error.
A snapshot under a representation has two parts, and a read serves each as a content of its own:
- The document is the message as JSON, without the member
fields.datanames. After a transcode it carries the encoding label and the dimensions of the published picture. - The blob is the picture in the codec of the representation, under the MIME type of that codec:
representation.image | Blob MIME type |
|---|---|
jpeg | image/jpeg |
png16 | image/png |
raw | application/octet-stream |
A snapshot of a topic with no representation is a document alone: the whole message as JSON.
A target may select one topic member more than once, each entry with its own resource name, representation and policies, and each keeping its own snapshot: a depth picture reads as a jpeg picture a model judges distance from and as a lossless png16 picture a program decodes.
Picture tools
Section titled “Picture tools”picture publishes the picture of a topic through a tool, beside the resource, for a model that looks on its own: the image of a tool result is the form in which a client hands a picture to the model.
picture: { tool: "front_camera.look", // a public name, in the one namespace of the exposure description: "Look through the front-facing camera: its latest picture.",}The topic must carry representation.image: "jpeg": a png16 or a raw picture is data for a program, not an image for a model. The tool answers inside the call, from the snapshot a read of the topic’s resource serves, under the same freshness policy. It sends nothing to the Peppy graph. On a fixed surface it takes no argument, and on a per-robot surface it takes the routing arguments of its target.
Service policies
Section titled “Service policies”| Field | Required | What it does |
|---|---|---|
operation | yes | read_only or mutating, advertised to the client. Long-running work is an action, so there is no third value |
deadline_ms | yes | How long the call waits before it comes back as a tool error |
restrict | no | Inclusive min/max bounds narrowing numeric request fields |
representation | no | Interpret the response as an image and answer its picture as an image, apart from the rest of the response (see below) |
max_result_bytes | no | Cap on the serialized tool result: the serialized document plus, under a representation, the base64 text of the picture. A larger response is a tool error |
on_oversize | no | What to do when the result exceeds that cap: downscale (re-encode the picture small enough to fit; needs a jpeg or png16 representation) or reject (a tool error). Needs max_result_bytes |
A service representation is the topic representation, on the members of the service’s response: fields.data names the response member that carries the picture, and the other three its encoding label and dimensions, all of the same types a topic needs. The tool answers with the picture first and the rest of the response as the text and the structured content. A jpeg or a png16 picture is an image block in the codec of the representation, as a picture tool answers. A raw picture is data for a program, not an image for a model, so it is an embedded resource of type application/octet-stream at peppy://tool/<tool>/frame, which a client does not hand to its model as an image. Its published output schema is the schema of that document: the response without the member the picture is taken from. A response whose picture is empty is answered as the document alone. A service that cannot answer gives an error reply, which reaches the client as the tool error of a failed call. A picture that does not decode is a tool error.
{ member: "render_view", tool: "scene.look", description: "Look at the simulated world from a free viewpoint.", operation: "read_only", deadline_ms: 10000, representation: { image: "jpeg", quality: 80, fields: { data: "data", encoding: "encoding", width: "width", height: "height" }, }, max_result_bytes: 524288, on_oversize: "downscale",}restrict narrows a numeric range without changing the contract’s type. Each key names a top-level member of the request format. Peppy adds the bounds to the published input schema as minimum and maximum, so clients can see the allowed range. The endpoint rejects values outside that range before sending anything to the Peppy graph.
Each bound must fit the member’s type. For example, validation rejects min: -200 for an i8. You cannot restrict a u64 or i64 member because its public schema uses a decimal string instead of a JSON number. Use a narrower type in the contract if you need numeric bounds.
Action policies
Section titled “Action policies”| Field | Required | What it does |
|---|---|---|
operation | yes | long_running, the only value; actions are long-running by definition |
deadline_ms | one of the two | Whole-goal deadline: the longest time the goal may run. The advertised task TTL is this plus a short grace window |
progress_timeout_ms | one of the two | The longest time the goal may go without a sign of progress. The goal may run for as long as it makes progress, up to one day as a task. The action must declare a feedback_topic |
safety_sensitive | no | Advertises that the call changes the physical world. Defaults to false |
confirmation_required | no | The task waits in input_required and sends no goal until the client confirms through tasks/update. A client without the tasks extension cannot call the tool. Cannot go with progress_timeout_ms. Defaults to false |
An action must declare exactly one of deadline_ms or progress_timeout_ms:
deadline_mscaps total runtime. Feedback does not extend it. When time runs out, the call or task fails with a deadline message and the endpoint cancels the goal on the provider.progress_timeout_mscaps silence between signs of progress (use it when runtime depends on external factors like slow downloads). Each of the following resets the window: goal admission, every feedback message (including ones that fail to decode, which are logged and hidden from the client), and the end of the feedback stream. Reading the final result after the stream ends gets one window. When a window expires silently, the call or task fails withno progress within <N> ms; the endpoint stopped following the goal and cancelled itand cancels the goal.
Both bounds also cap the initial wait for the provider to admit the goal (deadline_ms or one progress_timeout_ms window). If that wait expires, the call fails; the endpoint sends a cancel only if the provider already acknowledged the goal.
Cancelling under progress_timeout_ms: When the client cancels the goal, the endpoint forwards the cancel and keeps watching under the same progress window:
- If the goal completes, it returns the result as usual.
- If it ends cancelled, it returns the provider’s result as a cancelled goal.
- If it stays silent for one window, it fails with
no progress within <N> ms; a cancel was sent and the provider did not answer it. - If the provider replies that the goal already ended, the endpoint fetches the result immediately (or fails with
the goal ended, but its result is no longer readableif it expired). - If the provider does not recognize the goal, it fails with
a cancel was sent and the provider does not know the goal. - If sending the cancel fails or times out, it fails with
a cancel was sent and failed: <error>and logs a warning (the goal may still be running).
progress_timeout_ms assumes the provider only sends feedback when real progress occurs (heartbeat feedback on a timer would mask a stuck goal). Because waiting for user confirmation produces no progress, progress_timeout_ms cannot be combined with confirmation_required.
Daemon target tools follow these same rules (see What the tools of robot_membership do). The only exception is a member that moves a robot: after a silent window, the call fails with no progress within <N> ms; the goal moves a robot, so the endpoint follows it on until it ends, and cancels it at a halt of the stack, without cancelling the goal.
Members that move a robot
Section titled “Members that move a robot”Contracts mark physical-motion or device-changing members with moves_robot (see Marks). For any tool backed by a moves_robot member, the MCP server enforces the stack’s fleet safety rules:
- Pre-call move check: Before forwarding the call, the server calls
check_moveon the coordinator daemon for the target instance. If refused, the call never reaches the provider; it fails withthe stack refused the move: <kind>: <message>(where<kind>ishalted,leased, ornot_leased), setsoutcome: "refused",failure_kind, andmessageinstructuredContent(or the task error), and logsrefusedin the call record. If the daemon does not answer, the call is also refused ("the daemon did not answer the move check of <instance>: ..."). - Halt tracking: While a
moves_robotgoal runs, the server subscribes to fleetchanges. Any halt at a revision newer than the goal’s move check immediately cancels the goal and waits for the provider’s terminal result (stale halts from before the move check are ignored). - Fail-closed on lost halt feed: If the
changessubscription drops unexpectedly (daemon refusal, disconnect, or router restart), the server immediately cancels all activemoves_robotgoals and resubscribes on the next goal. - No timeout auto-cancel: If the client stops waiting due to
deadline_ms,progress_timeout_ms, or task TTL, the server does not cancel amoves_robotgoal. It keeps tracking the goal until it finishes (retrying result queries while the provider is alive) and still cancels it on a stack halt. An explicit client cancel (tasks/cancelor closing the call) cancels the goal as usual. - No leases held: The MCP server never acquires leases itself. Calls targeting a robot leased by another client are refused with
leaseduntil the holder opens or releases that lease.
The call record
Section titled “The call record”An exposure can keep a record of the state-changing calls its endpoint takes, and publish it through a tool:
// Beside `server` and `targets`.call_record: { tool: "robot.recent_calls", // a public name, in the one namespace of the exposure description: "The last state-changing calls of this endpoint, newest first, each with how it ended: its outcome, and the failure kind and message of a refused or failed call.", keep: 200, // how many calls the endpoint keeps, 1 to 1000},The endpoint records every call of a tool that is not read-only (a mutating service, and every action, whether it runs inside the call or as a task) and keeps the last keep of them in memory for the life of the process. The tool takes no argument, is listed read-only, leaves no entry of its own, and answers { calls: [...] }, newest first. Each entry carries:
| Field | What it says |
|---|---|
started_at | When the call started, RFC 3339 on the wall clock of the host, also on an endpoint whose freshness runs on simulated time |
client | The name and version the client declared as its implementation, or null when its request named none |
tool | The tool called |
arguments | The arguments as sent, when their JSON is 1024 bytes or fewer; null otherwise |
arguments_bytes | The size of the arguments’ JSON |
outcome | running, completed, failed, cancelled or refused |
failure_kind | The failure kind the provider gave a refused or failed call, else null |
message | What ended a call that did not complete: the provider’s message of a refused or failed call, the reason of a cancelled call, or the endpoint’s words; null for a running or completed call |
duration_ms | How long the call ran, once it ended |
The entry keeps nothing of a result: a completed goal and a response are a success. A task’s entry is running until the task ends, and so is the entry of a call whose client closed it, until the provider ends the cancelled goal. A call ends:
completedwhen the goal completed or the service answered with its response.refusedwhen the provider refused the goal, with the kind it gave; or when the call never reached the provider: its arguments failed the published schema, it named a robot or a member that is not there, it needed the tasks extension the client did not declare, or no provider was bound. Only a refusal of the provider has afailure_kind.failedwhen the goal failed or the service gave an error reply, with the kind the provider gave; or when the call did not reach an end that the provider gave: a deadline, a progress window without a sign of progress, a transport error, a goal that the provider abandoned, a kind that the member does not declare, feedback that overflowed, a task whose TTL passed before its goal ended,the task expired before its goal ended; the endpoint cancelled the goal, or before its goal started,the task expired before its goal started. Only a failure of the provider has afailure_kind.cancelledwhen the goal ended cancelled, with its reason, for example because its client cancelled the task or closed the call; or when the task ended before its goal started: its confirmation was declined, or its client cancelled it while the confirmation waited.
The record holds the calls of MCP clients on that endpoint. A motion that a teleoperation or another node of the stack commanded is not in it. When a client finds the robot in a state it did not command, the record says whether another client of the endpoint did it, and, when no entry accounts for it, that no client did.
The published schemas
Section titled “The published schemas”You do not define request and response shapes in the exposure. Peppy derives them from the contract’s message_format declarations. The catalog records the version of the mapping used to create the schemas. The schema of a resource with a representation is the schema of its document: the message without the member the blob carries. It is also the output schema of the topic’s picture tool, and a service with a representation publishes the schema of its document the same way.
Most types map directly to JSON. These are the important mapping rules, including the types that JSON cannot represent directly:
message_format | Published JSON Schema | Why |
|---|---|---|
bool, string, f32, f64 | boolean, string, number | Direct |
u8…u32, i8…i32 | integer with minimum/maximum | The type’s own range is published |
u64, i64 | string with a canonical decimal pattern | JSON numbers lose precision above 253 |
time | string, format: "date-time" | RFC 3339, fractional seconds carrying full nanosecond precision |
bytes, array of u8 | string, contentEncoding: "base64" | Identical on the wire, so they share one rendering. A fixed byte length pins the exact base64 length |
| Other arrays | array with items; fixed length pins minItems/maxItems | Direct |
| Nested objects | object with a property for each field | Direct |
$optional field, at any depth | Omitted from the required of its object | Direct |
$description of a field | description of its property | Direct |
The input and output schemas of each tool, resource and task carry the $description of each field, and a scope that narrows a property keeps its description. The description of a tool, a resource or a task is the one that the exposure gives it.
Public property names use the DSL’s snake_case spelling. The internal wire encoding uses lowerCamelCase instead. Every derived object schema sets additionalProperties: false.
Check it
Section titled “Check it”An exposure is checked where it is published, by the repository check, and again by every launch that serves it. Both read the contracts through the local repository caches, so run peppy repo refresh on the machine first, and both read the daemon interfaces from the peppy that runs them. Neither check needs a running daemon.
peppy repo index . --check --validate-mcp-exposures # the index, then every exposure against its contractspeppy mcp catalog camera_and_recording:v1 # the catalog an endpoint for the exposure advertisespeppy repo index --check --validate-mcp-exposures validates every exposure the repository’s index lists against the contracts and the daemon interfaces it references and reports every violation of every exposure at once, so you fix a document in one pass. A contract the caches cannot resolve is an error naming that contract, never a pass. A file that declares the exposure schema but does not parse as one (a document claiming a public name twice, say) is listed by no index, so the check reports it by path rather than letting it pass unseen. Run the check in the repository’s CI, as mcp-hub does: a hub cannot then merge an exposure that a launch would refuse.
2 exposures do not validate: - mcp_exposure `camera_and_recording:v1` (exposures/camera_and_recording.json5): - target `front_camera` selects service member `set_brightnes`, but contract `rgb_camera:v1` declares no such service (declared services: `video_stream_info`, `set_brightness`) - mcp_exposure `recording_only:v1` (exposures/recording_only.json5): - contract `episode_recording:v1` not in contract cache; run `peppy repo refresh`peppy mcp catalog <name:tag> prints the catalog the server derives for one exposure: every resource, tool, task, and picture tool with its public name, description, policies, and derived JSON Schemas, the call record when the exposure declares one, plus the identity the endpoint advertises, the contract slots its contract targets become (contracts), and the interface each daemon target names (daemon_targets). It is what a running endpoint answers through discovery and the list methods, so it is the thing to read when you want to see what a client will see. For a daemon target it prints the schemas of the interface without the narrowing of a scope: a running endpoint narrows them with the scope its launcher gives the target, which belongs to the instance and not to the exposure. The catalog is derived on demand and is never committed.
{ "bundle_format": 1, "schema_mapping_version": 1, "exposure": { "name": "camera_and_recording", "tag": "v1" }, "server": { "title": "OpenArm camera and recording", "instructions": "Observe the front camera and record teleoperation episodes." }, "contracts": [ { "name": "rgb_camera", "tag": "v1", "sha256": "44527ab0…fb736ab", "link_id": "front_camera" }, { "name": "episode_recording", "tag": "v1", "sha256": "a4cfd6ec…f177c0d2", "link_id": "recorder" } ], "resources": [ { "name": "front_camera.latest_frame", "uri": "peppy://resource/front_camera.latest_frame", "…": "…" } ], "tools": [ { "name": "front_camera.info", "…": "…" }, { "name": "front_camera.set_brightness", "…": "…" } ], "tasks": [ { "name": "recorder.record_episode", "…": "…" } ], "pictures": [ { "name": "front_camera.look", "resource": "front_camera.latest_frame", "…": "…" } ]}Deploy it
Section titled “Deploy it”A launcher deploys exposures with source: { exposures: [...] }, listing each as "<name>:<tag>". The deployment takes one argument, port, and one links entry per contract target of every exposure it lists. Each link connects a logical role to a running instance. A per-robot surface takes no links: the launcher’s adjustments under each robot’s option fill its targets. A daemon target takes no link either: it takes a scope.
// Deploying an MCP exposure: the providers by instance, and the server built// into peppy serving the exposure, its logical targets filled through// `links`.//// peppy stack launch mcp_camera_and_recording{ peppy_schema: "launcher/v1", description: ["A front camera and an episode recorder, and the MCP server of peppy that serves the exposure camera_and_recording:v1 of the two. It needs a UVC camera."], deployments: [ { source: { name: "uvc_camera:v1" }, instances: [{ instance_id: "front_cam_inst" }], }, { source: { name: "episode_recorder:v1" }, instances: [{ instance_id: "recorder_inst" }], }, { // The exposures to serve, each as `<name>:<tag>`. The daemon derives // the server from these documents and the contracts they reference, // and runs one `peppy mcp serve` process for the list: nothing is // generated or built. Its node is named after the set, here // `mcp_camera_and_recording_v1:builtin`. source: { exposures: ["camera_and_recording:v1"] }, instances: [ { instance_id: "mcp_server", // The only argument the server takes. It binds `127.0.0.1:<port>` // and serves each exposure at `/<name>/<tag>/mcp`, so this one is // reached at http://127.0.0.1:8900/camera_and_recording/v1/mcp. arguments: { port: 8900 }, // One entry per target in the exposure document: the launcher // binds each logical target to a concrete running instance. This is // where "the front camera" stops being a role and becomes a robot. links: { front_camera: "front_cam_inst", recorder: "recorder_inst", }, }, ], }, ],}peppy stack launch mcp_camera_and_recordingThe daemon resolves each exposure through the machine’s repository caches, then every contract the exposures reference, validates every exposure against those contracts and the daemon interfaces it serves, and derives the server’s node from the result: its identity, its manifest (one contract slot per contract target, consuming exactly the selected members), and the catalog of each endpoint. Nothing is added or built. The node lands in the stack ready to run, with the installed peppy binary as its artifact, and its instance runs peppy mcp serve. You never run that command yourself: the daemon hands it the pinned documents through the environment, and run by hand it refuses, naming PEPPY_MCP_SERVE_SPEC. The derived manifest and the documents the server reads are written under ~/.peppy/built_in/<node name>/. On Linux, replacing the peppy binary on disk while the daemon runs (an upgrade, a rebuild) does not strand it: the daemon keeps serving built-in nodes from its own running image, warns in the add log that the file was replaced, and picks up the new binary when it restarts.
The node’s identity is derived from the exposures it serves, so a relaunch, a peer, and a reader of peppy stack list all name it the same way: mcp followed by _<name>_<tag> for each exposure in name-then-tag order, at the tag builtin. The launcher above registers mcp_camera_and_recording_v1:builtin.
The instance prefers 127.0.0.1:<port> (default 8900) and serves each exposure at its own path:
http://127.0.0.1:8900/<exposure name>/<exposure tag>/mcpEvery other path returns 404, a bare /mcp included. Point a client at http://127.0.0.1:8900/camera_and_recording/v1/mcp.
A deployment of an exposure with a daemon target gives the target its scope, keyed by the target’s name, as the launcher of Scopes does.
The scope reaches the server with the runtime configuration of its instance, and the server parses it when it starts. A launch and a join check every scope before they start the server. A server that starts without a scope for one of its daemon targets, with a scope that does not parse, or with a scope key that names no daemon target, for example under peppy node run of its node, serves nothing and stops. Its run log names each daemon target that lacks a scope and says how to give one: in the instance’s daemon_scopes, or with a set_daemon_scopes adjustment on the instance.
port is a preference. A server that finds the port free takes it. A server that finds it held by another process takes a port the operating system picks on the same loopback address, says so in its run log with a warning naming both ports, and announces the port it holds. Only a held port falls back: any other bind failure stops the process, its run log says cannot bind 127.0.0.1:<port>, and the launch fails naming that instance. The URL the server ended up on is never a guess: the launch or the join that started it prints it under MCP endpoints:, and peppy stack list shows it for as long as the instance runs.
The server answers the clients that run on its machine and are not web pages. It refuses a request whose Host header is not a loopback name or address, and a request that carries an Origin header, which a browser adds to the requests of a page: a page of another site that the user opens cannot call an endpoint (DNS rebinding included).
The derived manifest declares one entry under execution.endpoints per exposure, labelled <name>_<tag> (the tag spelled as generated code spells it, - becoming _), of kind mcp, described by the exposure’s title. The server announces each one when it binds, and the daemon reports the URL under that label. The launch ends with them under MCP endpoints:; the server binds loopback only, so each exposure has exactly one URL:
MCP endpoints: mcp_server (mcp_camera_and_recording_v1:builtin) @cn-sweet-edison camera_and_recording_v1 http://127.0.0.1:8900/camera_and_recording/v1/mcpLaunch completed successfullyPer-robot surfaces
Section titled “Per-robot surfaces”An exposure that declares robots is a per-robot surface: one endpoint for every robot of the stack, whatever their models, where every call names its robot. Its targets are the contracts a robot may bring, and each robot of the stack fills the targets its own instances implement.
{ peppy_schema: "mcp_exposure/v1", manifest: { name: "robot_control", tag: "v1" }, server: { title: "Robots", instructions: "Call robot.list first; every other tool names a robot it lists." }, robots: { list: { tool: "robot.list", description: "The robots of the stack, with what each one fills." }, describe: { identity: { target: "identity", service: "get_identity" }, limbs: { target: "limb_state", service: "get_limbs" }, }, }, targets: { identity: { contract: { name: "robot_identity", tag: "v1" }, services: [ { member: "get_identity", tool: "robot.get_identity", description: "Who the robot is.", operation: "read_only", deadline_ms: 2000 }, ], }, limb_state: { contract: { name: "limb_state", tag: "v1" }, topics: [ { member: "limb_states", resource: "robot.limb_state", description: "The robot's limbs.", freshness: { max_age_ms: 2000 }, update: { max_hz: 2 }, max_result_bytes: 65536, on_oversize: "reject" }, ], services: [ { member: "get_limbs", tool: "robot.get_limbs", description: "The robot's arms and grippers, by name.", operation: "read_only", deadline_ms: 2000 }, ], }, camera: { contract: { name: "rgb_camera", tag: "v1" }, argument: "camera", topics: [ { member: "video_stream", resource: "camera.latest_frame", description: "The camera's latest picture, JPEG encoded.", freshness: { max_age_ms: 2000 }, update: { max_hz: 2 }, representation: { image: "jpeg", fields: { data: "data", encoding: "encoding", width: "width", height: "height" } }, max_result_bytes: 524288, on_oversize: "downscale", picture: { tool: "camera.look", description: "Look through one of the robot's cameras." } }, ], }, },}How routing and wiring work:
- Required
robotargument: Every tool on a per-robot surface requiresrobot(matching the copy name returned byrobots.list). - Single vs. multi-member targets: A target without
argumentcan hold at most one instance per robot (for example,limb_state). A target withargument(such asargument: "camera", never"robot") can hold multiple instances per robot, and every call requires that routing argument (the unprefixed fragment instance ID). Contract request fields cannot collide with routing arguments. - Listing enrichment (
robots.describe): Maps extra output fields on each robot entry to parameter-free read services on single-member targets (cannot shadow reserved keysrobot,tools,resources,members,notes). - Dynamic launcher wiring: Every target becomes a
zero_or_morecontract slot. Leavelinksoff the server instance; instead, useadd_linksunder each robot option so robots join and leave dynamically via copies without restarting the server. Only copy instances may fill per-robot targets (enforced bylaunch,join, andresolve).
{ source: { exposures: ["robot_control:v1"] }, instances: [{ instance_id: "robot_control_inst", arguments: { port: 8900 } }],}// In the launcher, under the option that selects the robot: the robot's own// instances fill the targets.options: { openarm: { fragments: ["openarm/fragments/openarm.json5"], adjustments: [ { target: "robot_control_inst", add_links: { identity: ["init_inst"], limb_state: ["backbone_inst"] } }, { target: "robot_control_inst", when: { camera_rig: "cameras" }, add_links: { camera: ["wrist_left", "wrist_right"] } }, ], },}What a client sees on a per-robot surface:
- Listing tool (
robot.list): Takes no arguments and returns{ robots: [...] }with each robot’srobotname, sortedtools, sortedresources, per-targetmembers(for targets withargument),notes(any read errors), and eachdescribefield (nullon error). Updates immediately as robots join or leave. - Tools: Static union of all target tools (including picture tools). Calling an unknown robot, unfilled target, or missing member is rejected before reaching Peppy and lists valid alternatives (including hinting if that member name belongs to a different target, such as
depth_camerainstead ofcamera). - Resources: Scoped per robot and member (
peppy://resource/alpha/robot.limb_state, orpeppy://resource/alpha/wrist_left/camera.latest_frame).resources/listupdates live and emitsnotifications/resources/list_changedon join/remove.
Several exposures on one endpoint
Section titled “Several exposures on one endpoint”One deployment can list several exposures, two tags of the same exposure included. They share one process and one port, and nothing else: each endpoint keeps its own catalog, snapshots, subscriptions, and task handles, so a public name, a subscription, or a task handle on one endpoint is unknown to the others.
Targets with the same name across the listed exposures share one slot when they name the same contract, and the manifest consumes the union of the members they select. One links entry then fills the slot for every exposure using it. Daemon targets with the same name share one scope when they name the same interface. The same target name bound to different sources (two contracts, a contract and a daemon interface, or two daemon interfaces) is refused, naming both exposures and both sources: two exposures sharing a target name must name the same source.
{ source: { exposures: ["camera_and_recording:v1", "camera_only:v2"] }, instances: [ { instance_id: "mcp_server", arguments: { port: 8900 }, // `front_camera` is a target of both exposures, bound to `rgb_camera:v1` // in each, so one link fills it for both endpoints. links: { front_camera: "front_cam_inst", recorder: "recorder_inst" }, }, ],}The launch refuses, before anything starts, when:
- an exposure or a contract it references is not in the caches, or an exposure does not parse;
- an exposure names a daemon interface, or a tag of it, that this peppy does not serve. The refusal names the tag that this peppy serves;
- an exposure does not validate against its contracts and daemon interfaces. The report lists every violation of every listed exposure at once;
- an exposure’s
sha256disagrees with the contract bytes the launch resolved, or two listed exposures pin one contract at different bytes. One deployment carries one content per contract; - an exposure is listed twice in one deployment;
- two deployments list the same set of exposures. They would derive the same node identity, so the error names the set and points at the remedy: to serve one set on several hosts, declare one deployment with one instance per host;
- a deployment lists a per-robot surface beside a fixed one, or two surfaces sharing a target name its member by different arguments;
- a
linksentry names no target of the listed exposures, or a contract target is left without a link, as for any node’s slot; - a daemon target has no scope, a scope does not parse into the type of its interface or does not hold against the launcher, or a scope or a link is on the wrong instance or target. See the checks of
daemon_scopes; - on a per-robot surface, a robot fills a target with no
argumenttwice, or an instance the launcher deploys outside every copy fills a target.peppy stack joinrefuses the same two before the copy starts.
Any number of instances run on one machine, whatever port each prefers. The first to reach a port holds it and the others take another, so a launcher that needs a known URL for each server names a different port for each, and a joined copy gets one with --set-arguments <instance>.port=<n>. Two servers that start together and prefer one port settle between themselves which of them holds it. Read a server’s run log with peppy node info on the node’s identity.
Seeing what is served
Section titled “Seeing what is served”peppy stack list adds an Instance endpoints table when any instance serves an endpoint: one row per endpoint URL, under the node and instance serving it, with the endpoint’s kind and label.
Instance endpoints
┌──────────────────────────────────────┬────────────┬──────┬─────────────────────────┬───────────────────────────────────────────────────┐│ NODE │ INSTANCE │ KIND │ LABEL │ ENDPOINT │├──────────────────────────────────────┼────────────┼──────┼─────────────────────────┼───────────────────────────────────────────────────┤│ mcp_camera_and_recording_v1:builtin │ mcp_server │ mcp │ camera_and_recording_v1 │ http://127.0.0.1:8900/camera_and_recording/v1/mcp │└──────────────────────────────────────┴────────────┴──────┴─────────────────────────┴───────────────────────────────────────────────────┘peppy node info mcp_camera_and_recording_v1:builtin lists the same endpoint under the instance as camera_and_recording_v1 (mcp) http://127.0.0.1:8900/camera_and_recording/v1/mcp.
peppy stack resolve derives the same node from the same caches and holds the deployment’s links to its slots, so a launcher can be checked before it is launched. See Auditing a composed launch.
Placement
Section titled “Placement”An exposure deployment is placed like any other: core_node on the instance names the machine it runs on, and the coordinator ships the pinned exposure documents and the contracts they reference, from which the other machine derives the same server. An instance that serves a daemon target is the exception: it runs on the coordinator, so it declares no core_node and belongs to no copy. The federation limits apply: an exposure or a contract resolved from a filesystem repository cannot back an instance placed on another machine. The server reads the messaging layer like any node, so a topic-heavy exposure belongs on the machine that produces the topic.
What a client sees
Section titled “What a client sees”Discovery. server/discover returns the exposure’s title and instructions, the implementation identity (the exposure’s name at its tag), and 2026-07-28 as the only supported revision. Discovery and tools/list include private caching hints with a one-hour TTL, and so does resources/list on a fixed surface; on a per-robot surface the resource list follows the robots and carries none. The tools do not change while the server is running. To change them, change the exposure document, refresh the repositories, and launch again.
Resources. A read returns a snapshot that passed the policies, as typed contents under the resource’s URI: the document as application/json text and, for a resource with a representation, the blob after it under the MIME type of its codec. resources/list gives a resource with a representation the MIME type of its blob, and every other resource application/json. The ttlMs value of a read says how long the snapshot remains fresh. The resource is unavailable until the first published value arrives. A resource reads live messages only, also on a topic that retains. After the stored value is older than freshness.max_age_ms, reads report it as stale instead of returning old data as current. If the size policy rejects a new snapshot, the server keeps the previous one until it becomes stale.
A read answers with the first message the endpoint receives after the read arrived, whatever update.max_hz admits: a client that changes something and reads at once sees a message from after its change, not the snapshot the last gate interval stored. The wait is bounded by freshness.max_age_ms of wall time; a topic that stays silent that long answers with the stored snapshot when it is still fresh, and with the stale refusal when it is not. Readers that wait together get the same message, so the cost is at most one decode per message. Subscribers keep their rate: a message admitted for a waiting reader alone sends no notifications/resources/updated, and every message the interval admits does.
The guarantee is about when the endpoint received the message, not about when the source captured it. A message carries the source’s stamp, on the source’s clock (in a simulation, simulated time), and a picture that the source captured before a change and delivered after the read arrived still shows the old state. A client that needs the picture after a change reads the stamp.
Tools. The endpoint checks input against the published schema, including restrict bounds, before sending anything to the Peppy graph. It rejects invalid input and unknown tool names. If a service does not respond within deadline_ms, the client receives a readable tool error. A service that gives an error reply ends the call with the tool error of a failed call. A service with a representation answers with its picture, as an image block or, for a raw picture, as an embedded resource, then the rest of the response as the text and the structured content, and the document alone when the response carries no picture.
Picture tools. A picture tool is listed read-only (readOnlyHint: true, destructiveHint: false) and answers inside the call for every client: it is never a task. Its result carries the snapshot a read of its resource serves at that moment:
{ "content": [ { "type": "image", "data": "<base64>", "mimeType": "image/jpeg" }, { "type": "text", "text": "{\"encoding\":\"mjpeg\",\"width\":1280,\"height\":720}" } ], "structuredContent": { "encoding": "mjpeg", "width": 1280, "height": 720 }, "isError": false}While the resource has no snapshot, or a stale one, the tool returns a tool error whose text is the message a read of the resource gives for that state. It waits for the next message as a read does.
Actions. An action-backed tool runs its goal on whichever surface the calling client can drive. The client’s request capabilities decide, per call.
For a client that declares the tasks extension (io.modelcontextprotocol/tasks in its extensions), the call returns a task handle and follows this sequence:
- If
confirmation_required, the task waits ininput_requireduntil the client confirms throughtasks/update. No goal is sent before that. - The server sends the goal. Action feedback updates the task’s status message.
tasks/cancelforwards a request to the action’s cooperative cancellation path. It is the one way a client cancels a task. A declined confirmation, or a cancel before the client confirms, ends the task ascancelled, and no goal is sent.- A goal that completes completes the task with the structured result. A goal that ends cancelled ends the task as
cancelled, and the task’s status message says why, as a cancelled goal describes. A goal that the provider refuses or fails ends the task asfailed, with the failure in its error, as a refused or failed call describes. A goal that is abandoned, expired, or past its bound ends the task asfailedwith a message saying which event occurred.
Task handles outlive connections, and do not outlive the process. A client that disconnects while its goal runs cancels nothing: the goal runs on, and a client that reconnects can continue and observe the same task. Stopping the stack ends every task the endpoint was running (see Goals and connections).
A task under deadline_ms advertises a TTL of the deadline plus a short grace window. A task under progress_timeout_ms advertises a TTL of one day (86400000 ms): the progress window fails a task whose goal goes silent, and the TTL is the longest a goal that keeps making progress may run as a task. When the TTL passes, the task fails with a generic expiry, the endpoint sends the provider a cancel, and the call record keeps the task failed. Every task stays readable for one more TTL after it ends.
For a client without the extension, the goal runs inside the call:
- The server sends the goal and the call stays open until the goal settles or its bound fails it. Under
progress_timeout_msthe endpoint sets no limit on the total time of the call: a goal that keeps making progress runs until it settles or the client closes the call. - Action feedback is sent as
notifications/progressunder the call’s progress token, in order, before the result. The first notification also opens the response: the endpoint sends the response headers with it. The endpoint holds one notification for the client at a time: while the client has not taken it, the endpoint reads no more feedback of the goal, and new feedback waits in the goal’s feedback buffer (see below). A call without a progress token gets no feedback, and nothing arrives on it, not even the response headers, until the goal settles. - Closing the call forwards a request to the action’s cooperative cancellation path at once, also while a notification waits for the client (see Goals and connections). The endpoint follows the goal to the end that its provider gives it after the cancel, and the call record keeps that end,
cancelledwhen the provider honours the cancel. - A goal that completes returns the structured result. A goal that ends cancelled returns the tool error of a cancelled goal. A goal that the provider refuses or fails returns the tool error of a refused or failed call. A goal that is abandoned, expired, or past its bound returns a readable tool error saying which event occurred.
On both surfaces, every feedback message of a goal waits in the goal’s feedback buffer until the endpoint shows it, up to 1024 unread messages: the default bound of the buffer. On a task the endpoint shows each message as it comes. On a call it shows the next message once the client took the one before, so a client that reads its call slowly keeps the messages in the buffer. A goal whose unread feedback goes past the bound loses the stream: the buffer drops the unread messages and cancels the goal, and the call or the task fails with the action failed: the endpoint fell behind the feedback of the goal by more than 1024 unread messages, so it cancelled the goal.
A tool with confirmation_required cannot run inside a call: the confirmation is an input request only a task can carry. The endpoint refuses it with error -32021 (Missing Required Client Capability), naming the tool and the extension in the message and the capability in the error data.
Goals and connections
Section titled “Goals and connections”The MCP server is the sender of the goals of its tools: the provider sees the server’s node, never the MCP client. A goal ends when its provider ends it, when the client cancels it, when the endpoint stops following it, or when the server stops. When the server’s process stops, its providers see that their sender is gone and cancel its goals after their sender grace.
How a client cancels a goal depends on the surface it runs on:
- A task outlives the connection that started it. A client that disconnects while its goal runs cancels nothing: the goal runs on, and a client that reconnects reads the same task.
tasks/cancelis the one cancel of a task. - A goal that runs inside a call is cancelled when its call closes. In Streamable HTTP a client cancels a call by closing it, and a client that disconnects closes it too: the endpoint cannot tell the two apart, and takes both as a cancel. Closing the call sends the provider a cancel, so a client that stops waiting, for example when its user interrupts it, stops the robot it moves. A client that must keep a goal running after it goes away declares the tasks extension.
The endpoint cancels a goal for its client, when the client cancels its task or closes its call. It also cancels a goal that it stops following before the goal ended: at a deadline, after a window of progress_timeout_ms without a sign of progress, at the TTL of a task, and when the unread feedback of the goal goes past its bound (see What a client sees). The call or the task then fails, and no goal runs on with no one following it. A goal on a member that moves a robot is the exception: the endpoint follows it on until it ends, and cancels it at a halt. The endpoint sends a goal one cancel at most.
Refused and failed calls
Section titled “Refused and failed calls”A provider that refuses a goal, fails a goal, or gives the error reply of a service, gives a failure kind and a message. The kind is a kind of peppy, which every provider can give, or a kind of the contract of the member that the member lists, such as unreachable of move_arm. A daemon interface declares its kinds the same way, such as busy of robot_membership:v1:
| Kind of peppy | Meaning |
|---|---|
attempt_failed | The attempt gave no result |
timeout | The bound of the provider passed |
precondition_failed | A precondition failed |
resource_unavailable | A robot, limb or host is gone |
rejected | The provider refused the goal, and no other kind says why |
In a call, the endpoint returns a tool error:
isErroristrue.- The one text says what happened, with the kind and the message:
the provider refused the goal: <kind>: <message>,the provider failed the goal: <kind>: <message>, orthe provider gave an error reply: <kind>: <message>. structuredContentholdsoutcome(refusedfor a refused goal, which never ran;failedfor a failed goal or an error reply),failure_kindandmessage. It is not in the tool’s output schema, which describes a result: readisErrorfirst.
{ "content": [ { "type": "text", "text": "the provider refused the goal: unreachable: no plan reaches the pose" } ], "structuredContent": { "outcome": "refused", "failure_kind": "unreachable", "message": "no plan reaches the pose" }, "isError": true}In a task, the task ends failed. Its error has the same text as its message and the same object as its data:
{ "code": -32603, "message": "the provider failed the goal: unreachable: no plan reaches the pose", "data": { "outcome": "failed", "failure_kind": "unreachable", "message": "no plan reaches the pose" }}A failed goal gives no result. The call record keeps the outcome, the kind and the message of the call.
A provider can give only a kind of peppy or of the contract of the member. A kind that neither declares is a fault of the provider: the call fails with a readable tool error that names the member and the kind, such as the action failed: the provider of `move_arm` gave the failure kind `melted`, which neither peppy nor the contract of the member declares, and with no structured content.
Cancelled goals
Section titled “Cancelled goals”A goal ends cancelled when the client cancels its task or closes its call, or when the provider cancels it for a reason of its own, for example because a newer goal replaced it or another client stopped the robot. In each case the provider ends the goal with a result and a reason.
In a call that is still open, the endpoint returns the result in a tool error:
isErroristrue, whatever the result says: the goal did not run to its end.- The first text says that the goal was cancelled and why:
the action was cancelled: <reason>, with the reason of the provider. structuredContentis the provider’s result, in the tool’s output schema, and the second text is the same result as JSON.
In a task, the task ends cancelled, which carries no result. Its status message is the same first text, followed by : and the provider’s result as JSON.
The call record keeps the reason as the message of the call.
What validation refuses
Section titled “What validation refuses”Validation reports every violation at once, so you can fix the document in one pass. It rejects an exposure when:
- A selected member does not exist in its contract or exists as a different kind. The error lists the contract’s members and points to the correct section when the name exists elsewhere.
- A message definition cannot be converted to a public schema.
- A representation role names a missing,
$optional, or wrongly typed member, of a topic’s message or of a service’s response. - A
restrictbound does not fit its member’s type, names a non-numeric member, or targets au64/i64. - A
max_result_bytesis smaller than a payload’s static maximum, or a topic with an unbounded payload omits the size policy. - An action with
progress_timeout_mshas nofeedback_topicin its contract. - A contract
sha256does not match the resolved document’s bytes. - A daemon target names an interface, or a tag of it, that this peppy does not serve. The error names the tag that this peppy serves, or the interfaces that it serves for an unknown name.
Parsing catches document-level errors before these checks. Examples include:
- An exposure with no targets or a target that selects no members.
- A target that names both
contractanddaemon, or neither. - A daemon target with a
sha256: a daemon interface is compiled into peppy and is never pinned. - A daemon target on a document with
robots: every tool of a per-robot surface is routed byrobot. - A public name claimed twice anywhere in the document, the names of picture tools and of the call record’s tool included, or a service or action member selected twice by one target.
- A target
argumenton a document withoutrobots, a targetargumentofrobot, adescribeentry naming a target the robot fills any number of times or a service its target does not select as a tool, or an argument name that is notsnake_case. - A blank
title,instructions, ordescriptionvalue. - An action that declares both or neither of
deadline_msandprogress_timeout_ms, or declaresprogress_timeout_mstogether withconfirmation_required. - A zero
deadline_msorprogress_timeout_ms, or amax_hzvalue that is not positive and finite. - A
qualityvalue on araworpng16representation. - A
depth_rangeon araworpng16representation, or one whosenearis 0 or not belowfar. on_oversizewithoutmax_result_bytes, on a topic or a service.downscalewithout ajpegorpng16representation, on a topic or a service.- A
call_recordwhosekeepis 0 or above 1000. - A
pictureon a topic whose representation ispng16orraw, or that has no representation. - A
restrictentry with neither bound, or withminabovemax.
What stays private
Section titled “What stays private”An exposure keeps everything else private:
- The MCP endpoint is not a bridge to the messaging layer. It cannot pass through arbitrary messages or access an internal member that the exposure did not select. For example, the running stack includes
finish_session, but the exposure does not publish it. - The catalog contains exactly the selected members.
tools/listandresources/listreturn only what is in the catalog. The endpoint rejects unknown names. - Endpoints served by one process are isolated from each other. A name, a subscription, or a task handle belongs to the endpoint it was created on.
- The endpoint binds to
127.0.0.1. It is available from another machine only if you deliberately configure network access.