Connect an AI client

Connect an MCP client that accepts a custom bearer header. Use the Phoenix endpoint and one scoped token.

Choose the shortest setup for you

  • First token: follow the guided quick start to grant one device and test it.
  • No external client: use Agent Chat inside Home Assistant with the same scope and approvals.

Claude compatibility

Claude Code works directly. Claude's hosted custom connector also works when your organization has Anthropic's limited Request headers beta.

Claude clientStatusWhat to do
Claude CodeSupportedUse the generated claude mcp add command. It sends the token in the Authorization header.
Claude web, Desktop remote connectors, mobile, and CoworkLimited betaAn organization owner must add the connector with a required Authorization request header. If the dialog has no Request headers section, use Claude Code or Agent Chat.
What changed in Claude's connector flow
  • Claude now uses one hosted remote-connector system across the web app, Desktop, mobile apps, and Cowork. Connections originate from Anthropic's cloud, so the MCP endpoint must be public.
  • Personal plans add connectors under Customize > Connectors. Team and Enterprise owners add them for the organization before members connect.
  • Users can control connector access and individual tool permissions.
  • Request header authentication is a limited organization beta. In the two-step dialog, choose Authentication: None, add a required Authorization header, and enter the full value Bearer phx_your_token_here.
  • The token is shared by everyone in the organization who uses the connector. Create a dedicated least-privilege Phoenix token for this connector.
  • Do not put the token in the connector URL. Claude sends request-header values exactly as entered and does not add the Bearer prefix for you.

See Anthropic's remote connector setup and connector authentication documentation.

The five steps

Create a token

In the Phoenix MCP panel, open the Tokens tab and click Create Token. Give it a name like claude-code and create it.

Copy it now

The token value is shown exactly once and cannot be retrieved later. Copy it before you close the dialog.

Set its permissions

A new token has no access by default. Use the permission tree to grant the domains, devices, and entities you want the client to work with, and enable any capability flags it needs.

How the permission tree works

Add the MCP server

Run this in your terminal, substituting your Home Assistant address and the token you copied. Phoenix MCP derives a distinct server name from each token's name (phx-<token-name>), so a token named claude-code registers as phx-claude-code.

claude mcp add --transport http phx-claude-code \
  http://your-ha-address:8123/api/phoenix-mcp \
  --header "Authorization: Bearer phx_your_token_here"

If you reach Home Assistant through Nabu Casa or a custom domain, use that URL instead.

claude mcp add --transport http phx-claude-code \
  https://your-instance.ui.nabu.casa/api/phoenix-mcp \
  --header "Authorization: Bearer phx_your_token_here"

This example uses Claude Code's CLI. For Cursor, Codex, Gemini CLI, or another compatible MCP client, the panel's Connect step generates the command or config and links to that client's setup guide. The client must support the endpoint ending in /api/phoenix-mcp and an Authorization: Bearer header carrying your token.

Verify the connection

Start a new Claude Code session and run /mcp. The phx-<token-name> server should show as connected. Ask the client to list your entities or check a light to confirm.

Adding more tokens as separate profiles

Because each token gets its own server name, you can keep several configured in one client at once, one entry per token, all pointing at the same Phoenix MCP URL with a different bearer token each. To add another, create a second token in the panel, and on the screen shown after it is created choose Connect to an Agent… and run the command it shows, the same way you did for the first. Switch between them by toggling which entry is enabled in the client (in Claude Code, /mcp) instead of clearing and retyping credentials. Enable only one phx-* server at a time: enabling several gives your agent duplicate Home Assistant toolsets with different permissions.

Save each token's command when you first see it

Phoenix MCP stores only a hash of a token's value, so the panel cannot show a token's config again after you close its creation (or rotation) dialog. If you lose it, rotate the token to get a fresh value and command.

The agent skill optional

You do not have to brief the client yourself. On connection, Phoenix MCP already sends it a short, token-aware primer (see below) that links to the full guide it can fetch on demand. Installing the skill is an optional extra that loads the complete guidance from the first turn.

Install the optional agent skill

The agent skill

The skill is a usage guide for the connected AI. You get it two ways, and you do not have to choose; the primer always ships, the installed skill is extra.

Automatic primer

Phoenix MCP sends a short, token-aware primer in the legacy initialize response and in modern server/discover. It names which of this token's capabilities are approval-gated and links to the full guide. Legacy 2025-03-26 clients complete initialization and keep their session ID; modern 2026-07-28 clients carry protocol metadata on each request and use no session. No install, nothing to maintain.

Installed skill

The full guide is served, unauthenticated, at /api/phoenix-mcp/skill. The Connect step in the panel shows a per-agent install command. For Claude Code it installs as a real skill.

mkdir -p ~/.claude/skills/phoenix && \
  curl -fsSL http://your-ha-address:8123/api/phoenix-mcp/skill \
  -o ~/.claude/skills/phoenix/SKILL.md

Other agents (Cursor, Codex, Gemini CLI, and so on) download the same guide and reference it from their project rules or context file; the panel shows the exact path per agent. The guide is generic and contains no token or entity data.

Skill and reconnect rules

  • The skill is advisory: permissions, approvals, and MESA enforce access even if the client ignores its guidance.
  • Reconnect after the visible tool set changes: reconnect after changing a capability between deny and allow/confirm, changing write scope, or changing announce_all_tools. In Claude Code, open /mcp and select Reconnect.
  • No reconnect for approval mode alone: changing allow to confirm, or back, takes effect on the next call. Some clients may still cache metadata.
