Skip to content

microsoft/agent-host-protocol

Agent Host Protocol

A synchronized, multi-client state protocol for AI agent sessions.

Read the documentation →

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-protocol as a Swift Package Manager dependency (resolves bare vX.Y.Z tags at the repo root) to use the AgentHostProtocol types/reducers library or the AgentHostProtocolClient single-host and multi-host client library. See the Swift package README, clients/swift/CHANGELOG.md, and clients/swift/ for the example iOS client. The Package.swift manifest lives at the repository root because SwiftPM only resolves manifests at the root of a remote git repo; the actual Swift sources live under clients/swift/AgentHostProtocol/.
  • Rust — See clients/rust/ for the ahp, ahp-types, and ahp-ws crates. Released to crates.io via rust/vX.Y.Z tags (CHANGELOG).
  • Kotlin — Add com.microsoft.agenthostprotocol:agent-host-protocol from Maven Central to use from Android or any JVM project. See clients/kotlin/ for the source and CHANGELOG. Released via kotlin/vX.Y.Z tags.
  • TypeScript — Install @microsoft/agent-host-protocol to use the wire types, reducers, AhpClient, and the WebSocketTransport. See clients/typescript/ and CHANGELOG. Released via typescript/vX.Y.Z tags; the Azure DevOps publish pipeline at clients/typescript/pipeline.yml picks up the tag, validates it, and publishes to npm.
  • AHPX — A command-line and Node.js client for connecting to AHP servers, managing sessions, and sending prompts.
  • VS Code — VS Code includes Agent Sessions client code for working with AHP hosts.

Servers

For consumers that need to talk to two or more hosts at once, the Rust SDK ships a MultiHostClient abstraction in ahp::hosts and the Swift SDK ships MultiHostClient in AgentHostProtocolClient. Single-host consumers use the same API via MultiHostClient::single in Rust or MultiHostClient.single(...) in Swift. 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 for the protocol-level rules and 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

About

Synchronized multi-client state for AI agent sessions

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors