Skip to content

Connect PHOS to an AI agent

Connect a compatible AI agent to PHOS through MCP to read available physical context and request supported actions. PHOS checks permissions, validates requests, and handles local execution. Its display and configured local behaviors also run when no external agent or model is connected.

What MCP does

The Model Context Protocol (MCP) lets an AI agent read available PHOS information and request supported actions from the PHOS MCP server, subject to permissions and runtime availability. The AI agent uses an MCP client to connect; that client may be built into the agent's application or supplied separately.

  • Resources are named, read-only views of current PHOS information.
  • Tools are named requests PHOS can validate and carry out if the agent has the required permission and the capability is available.
  • A change notification can tell the MCP client that a resource may have changed. The AI agent decides whether to read it again and what to do next.

PHOS remains responsible for physical inputs, local behavior, permission checks, request validation and supported output. The AI agent and MCP client do not receive direct access to GPIO, drivers or firmware.

flowchart TB
  user[User] --> agent[AI Agent]
  agent -->|Uses| client[MCP client]
  subgraph phos[PHOS]
    direction TB
    server[PHOS MCP Server]
    server -->|Validated supported requests| runtime[PHOS runtime]
    runtime -->|Available context| server
    sensors[Configured sensors and camera] --> runtime
    runtime --> outputs[Display and configured outputs]
    local[Local behavior] --> runtime
  end
  client <-->|MCP| server

  classDef phos fill:#0F4C5C,stroke:#49E7FF,color:#fff
  classDef agent fill:#5B21B6,stroke:#C4B5FD,color:#fff
  classDef protocol fill:#312E81,stroke:#818CF8,color:#fff
  classDef hardware fill:#334155,stroke:#94A3B8,color:#fff
  classDef interface fill:#1E40AF,stroke:#60A5FA,color:#fff
  class user interface
  class agent agent
  class client protocol
  class server,runtime,local phos
  class sensors,outputs hardware
  linkStyle 7 stroke:#818CF8,stroke-width:2px
  style phos fill:#0F4C5C,stroke:#49E7FF,stroke-width:3px,stroke-dasharray: 8 4

Ask PHOS or request an action

An agent can only use interfaces PHOS actually exposes. phos_get_status is a good first read and does not require optional sensors. phos_get_physical_context reports available semantic context with availability and freshness. A missing sensor, camera, model or external measurement can mean that part of the context is unavailable. PHOS can also acquire sensor measurements from MQTT or ESPHome and expose them through MCP when the provider is configured and each source mapping is authorized. ESPHome can connect through MQTT or directly through its encrypted Native API; see the Native API user guide for that separate device workflow. For the user workflow to connect an external MQTT sensor and verify its observation here, see External Devices — MQTT & ESPHome.

An agent with the standard profile can request a supported expression such as curious, a bounded thinking visual, speech, sleep/wake, or a supported transient user signal. PHOS still validates the request. An accepted tool result means PHOS accepted the semantic request; it does not prove a person saw an expression or heard audio.

Agent capability summary

The observer profile can read status, physical context and perception semantics. The standard profile includes those reads, history, camera access and all currently defined action permissions. Profiles are fixed, broad groups; the Web Admin does not let an administrator construct arbitrary per-tool permission sets. Tool discovery by itself never grants permission.

