Skip to main content
On this page

MCP

Piping exposes a token-scoped Model Context Protocol endpoint for agents that need to inspect inventory, call allowed REST operations, and operate supported connection-target sessions.

Endpoint

Use JSON-RPC over:

/api/v1/mcp

Authentication is a personal API token in the Authorization: Bearer <token> header. Browser cookies are not accepted by the MCP endpoint.

Agents should start with:

  1. initialize
  2. tools/call with piping.mcp.capabilities
  3. resources/list
  4. resources/read for piping://mcp/tools or an entity manifest

Client Configuration

Configure your MCP client with the endpoint URL and a Bearer token header. Example for Hermes:

{
  "mcpServers": {
    "piping": {
      "url": "/api/v1/mcp",
      "headers": { "Authorization": "Bearer <token>" }
    }
  }
}

Replace /api/v1/mcp with your full origin URL (e.g. https://your-piping-host/api/v1/mcp) and <token> with a personal API token created in User settings. Scope semantics are described in Access control.

Capabilities

piping.mcp.capabilities returns the current token's visible tools, typed resource URIs, limits, API token scopes, and safety notes.

MCP resources are read-only manifests:

URIPurpose
piping://mcp/capabilitiesSame capability document as the tool
piping://mcp/toolsVisible tool descriptors
piping://access-control/scope-catalogSupported API-token action/resource pairs
piping://inventory/entitiesVisible inventory entity manifests
piping://access-control/entitiesVisible access-control entity manifests

Entity resources are hidden unless the token can access that entity through the same scope checks used by tools.

Tool Groups

GroupNotes
MCPCapability discovery
Scoped RESTTyped per-operation tools over the operational REST domains, plus the shared REST catalog
InventoryTyped CRUD over allowed inventory entities
Access controlUsers, groups, roles, policies, and grants
SSHInteractive PTY, bounded exec, and cursor-based reads
Target diagnosticsFixed SSH-backed templates for inspect, port check, safe file read, and log discovery
MonitoringCurated REST operations over monitoring configuration — exporters, query sources, metric queries and sets, service discovery — plus latest values and metric-history ranges for a target, so an agent pulls time-series data through the same access + audit path as human operators (see Observability)
CCTVCurated REST operations over a camera or recorder, plus three dedicated media tools for snapshots, archive playback, and clip export (see CCTV)
VNC observeScreen capture; requires observe scope
VNC controlVNC session lifecycle plus input. Open/close require session access; pointer/key/text additionally require execute scope
Visual credentialsShort-lived client credentials for a VNC or RDP session; requires connect + secret for the target

These rows group tools by purpose. In audit, piping.rest.* tools record tool_group: rest, while first-class domain tools record their domain, such as monitoring or connections. Dedicated CCTV media tools record cctv.

Agents discover callable REST operations with piping.rest.list_allowed_endpoints and invoke them with piping.rest.call_endpoint; the underlying contract is the same control plane documented in the API reference.

Production domains also expose one first-class tool per operation, named piping.<domain>.<operation> — playbooks and Ansible projects, monitoring, settings, license, secrets, backup, connections, audit, webhooks, providers, and synchronization. The tool name fixes the method and path, the arguments follow the operation's OpenAPI schema, and visibility still follows the token scopes.

piping.rest.call_api is not exposed. Operations without explicit authority metadata do not receive generated permissions.

piping.rest.list_allowed_endpoints includes each operation's authority. token_scopes requires all listed action/resource pairs for the resolved resource. Query-dependent and body-dependent operations select their scope from the actual arguments. An item-pinned grant cannot satisfy an operation that requires an unscoped collection grant. An authenticated_owner authority is limited to read-only metadata for an authenticated identity.

An authorization status of deferred means that arguments, object attributes or ownership must be checked at call time. The REST handler remains responsible for its policy checks; a catalog entry is not an authorization grant.

Account token issuance, personal credential sets and password changes are not MCP operations. Manage them in User settings. Run-bound ingest callbacks, including collected facts and discovery reports, also stay outside the user/PAT catalog.

The same account-credential boundary applies to generic secret-field operations: user_connection_credential_set and user_auth_password consumers are rejected. For supported consumers, the secret-field authority depends on the requested consumer and intent; a mutation grant does not authorize a reveal.

The shared REST dispatcher sends JSON, so session file upload (multipart/form-data) is not advertised as a JSON tool. Use the session's file interface until a dedicated upload transport is available.

RDP observe/control is not exposed through MCP today. RDP remains available through the browser session path.

CCTV tools

Call thirteen single-target CCTV operations (capabilities, channels, device info, disk, recording state, archive search, PTZ and on-device users) and three fleet-wide device-user operations through piping.rest.call_endpoint. These operations have no separate entries in tools/list.

Three media operations are dedicated tools instead, because their responses are binary rather than JSON:

ToolRequiresReturns
piping.connection_target.cctv_snapshotcctv:viewA short-lived MCP resource_link to one JPEG frame, capped at 8 MiB
piping.connection_target.cctv_playbackcctv:recordingsA descriptor for a streamed fragmented MP4 of recorded footage
piping.connection_target.cctv_exportcctv:exportA descriptor for a streamed binary download of the same footage

Each tool appears in tools/list when the token has the matching scope. Each call also checks the resource pattern and per-target RBAC permissions. Playback and export require separate grants.

The four CCTV media paths (snapshot, stream, playback, export) are excluded from the REST catalog: a binary body would be parsed as JSON, and a streaming call would hold a media slot for a caller that cannot consume it. Use the dedicated tools instead.

Scope Rules

Each scope entry is action:resource_type plus an optional resource pattern. The pattern controls which objects are matched:

  • * — every object of that resource type (a scope without an explicit pattern defaults to all).
  • connection_target:<id> (or a bare UUID) — one specific object. The in-app token dialog lets you pick the object by name; the stored pattern is connection_target:<id>.
  • re:<regex> — an anchored regular expression matched against the whole resource id. Policy resource patterns are validated when the policy is saved; token scope patterns are not, so an expression the engine cannot compile is stored and then matches nothing.

Interactive session creation requires both connect:connection_target and secret:connection_target for the concrete target. SSH execution tools also require execute:connection_target.

CCTV reverses the order: its scopes read cctv:<operation> — cctv:view, cctv:recordings, cctv:export, cctv:users, cctv:settings, cctv:ptz — not view:cctv. The matching resource id is cctv:<target-id>, so a camera-specific pattern is cctv:<target-id> (a bare UUID also matches).

Examples:

Use caseScopes
Read inventory entity manifestsread:inventory with pattern inventory_entity:<entity>
SSH diagnostics on all targetsexecute:connection_target, connect:connection_target, secret:connection_target (pattern *)
SSH diagnostics on one targetthe same three scopes with pattern connection_target:<id>
VNC captureobserve:connection_target, connect:connection_target, secret:connection_target
VNC input controlexecute:connection_target, connect:connection_target, secret:connection_target
Watch a camera and its archivecctv:view, cctv:recordings (pattern * or cctv:<target-id>)
Export footage from one cameracctv:export with pattern cctv:<target-id>
Scoped REST operationThe operation's declared authority and matching resource pattern

SSH Response Modes

Terminal read tools accept response_mode:

ModeResponse
fullLegacy shape: metadata, chunks, and combined_text
combinedMetadata plus combined_text only
chunksMetadata plus chunks only
metadataCursor and status metadata only

strip_ansi is optional and defaults to false.

Audit

Every MCP tool call records an mcp.tool.invoked audit event with structured metadata:

  • tool
  • tool_group
  • protocol
  • risk
  • decision
  • resource_type
  • resource_id

The audit log UI exposes typed filters for these fields.