Quick Start
Targets and Selectors
app.target(name, target)
Registers a reusable logical target. cloud is built in and reserved.
edge(options)
Creates an edge target with a device selector and optional pool strategy.
Selectors:
edge.sessionDevice()edge.userDefaultDevice()edge.namedDevice(alias)edge.pool(name)selector.or(fallback)
least-loaded, round-robin, and random.
.target(name)
Available on global, group, and user MCP handles:
app.user(id) records subject-scoped configuration. It does not create or authenticate an identity.
Runtime Inputs and Setup
Useruntime.input(name) for local/scalar values and runtime.secret(name) for secrets.
Setup builders:
edge.folder({ access })edge.file({ access })edge.secret()edge.string()edge.boolean()edge.number({ min, max })edge.select({ options })
EDGE_UNRESOLVED_RUNTIME_INPUT. StdioTransportOptions.runtimeValues can provide explicit cloud-side string values.
Managed Installation
edge.install provides builders for nodePackage, python, binary, container, custom, and manual providers. Every recipe is canonicalized and digest-addressed. Use installedArtifact(recipe, outputName) in a launch recipe so the agent starts only a declared, verified output.
Custom sources support exact Git commits, integrity-bound archives, bounded inline content, locally approved grants, and enterprise resolvers. InstallationProviderAdapter, InstallationSourceResolver, store, mutation-lock, approval, verification, and telemetry contracts are replaceable. The default local coordinator persists attempts, lifecycle, active pointers, retention references, and approvals before reporting success.
EdgeInstallationTelemetry emits redacted source, approval, attempt, verification, activation, rollback, and cleanup events. edgeInstallationHealth(...) adds checks for interrupted attempts, stale lifecycle, storage pressure, isolation support, orphaned artifacts, and agent upgrade requirements.
Core Runtime Adapters
McpProxyOptions.edge accepts:
deviceResolversessionBindingStoresessionBindingExpirysessionBindingListenertransportcapabilityCachetelemetrysessionSelectionStorechildBindingManagercontrol
EdgeTransport, EdgeWebSocketGateway, InMemorySessionBindingStore, control-plane stores, and EdgeCapabilityCache.
Integrated Control Plane
SetMcpProxyOptions.edge.controlPlane to let app.start() own device authorization, enrollment, the WebSocket gateway, desired-state planning, reconciliation, inventory reports, capability publication, health, and shutdown.
basePath (default /_fentaris/edge): device authorization and polling, refresh, enrollment, self-revocation, verification, and /ws. URLs are derived only from publicOrigin, never request host or forwarded headers. Non-loopback deployments require HTTPS/WSS.
Dispatch is allowed only when authorization, assignment, connection generation, desired recipe, readiness, and manifest support all agree. Ambiguous or incomplete deployments are withheld with bounded diagnostics. Revocation removes desired state, rotates or invalidates credentials, evicts capability state, and terminates the active generation.
Health exposes only bounded counts and redacted component status. A local runtime is reported degraded with a single-process warning; an unavailable required managed adapter is an unhealthy startup failure.
Edge Control configuration
edge.control is explicit opt-in configuration. It requires the policy-filtered EdgeInventoryService and EdgeSessionSelectionService used by the control plane.
edge is reserved. Individual tools remain hidden or denied unless effective policy allows them.
Edge Control result contracts
Discovery uses public{ name, inventoryVersion } references. edge__call returns the selected public device, a server-generated correlation ID, a terminal status, and the sanitized MCP result. edge__call_many returns stable counts and exactly one succeeded, failed, cancelled, or not-started entry per resolved device.
Explicit input order is preserved. Declarative results are ordered by normalized public name. User limits can only reduce configured limits.
Agent APIs
@fentaris/edge exports:
EdgeAgentandEdgeEnrollmentServiceLocalSetupManagerandTerminalSetupProviderEdgeWorkloadSupervisorExecutableAllowlistPolicy- platform, credential, process, and connection adapter contracts
{ deployment, downstream session }.
Protocol Compatibility
EDGE_PROTOCOL_VERSION is 3; EDGE_MCP_ENVELOPE_VERSION remains 1. Hello negotiates the highest mutually supported protocol version. Version 1 agents retain transparent Edge execution, version 2 adds bounded observed facts and orchestration correlation, and version 3 adds managed-installation desired state, lifecycle, approval, retry, removal, installation digest, and launch digest correlation. Every accepted connection is bound to tenant, edge node, credential, protocol version, and a monotonically increasing connection generation.
Messages cover hello, heartbeat, desired state, setup status, capability manifests, lifecycle, MCP requests/results/errors, and cancellation.
Servers must reject routing claims that do not match server-side device, deployment, subject, target, and session state.
Roll out the control plane first, then proxies, then upgrade agents. The gateway negotiates the highest mutual version, so v1, v2, and v3 agents can coexist. To roll back, stop assigning managed-installation recipes, disable
edge.control and new selectors, then roll back agents. Transparent legacy routing continues. Do not downgrade stored identity, inventory, installation, or approval records during rollback.
The fentaris-edge compatibility commands remain available during the migration window and map to the new services with warnings. New automation should use fentaris edge. A future major release may remove the legacy command names after a documented deprecation period.
Stateful failover and automatic mutation retry are not supported. Lost non-idempotent calls are reported as indeterminate and are never automatically replayed.
Errors
Stable edge codes:EDGE_PLACEMENT_AMBIGUOUSEDGE_UNAUTHORIZED_TARGETEDGE_SETUP_REQUIREDEDGE_UNAVAILABLEEDGE_CAPACITYEDGE_SESSION_PINNEDEDGE_INPUT_INVALIDEDGE_INVENTORY_CONFLICTEDGE_NAME_CONFLICTEDGE_PROTOCOLEDGE_WORKLOADEDGE_GRANTEDGE_UNRESOLVED_RUNTIME_INPUT
Events and Health
EdgeTelemetry emits structured redacted events for target resolution, session binding, connection generations, desired-state reconciliation, setup, workloads, request duration, timeout, cancellation, failure, and parent/child orchestration lifecycle.
edgeHealth(...) adds checks for gateway, target resolution, device/pool availability, deployment readiness, capability cache age, inventory stores, presence expiry, selections, child cleanup, distributed routing, protocol distribution, and stale readiness.
Sensitive metadata is removed by redactEdgeProtocolValue(...) before telemetry reaches its sink. serializeEdgePublicValue(...) additionally bounds depth, collection size, string length, circular references, and encoded bytes.
Managed adapters can implement EdgePoolSelectionStore and EdgeResultCorrelationStore. Use diagnoseEdgeProductionAdapters(...) before production rollout. EDGE_DISTRIBUTED_CONSISTENCY_REQUIREMENTS documents the required compare-and-set, atomic-take, expiry, pool-selection, and channel-delivery semantics.