Agent capability PHOS hardware requirements Configuration requirements Permission requirements Implementation evidence Limitations
Read PHOS status None beyond a running PHOS runtime MCP listener enabled and reachable observer or standard phos_get_status, phos://status; AgentApplicationService.status Reports PHOS state and capability availability, not proof every device is healthy.
Read physical context and environment None for the endpoint; optional sources determine which values exist Configure supported sensors/providers; separately authorize external measurement mappings observer or standard phos_get_physical_context, phos://physical-context, phos://environment Missing, stale or unavailable sources are not fabricated. External observations have their own mapping authorization.
Read presence, attention, observed expressions, or on-demand object labels Supported camera for camera-derived data Enable Vision; object labels also need configured local model observer or standard (read_perception) phos_get_presence, phos_get_attention, phos_get_observed_expression, phos_get_visible_objects Anonymous observations only; no identity or reliable claim about internal emotion. Object labels are on-demand.
Read retained physical evidence/history Supported PHOS sensor sources for measurements Retained evidence is bounded and in memory standard (read_physical_history) phos_get_physical_assessment, phos_query_measurements, phos_list_physical_transitions Lost on restart; external MQTT/ESPHome observations are current-only and not in this history.
Read a camera image Supported configured camera and active Vision pipeline Vision/camera must be available standard (read_camera_snapshot) phos_get_camera_snapshot, phos_capture_camera_snapshot, phos://vision/snapshot Image contains what the camera sees; snapshots are not change-notified.
Request a PHOS expression or thinking visual Running display MCP available standard (control_expression, control_visual_state) phos_set_expression, phos_set_state Expressions share local output arbitration; thinking visuals are bounded and agent-owned.
Request speech Audio output hardware TTS and audio playback enabled and available standard (control_voice) phos_speak Unavailable TTS/output can reject the request; MCP does not add a speaker or provider.
Request sleep/wake Running PHOS display/runtime MCP available standard (control_sleep) phos_sleep, phos_wake Changes PHOS robot state and may override other visuals.
Request a user signal Compatible enabled external controller and advertised output capability Controller and signal output configured standard (signal_user) phos_signal_user Physical signal may be unavailable without its controller/output.

These are MCP operations, not a promise that every client displays every kind of result. See the technical MCP reference for exact resource and tool contracts.

Tool and Resource Catalog

For a new integration, begin with a status read and a physical-context read, then request only the action needed. The principal user-facing interfaces are:

Purpose Examples
Status and context phos_get_status, phos_get_physical_context, phos://status, phos://physical-context
Optional physical data phos://environment, phos_get_presence, phos_get_attention, phos_get_observed_expression
Bounded physical evidence phos_get_physical_assessment, phos_query_measurements, phos_list_physical_transitions
Vision phos_get_visible_objects, phos_get_camera_snapshot, phos_capture_camera_snapshot, phos://vision/snapshot
Supported actions phos_set_expression, phos_set_state, phos_speak, phos_sleep, phos_wake, phos_signal_user

The full arguments, access requirements, availability errors and limits belong to the MCP protocol reference, not this guide.

Connect an AI agent

PHOS provides an MCP server over Streamable HTTP. In Web Admin, open Settings → Network → MCP, enable the listener if needed, and use the displayed endpoint and any required PHOS credentials to configure the AI agent's MCP integration. The default endpoint is http://127.0.0.1:8001/mcp; it is reachable from the PHOS computer, not directly from another computer or a cloud-hosted AI service.

For remote access, arrange and secure a network route separately. PHOS does not provide a cloud relay. If the AI agent's integration requires stdio, the separately maintained phos-mcp-bridge can translate stdio to PHOS's HTTP endpoint when the bridge can reach it.

The AI agent's MCP integration must support PHOS's transport and authentication; its available actions also depend on permissions and configured hardware or services. Follow Connect your first MCP client for a step-by-step setup, and see the MCP technical reference for exact transport, authentication, and compatibility details.

React to changes

On-demand interaction means a user or external workflow asks its MCP host to read PHOS and decide whether to call a tool. For supported asynchronous interaction, a client can listen for selected resource-change cues. PHOS sends a URI-only cue; the client reads that resource again. The cue does not contain the new measurement and does not invoke an AI model.

The implemented cue mechanism supports selected status, physical-context, environment and assessment changes. Numeric sample changes alone do not necessarily cause a cue. Notifications are best-effort, may be coalesced, and have no history or replay. After a disconnect, client/host logic must reconnect, listen again and read current state. The snapshot resource has no change cue.