Connect Home Assistant Assist or voice

Use with Home Assistant Assist and voice

Besides external MCP clients and Agent Chat, you can put Phoenix MCP behind Home Assistant's own Assist, so a voice or chat conversation runs through one token's scope, MESA safety, approvals, and audit instead of the unscoped default assistant. There are two ways to do this; pick whichever fits. For generating data inside automations rather than driving a conversation, see AI Task below.

Option A: bring your own model

Phoenix MCP registers a control API named Phoenix MCP (scoped) that hands its scoped tools to a model an LLM conversation integration already supplies (OpenAI, Google, Anthropic, Ollama, and so on). Requires Home Assistant 2025.2 or later, which is also the integration's own minimum.

  1. In the Phoenix MCP panel, open Settings > Assist Tool Provider and choose the Bound token. Only one token can be bound at a time; a least-privilege token (for example the Voice Assistant persona) is recommended.
  2. In your LLM conversation integration (Settings > Devices & Services), set its Control Home Assistant option to Phoenix MCP (scoped), then select that agent in Settings > Voice assistants. This applies to LLM-backed conversation agents, not the default template Assist pipeline.

Option B: let Phoenix MCP be the agent (no external software)

If you would rather not install a separate LLM app, Phoenix MCP can register itself as a conversation agent and run its own model, using an existing Agent Chat provider account.

  1. In Settings > Voice Agent (the Phoenix MCP panel), enable it and pick a token, a provider account, and a model.
  2. Choose its Conversation style and Detail. Optionally enable Home-focused, a focus preference rather than a security control. The next request uses any changed setting immediately.
  3. Let Phoenix MCP set it up for you: on the first enable it offers to create an Assist assistant pointed at Phoenix MCP (and, if you leave the option on, make it your preferred assistant). Or use Set up Phoenix MCP assistant in that card any time.
  4. Prefer to do it by hand? In Settings > Voice assistants, set your assistant's conversation agent to Phoenix MCP.

When the model marks a Home-focused voice refusal using Phoenix's private protocol, Phoenix replaces the model prose with a localized refusal and asks you to repeat the complete request and explicitly say to answer anyway. Phoenix recognizes that explicit phrase deterministically in the conversation language (and always accepts the English words answer anyway), bypasses Home focus for that request only, and restores it on the next request. The rejected utterance is not retained. A model that omits the private marker is handled normally without Phoenix guessing from its prose, so weaker models may refuse without giving the recovery instruction. Even at Detailed, Voice keeps replies suitable for speaking aloud.

Before you use voice

  • In Settings > Voice assistants, turn off Prefer handling commands locally. Otherwise Home Assistant will not route requests to Phoenix MCP.
  • Make the Phoenix MCP assistant your preferred assistant when you want satellites to use it.
  • Voice has no inline Approve button. Confirm-gated actions wait for approval in the Phoenix MCP panel.
Generate automation data with AI Task

Generate data in automations with AI Task

Home Assistant's AI Task feature lets an automation, script, or dashboard ask an AI model to produce text or structured data on demand, through the ai_task.generate_data action. Phoenix MCP can be that model: it registers an Phoenix MCP AI Task entity that runs Phoenix MCP's own model on a token's scope, so a task reads only what the token can see and every tool call it makes is gated, MESA-checked, and audited like any other. Requires Home Assistant 2025.7 or later (AI Task shipped then; the panel disables this card on older versions). Like Agent Chat, the model comes from a provider account, so each task's prompt and the tool results the model sees are sent to that provider; use a local Ollama account to keep tasks fully local.

  1. In Settings > AI Task (the Phoenix MCP panel), enable it and pick a token, an Agent Chat provider account, and a model. The Phoenix MCP AI Task entity appears once all four are set, and disappears again if you disable it or clear one of them.
  2. Choose a Conversation style and Detail for free-text results. Structured tasks omit both preferences and follow their output schema exactly.
  3. Optionally click Make default in the AI Task setup section to make Phoenix MCP your default entity for Data generation tasks, so an ai_task.generate_data action that does not name an entity runs through Phoenix MCP. Home Assistant keeps a single default, so the panel confirms before replacing an existing one.
  4. Point an AI Task action at the Phoenix MCP AI Task entity by entity_id, or leave the entity unset to use your default.

Here is an example script which asks Phoenix MCP to summarize the home and shows the answer as a notification. Because the task runs Phoenix MCP's scoped tool loop, the model looks up the lights itself, within the token's scope, before it writes the sentence:

sequence:
  - action: ai_task.generate_data
    data:
      task_name: home_summary
      entity_id: ai_task.phoenix_mcp_ai_task
      instructions: >-
        Check how many lights are on and reply with one short,
        friendly sentence naming a few of them.
    response_variable: result
  - action: persistent_notification.create
    data:
      title: Home summary
      message: "{{ result.data }}"

Pass a structure to the action and Phoenix MCP returns a validated JSON object instead of prose (for example { "count": 3, "names": […] }), which an automation can branch on directly. Conversation style and Detail are omitted for this structured path so presentation preferences cannot compete with the schema.

A confirm-gated task queues for approval

AI Task is not interactive, so if the model calls a Confirm-gated tool the call is reported as queued; you will need to approve it later in the Phoenix MCP panel. AI Task reuses an Agent Chat provider account for its model. Revoking or expiring the token it uses, or deleting that provider account, removes the Phoenix MCP AI Task entity and clears it as your default.