Skip to content

Connect your first MCP client

This guide is for an already running PHOS device. It uses PHOS's Streamable HTTP MCP server and a read followed by a supported expression request. The example needs a running PHOS display, but no camera, sensor, microphone, speaker, ESP32 or Internet connection.

Before you connect

  1. Check the MCP listener. In Web Admin, open Settings → Network → MCP. Confirm that the listener says Running and note the endpoint shown there. The default configuration is http://127.0.0.1:8001/mcp; 127.0.0.1 is reachable only from the PHOS host itself. The Web Admin page can enable/disable MCP and change its port; the host and /mcp path are not editable there.
  2. Create an agent. Open Settings → Agents. Create a dedicated agent with an immutable Agent ID and a display name. Choose observer for read-only access or standard if the agent must also request an expression. Profiles are fixed groups; Standard includes all currently defined action permissions.
  3. Create a credential. After creating the agent, select Create credential in its row. Copy and store the bearer securely when PHOS displays it. PHOS shows it once and cannot reveal it later. If it is lost, rotate it and update the client.
  4. Choose a client route. Do not copy a real credential into this guide, a URL, a command-line argument, source control or an ordinary chat message.

If the MCP listener is not running, check its displayed status and the PHOS runtime status first. For listener and authentication configuration details, see the MCP reference.

Choose a client route

Use a client that supports Streamable HTTP and can store the PHOS bearer securely. The default endpoint works directly only for a client running on the same host as PHOS. A client on another computer cannot reach the default loopback address directly; the repository's technical guide documents an operator-managed SSH forwarding example. Do not expose the private MCP endpoint to the public Internet.

If your compatible MCP host supports only local stdio, the separately maintained phos-mcp-bridge is documented as an adapter. It requires Node.js 20+ and the bridge computer must be able to reach the PHOS endpoint. Use the bridge project's own instructions for its client setup and use its documented PHOS_MCP_TOKEN secret mechanism. The bridge is outside this repository; neither it nor a named third-party client was independently validated for this guide.

The server's Streamable HTTP path is covered by PHOS's automated MCP SDK integration tests. That verifies the PHOS endpoint and server contract, not compatibility with every client product. See the connection-method matrix.

First interaction

  1. In the client, discover the PHOS tools and resources. A successful discovery means the client reached the MCP endpoint; it does not grant permission to use every tool.
  2. Ask the client to read phos://status or call phos_get_status and summarize the reported state and capability availability.
  3. Expected result: the client receives PHOS's current semantic status. Values vary with the running device and optional hardware; the read itself needs no optional sensor.
  4. If you assigned standard, ask the client to call phos_set_expression with curious.
  5. Expected result: PHOS returns the semantic tool result and, if the display is active, the requested expression can be observed on it. Local state and visual arbitration still apply; this is not physical validation evidence.

For read-only access, keep the agent on observer and stop after status or context reads. Change to standard only when its broader action permissions are needed. A valid tool name in discovery does not mean the profile permits its use.

Configure and manage an agent

The Settings → Agents page supports these operations:

  1. Create agent adds an Agent ID, display name and one of the built-in profiles. The ID is immutable. Optional appearance assignment is separate from identity and permissions.
  2. Edit agent changes its display name, profile and optional appearance settings. Identity/profile changes apply to subsequent MCP requests without a PHOS restart.
  3. Create credential or Rotate credential issues a bearer shown once. Rotation invalidates the previous bearer immediately; the client must be updated with the new value.
  4. Revoke credential stops that credential from authenticating while retaining the agent identity and profile. Revocation requires confirmation.
  5. Delete agent removes a non-default identity and its credential, after confirmation. Select another default before deleting the current default.

There is no per-agent enable/disable toggle and no custom permission editor. Use revocation to block a credential. Registry and credential changes take effect without reloading or restarting PHOS. See the full Agent management procedure for Web Admin labels and credential handling.

Authentication note

The supplied configuration selects Bearer Token Only and binds the listener to loopback. On a clean configuration with no credential references, PHOS retains a compatibility path that resolves the configured default agent; this is not an independently authenticated client identity. Creating a credential-backed agent establishes request identity. Once credential references exist, every request must provide a valid bearer. Do not rely on the compatibility behavior for a network-reachable listener. The MCP settings page warns that No Authentication or Mixed Authentication allows anonymous use according to the selected profile. The supplied configuration selects standard for anonymous access, so either mode can allow any reachable client to request the full currently permitted action set. Keep Bearer Token Only unless anonymous access is deliberate and appropriately restricted.

On-demand and event-driven use

An on-demand request happens when a user or workflow asks the MCP host to read PHOS and decide what to do. Optionally, a client with the implemented subscriptions/listen support can listen for selected resource-change cues. After a URI-only cue, it must read that resource again. The host—not PHOS—decides whether to invoke the AI model. Cues are best-effort, have no replay, and do not include measurement values. See React to changes for the user-level behavior and the technical contract for details.

Troubleshooting

Symptom Check Expected result
Client cannot connect In Settings → Network → MCP, confirm Running and copy the displayed endpoint. Check whether the client is on the PHOS host; loopback is local-only. Check the client's Streamable HTTP support. The client completes MCP initialization and can discover PHOS capabilities.
Authentication rejected Confirm Bearer Token Only mode, that the agent credential is active, and that the client securely supplies the current token. Rotate a lost or exposed token and update the client. A valid bearer identifies the configured agent; invalid/missing bearer is rejected when credentials are configured.
Permission denied Check the selected profile. Observer is read-only; actions and camera snapshots require Standard. A permitted status read works for Observer; a permitted Standard action is accepted only if its capability is available.
A resource value is unavailable or stale Check PHOS Status and Sensors. Confirm optional hardware/provider settings and freshness in the relevant guide. PHOS returns current available context or an explicit unavailable/stale state; it does not invent a value.
A tool is missing or unsupported Confirm the client connected to the PHOS /mcp endpoint and inspect its discovered tools. Check the capability table and profile. The server exposes its supported tools; a listed tool may still reject an unauthorized or unavailable request.
Expression does not remain visible Check PHOS robot state, current visual source and the expected temporary local reaction. Local state/arbitration may take priority or return the display to its configured source.
Speech request fails Check Standard permissions, Voice & Speech TTS/audio availability, provider credentials and output device. phos_speak is accepted only when the configured speech path is available; PHOS does not provide missing audio hardware.
A resource cue does not make the agent answer Confirm the client supports the subscription mechanism and is listening. The host must read the resource and decide whether to call the model. A cue only signals a possible resource change. It never invokes AI reasoning by itself.

If a client loses its connection after calling a physical action, do not assume the action failed. Check PHOS status before manually retrying; the bridge does not automatically replay tool calls. Do not bypass an authentication or permission error. See the technical MCP reference for detailed error and credential behavior.

Limitations

No named commercial MCP client is certified by this guide. The technical MCP page includes examples for client products and remote routes, but those examples are not proof of product compatibility or a PHOS-managed remote-access service. The default private listener is not reachable from a cloud-hosted agent by itself. Remote network setup requires a separately secured, supported route.

PHOS local operation continues without the external host or model. MCP does not make PHOS a general conversational agent or an autonomous event orchestrator.