flowchart TD
  subgraph on_demand[On-demand]
    user[User or workflow] --> host[AI Agent decides to use  PHOS]
    host --> client[MCP client invoke PHOS tools/resources]
    client -.->|Read / action request| phos[PHOS MCP Server validates request]
    phos -->|Current resource data / result| client
  end
  subgraph event[Event-driven cue]
    change[PHOS context changes] -.->|URI-only notification| cue[Client receives resource cue]
    cue --> reread[Client reads resource again]
    reread --> decision[Host decides whether to invoke model]
  end
  classDef phos fill:#0F4C5C,stroke:#49E7FF,color:#fff
  classDef agent fill:#5B21B6,stroke:#C4B5FD,color:#fff
  classDef protocol fill:#312E81,stroke:#818CF8,color:#fff
  classDef interface fill:#1E40AF,stroke:#60A5FA,color:#fff
  class user interface
  class decision agent
  class host,client,cue,reread protocol
  class phos,change phos

Security limitation: PHOS authenticates subscription requests, but currently does not check read permission for each URI in the subscription filter. A client may learn that a protected resource changed without permission to read its contents. Resource reads themselves still require permission. Until this is addressed, grant endpoint access only to trusted clients and do not treat URI subscriptions as per-resource confidentiality boundaries. This limitation is also recorded in the Step 08 audit report.

See event and resource details for the complete technical contract.

Multiple agents and controlled access

You can register separate PHOS identities with separate bearer credentials and select the built-in observer or standard profile for each. Multiple clients can connect to one PHOS runtime concurrently; they share the same physical display, speaker and controller outputs. Separate credentials do not create separate robots or coordinate the agents' reasoning. The external host or application must coordinate its own workflows.

flowchart TD
  agent_a[External AI agent A / model] --> host_a[MCP host A] --> client_a[MCP client A]
  agent_b[External AI agent B / model] --> host_b[MCP host B] --> client_b[MCP client B]
  client_a -.->|Identity A: permitted request| server[PHOS MCP server]
  client_b -.->|Identity B: permitted request| server
  server -->|Authorized results / resources| client_a
  server -->|Authorized results / resources| client_b
  server --> permissions[Identity-scoped permission checks]
  permissions --> runtime[One PHOS runtime and output arbitration]
  runtime --> outputs[Shared display / speaker / controller]
  classDef phos fill:#0F4C5C,stroke:#49E7FF,color:#fff
  classDef agent fill:#5B21B6,stroke:#C4B5FD,color:#fff
  classDef protocol fill:#312E81,stroke:#818CF8,color:#fff
  classDef hardware fill:#334155,stroke:#94A3B8,color:#fff
  class agent_a,agent_b agent
  class host_a,host_b,client_a,client_b protocol
  class server,permissions,runtime phos
  class outputs hardware

The two colored agent nodes represent external reasoning systems. The host and client nodes are their transport roles; they do not directly own the shared physical outputs. Labels and arrow text carry the identity and permission meaning independently of color.

observer is limited to semantic status, context and perception reads. standard includes the currently defined history, camera and action permissions. PHOS checks the profile for each tool/resource access, then checks capability and runtime availability. A permitted request can still fail if a sensor or output is unavailable.

For thinking visuals, each authenticated agent owns a bounded lease and can release only its own lease. Local states such as error, sleeping, speaking and listening retain priority. Other outputs follow PHOS's local rules; there is no general action queue, exclusive per-agent output, or orchestration guarantee. When Follow Active Agent appearance is configured, eligible agent skins can be selected by activity, priority and timeout, with global appearance as the fallback. This affects the chosen appearance, not MCP authorization.

Disconnecting a client does not stop PHOS standalone operation. It also does not promise to cancel or reverse an action already accepted. Thinking visuals are time-bounded; other requests follow their own runtime behavior. The bridge does not retry a tool call when its response is lost: inspect PHOS state before deciding whether to submit another action. Subscription cues missed while disconnected are not replayed.

Use Settings → Agents to manage identities, profiles and bearer credentials. See the technical reference for authentication modes, permission enforcement and runtime details.

Practical ways to use MCP

See agent use cases for short examples with prerequisites, separate PHOS/agent responsibilities, expected results and limitations. The examples cover status plus expression, optional environmental context, presence change cues, speech output and multiple agents. They have not been claimed as physical hardware tests.

Get started

Follow Connect your first MCP client for the canonical, task-oriented setup and first interaction. Read the MCP reference for endpoint, authentication, permissions, exact arguments, errors and protocol behavior.