A native iOS client for the Agent Host Protocol (AHP) — Microsoft's protocol for synchronized multi-client state over AI agent sessions. SwiftUI, iPhone and iPad, iOS 26 and later.
A fork of
AHPApp, the sample app inmicrosoft/agent-host-protocol, pinned tov0.9.0(UPSTREAM.md). Upstream's app had not compiled against its own package since the protocol moved conversations onto chat channels (docs/deferred-upstream.md); this fork is ported to that model. A full turn completes in the iOS 26.5 simulator against the sibling Python host. Not yet exercised: tool approvals, questions from the agent, terminals, reconnection, the gateway.
As inherited from upstream, plus the session settings:
- Connect to one or more AHP hosts over
ws://orwss://, with reconnection that replays missed actions when the app returns from the background. A connection that still answers apingis kept rather than rebuilt, and while one is being made the app says which stage it is at (connecting, waiting for the server with a running count, loading sessions, retrying) - Several agents on one server: the session list's card shows each agent by name with its own counts, and tapping one narrows the list to it
- Several machines behind ahp-gateway (which lists them in root
_meta): the card shows a row per machine with the agents it runs, sessions say where they run ("Claude · Studio"), the folder browser names machines, and a new chat picks its folder first, then offers only that machine's agents - Browse sessions, and start new ones with an agent, model and working directory — picked from pinned or recent folders, by browsing the host's folders (push navigation, a filter, swipe to choose or pin; through a gateway too, starting from its list of machines), or typed
- A new session's settings, as the host describes them
(
resolveSessionConfig): each choice the host offers — for the Claude Code host, Approvals (Ask / Accept edits / Auto / Plan) and Continue from — appears in the New Chat sheet and is sent withcreateSession. The chat screen shows the approval mode it was created with; a host that allows changing it mid-session gets a picker instead - Choose what shows under each reply (Settings → Reply Details): time received, duration, model, tool calls, input/output/cached tokens, in any order — time received by default
- Send while the agent is working: Next (the default tap) joins the turn in flight, Later runs after it, Now stops it and sends yours (long-press Send). Waiting messages can be cancelled; a message that joined a turn is shown where it joined
- Select any part of a reply or your own message (drag the handles, as in Notes). Reply in the selection menu quotes it into the message box as a markdown blockquote, with a blank line to type under; replying again adds the next quote after what you've written. A selection stays within one paragraph, list item or code block
- Tool calls as cards, compact one-liners, or collapsed runs ("5 tool calls ✓") that expand (Settings → Tool Calls); a call waiting on you is always a card. A call's details show its input and output, with JSON indented and coloured (keys kept in the order the tool sent them)
- Browse the session's files and open them — markdown rendered, code with line
numbers, images — from the chat's folder button; links in replies to files
(
[a](src/a.swift:42), relative or absolute) open the file at that line - Browse a host's files without a session (⋯ → Browse Files on the session list): the same browser, from the host's root — or, behind a gateway with several machines, from the list of machines
- Stream chat responses — markdown with headings, lists, code blocks, tables and quotes, reasoning, tool calls with their inputs and outputs
- Tool-call cards show what actually ran — the shell command, or the file, pattern or URL — not only the host's one-line message
- Answer the agent's questions and tool confirmations
- An interactive terminal (SwiftTerm)
- Microsoft dev tunnels as a way to reach a host (GitHub sign-in)
Requires Xcode 27 and its Metal Toolchain
(xcodebuild -downloadComponent MetalToolchain).
open AHPApp.xcodeprojTry it against the sibling Python host:
python -m ahp_host --delay 0.05then add the server 127.0.0.1:4321 (scheme ws) in the app. Behind an
ahp-gateway, use
scheme wss, the gateway's host, and a gateway token in the Token field — the app
sends it as ?tkn=.
SideStore re-signs whatever it installs with your own Apple ID, so it takes an unsigned build:
xcodebuild archive -project AHPApp.xcodeproj -scheme AHPApp -configuration Release \
-destination 'generic/platform=iOS' -archivePath build/AHPApp.xcarchive \
CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""
mkdir -p build/ipa/Payload
cp -R build/AHPApp.xcarchive/Products/Applications/AHPApp.app build/ipa/Payload/
(cd build/ipa && zip -qry AgentHostClient.ipa Payload)Put build/ipa/AgentHostClient.ipa somewhere the phone can reach (iCloud Drive
works) and open it with SideStore.
To install from Xcode instead, copy AHPApp/Config/Signing.local.xcconfig.example
to Signing.local.xcconfig and set your team ID. A free Personal Team can only
create a profile once a device has been connected to this Mac.
MIT, upstream's — see LICENSE.