microsoft/agent-host-protocol
Swift
Captured source
source ↗microsoft/agent-host-protocol
Description: Synchronized multi-client state for AI agent sessions
Language: Swift
License: MIT
Stars: 41
Forks: 10
Open issues: 19
Created: 2026-03-12T23:52:11Z
Pushed: 2026-06-10T20:46:58Z
Default branch: main
Fork: no
Archived: no
README:
Agent Host Protocol
A synchronized, multi-client state protocol for AI agent sessions.
[Read the documentation →](https://microsoft.github.io/agent-host-protocol/)
Overview
The Agent Host Protocol (AHP) defines how a portable, standalone sessions server communicates with its clients. Multiple clients can connect to the server and see a synchronized view of AI agent sessions through immutable state, pure reducers, and write-ahead reconciliation.
Implementations
Clients
- Swift — Add
https://github.com/microsoft/agent-host-protocolas a Swift Package Manager dependency (resolves barevX.Y.Ztags at the repo root) to use theAgentHostProtocoltypes/reducers library or theAgentHostProtocolClientsingle-host and multi-host client library. See the [Swift package README](clients/swift/AgentHostProtocol/README.md), [clients/swift/CHANGELOG.md](clients/swift/CHANGELOG.md), and [clients/swift/](clients/swift/) for the example iOS client. ThePackage.swiftmanifest lives at the repository root because SwiftPM only resolves manifests at the root of a remote git repo; the actual Swift sources live underclients/swift/AgentHostProtocol/. - Rust — See [
clients/rust/](clients/rust/) for theahp,ahp-types, andahp-wscrates. Released to crates.io viarust/vX.Y.Ztags ([CHANGELOG](clients/rust/CHANGELOG.md)). - Kotlin — Add
com.microsoft.agenthostprotocol:agent-host-protocolfrom Maven Central to use from Android or any JVM project. See [clients/kotlin/](clients/kotlin/) for the source and [CHANGELOG](clients/kotlin/CHANGELOG.md). Released viakotlin/vX.Y.Ztags. - TypeScript — Install
@microsoft/agent-host-protocolto use the wire types, reducers,AhpClient, and theWebSocketTransport. See [clients/typescript/](clients/typescript/) and [CHANGELOG](clients/typescript/CHANGELOG.md). Released viatypescript/vX.Y.Ztags; the Azure DevOps publish pipeline at [clients/typescript/pipeline.yml](clients/typescript/pipeline.yml) picks up the tag, validates it, and publishes to npm. - Go —
go get github.com/microsoft/agent-host-protocol/clients/goto use theahptypeswire types, theahpasync client (client + pure reducers + pluggableTransport), and theahpwsWebSocket transport. See [clients/go/](clients/go/) and [CHANGELOG](clients/go/CHANGELOG.md). Released viaclients/go/vX.Y.Ztags — the Go module proxy indexes the directory-prefixed tag directly from this repo, so there is no separate package registry. - [AHPX](https://github.com/TylerLeonhardt/ahpx) — A command-line and Node.js client for connecting to AHP servers, managing sessions, and sending prompts.
- [VS Code](https://github.com/microsoft/vscode) — VS Code includes Agent Sessions client code for working with AHP hosts.
Servers
- [VS Code agent host](https://github.com/microsoft/vscode) — The reference AHP server implementation. Start in `src/vs/platform/agentHost/node/` when browsing the repository.
For consumers that need to talk to two or more hosts at once, the Rust SDK ships a MultiHostClient abstraction in `ahp::hosts`, the Swift SDK ships MultiHostClient in AgentHostProtocolClient, and the Go SDK ships MultiHostClient in [ahp/hosts](clients/go/ahp/hosts/). Single-host consumers use the same API via MultiHostClient::single in Rust, MultiHostClient.single(...) in Swift, or hosts.Single(...) in Go. See Connecting to Multiple Hosts for the design and surface.
Versioning and releases
Each language client and the spec itself release independently on their own SemVer tracks. See [docs/specification/versioning.md](docs/specification/versioning.md) for the protocol-level rules and [RELEASING.md](RELEASING.md) for the release mechanics (tag conventions, CHANGELOG / metadata enforcement, required CI environments).
Development
# Install dependencies npm install # Start local dev server npm run docs:dev # Build for production npm run docs:build # Preview production build npm run docs:preview
License
MIT
Notability
notability 3.0/10Low-traffic repo from Microsoft