Skip to content
ahpioPublic

About

An open-source, plugin-driven AHP server with native Claude and pi agents, ACP agents (Codex, Copilot, Gemini), model gateway, tools and MCP servers, sandboxed computers and terminals, automations, conversational bots, and a web UI (ahpw). Users, permissions and usage tracking are built in. And @ahpd/sdk to build your own host or plugin.

Topics

Resources

Stars

28 stars

Watchers

0 watching

Forks

Latest commit

 

History

5,402 Commits

Folders and files

Repository files navigation

ahpd - agent host platform

CI @ahpd/server @ahpd/sdk docs license MIT node >=22 Agent Host Protocol 1.1.0 runs on Node, Bun, Deno

Run your AI agents anywhere. Control them from anywhere.

ahpd is an open-source, self-hosted platform that brings multiple AI agents together.

Run Claude Code SDK, Pi SDK, ACP agents (Codex, Copilot, Gemini, and more), or your own custom harness using supported subscriptions or API keys. Extend their capabilities with plugins, tools, connectors, MCP servers, and integrations.

Schedule tasks or run sessions on your computer, remote servers, or in containers, with full control over your environments and resources.

Whether it's for personal use or an organization, manage access, monitor usage, and control budgets from one place.

Connect from your browser, desktop, terminal, or phone. Your sessions and work stay in sync across every client.

It also has a shared editing feature for real-time collaboration.

And this is just the beginning. ahpd is an extensible platform, built to grow with new agents, integrations, and possibilities.

Read the documentation · GitHub · Discord

ahpio.com

Run agents on your own infrastructure, controlled from anywhere


Start in minutes

Install with one line on Linux or macOS:

curl -fsSL https://ahpio.com/ahpd/install.sh | bash

On Windows, in PowerShell:

irm https://ahpio.com/ahpd/install.ps1 | iex

The script checks for Node 22.18 or newer, installs @ahpd/server without sudo, adds ahpd to your PATH, and runs ahpd configure. Install options

Or install with npm, then run the setup:

npm install -g @ahpd/server --allow-scripts=node-pty
ahpd configure

Choose your agents, network settings, and project folders. To add an agent later, run ahpd plugin install @ahpd/agent-claude.

Start the host:

ahpd start --path /work/project

Your host is ready for an AHP client. Connect from the terminal with ahpc:

npx @softov/ahpc --host ws://127.0.0.1:9187

🗂️ Serve multiple projects

ahpd --path /work/api --path /work/web

Project paths are catalogue entries, not filesystem sandboxes. Access to other paths depends on the configured host capabilities and permissions.

🔐 Connect remotely

By default, the host listens on loopback. To listen on another interface, configure a connection token:

ahpd --host 0.0.0.0 --connection-token-file ~/.config/ahpd/token

Only expose the host to networks you trust, and protect the token. See the remote access documentation.


Your agents. Your machines. Your control.

Run the agents you prefer, manage how they work, and stay in control of your infrastructure, access, and spending.

AI agents can help you write code, fix problems, manage files, and automate tasks. But they often depend on the terminal or application where you started them.

ahpd gives your agents a place to run and gives you a way to reach them.

⏳ Keep work running

Start a task and leave it running on your host. Your agent can continue its work when you close the client. Return later to review the results.

📱 Work from any device

Start on your desktop. Check progress from your phone. Open the same session in your browser or terminal. Your work stays in sync.

🤖 Choose your agents

Use Claude Code, Codex, Copilot, Gemini, pi, and other supported agents. Configure the agents you need and use them through one host.

🔑 Subscriptions or API keys

Bring your existing agent subscriptions where supported, or connect model providers using your own API keys. Choose how you access and pay for AI.

🐳 Run work in isolated environments

Use Docker containers to give tasks their own environment. Keep work separate when projects need different tools or dependencies.

⏰ Automate routine tasks

Schedule agent work or start it from a webhook. Let your host run tasks even when no client is connected. Turn your agents into continuously available workers.

🔐 Control access

Control access to your agents and tools. Define who can interact with your host and what actions they can perform. Define permissions and usage policies for different users and teams.

📊 Diagnostics

Inspect host status, logs, network information, and telemetry.

💰 Control spending

See what each person, team, and project has spent on models. Set daily, weekly, or monthly limits, and the host refuses new work when a limit is reached.

🔀 Share your models

Point your agent or a script at your host and call any model with your ahpd token. The host uses the provider's key, applies your policies, and records the cost. Centralize credentials without distributing provider keys to every client.

🧩 Extend with plugins

Add new agents, tools, integrations, and capabilities without rebuilding the server. Use existing plugins or build your own with the SDK.


More than a chat

With the right capabilities enabled, agents and clients can work with the same host resources.

📁 Resources

Read, write, create, and delete files through resource ports.

⌨️ Terminals

Open a shell on your host from any client. Watch the commands your agent runs as they run, and come back later to read their full output.

🌳 Git & GitHub

Inspect changes, branches, worktrees, and pull requests. Use separate worktrees to keep parallel sessions from sharing a working tree.


Use the agents you prefer

You do not need to commit to one agent or model provider.

ahpd supports several agent integrations. Each integration runs as a plugin.

@ahpd/agent-claude

✻ @ahpd/agent-claude: Run Claude through the Claude Agent SDK. docs

ahpd plugin install @ahpd/agent-claude

@ahpd/agent-pi

π @ahpd/agent-pi: Run the pi coding agent directly in the host. docs

ahpd plugin install @ahpd/agent-pi

@ahpd/agent-acp

⇄ @ahpd/agent-acp: Codex, Copilot, Gemini, and other supported agents through Agent Client Protocol. docs

ahpd plugin install @ahpd/agent-acp

@ahpd/agent-cofold

◈ @ahpd/agent-cofold: Generic harness to use supported OpenAI-compatible models. docs

ahpd plugin install @ahpd/agent-cofold

Add more with plugins

Each capability can be configured to fit your environment.

@ahpd/computer

@ahpd/computer: Create isolated environments for agentic tasks. docs

ahpd plugin install @ahpd/computer

@ahpd/bot

@ahpd/bot: Give an agent its own identity, workspace, and session. docs

ahpd plugin install @ahpd/bot

@ahpd/webhook

@ahpd/webhook: Start work from an HTTP request. docs

ahpd plugin install @ahpd/webhook

@ahpd/tunnel-devtunnel

@ahpd/tunnel-devtunnel: Reach your host from VS Code on another network, through a Microsoft Dev Tunnel. docs

ahpd plugin install @ahpd/tunnel-devtunnel

@ahpd/tasks

@ahpd/tasks: Keep one list of tasks and plans that every agent and person reads and writes. docs

ahpd plugin install @ahpd/tasks

@ahpd/push

@ahpd/push: Get a phone notification when a session needs you, with the app closed. docs

ahpd plugin install @ahpd/push

@ahpd/activepieces

@ahpd/activepieces: Use Activepieces connectors as tools for your sessions and bots. docs

ahpd plugin install @ahpd/activepieces

One host. Many clients.

ahpd runs your agents and keeps their sessions. Connect with the client that suits you.

🌐 Browser → @ahpd/web

Manage sessions, files, terminals, and host settings from your browser.

GitHub · Releases

🖥️ Desktop → ahp-desk

Connect to multiple hosts, manage local installations, and work in dedicated windows.

GitHub · Download

💻 Terminal → @softov/ahpc

Work with agents through an interactive terminal, CLI commands, or scripts.

# Connect to your host with the terminal client
npx @softov/ahpc --host <host-address> --token <your-token>

GitHub · Releases

📱 Mobile → AgentHost Client

Follow work, receive notifications, and respond when an agent needs your approval.

Android · iOS soon · Website

🔌 Other AHP clients

Connect with compatible applications, including supported VS Code integrations.

AHP Client Libraries · AHP Implementations


One host, every screen. Start work on one device and continue from another. Your sessions stay on the host.


Make it your own

ahpd has a small core and a plugin system. Add new agents, tools, URI schemes, environments, and services without modifying the daemon.

🧰 Build with the SDK

@ahpd/sdk lets you embed an AHP host in your application. It handles protocol negotiation, subscriptions, snapshots, state updates, reconnects, sessions, chats, and transcript paging.

import { createHost, listen } from '@ahpd/sdk';
import { claude } from '@ahpd/agent-claude';

const path = process.cwd();
const host = createHost({ path, agents: [claude({ paths: [path] })] });
await listen({ port: 9187 }, (peer) => host.accept(peer));

Build your own host

🧩 Write plugins and agents

You can extend your host without changing the server itself.

Implement the Agent interface or contribute host ports, tools, and URI schemes. Load extensions from npm packages, local directories, or manifest-backed files.

# Load plugins for one run, on top of the configured list
ahpd --plugin @ahpd/agent-claude --plugin @ahpd/computer
# A single file, with a plugin.json beside it that names its id and main
ahpd --plugin ./scratch-agent.mjs
# A directory with a manifest, tried against the working directory first
ahpd --plugin ./my-custom-agent

A custom agent implements the same Agent interface and is named the same way as the agents above. A client speaks only AHP and depends on no agent SDK.

flowchart LR
    classDef core fill:#0f172a,stroke:#10b981,stroke-width:1.5px,color:#fff
    classDef plugin fill:#1e293b,stroke:#8b5cf6,stroke-width:1.5px,color:#fff
    classDef claude fill:#1e293b,stroke:#F88c00,stroke-width:1.5px,color:#fff
    classDef cofold fill:#1e293b,stroke:#3b82f6,stroke-width:1.5px,color:#fff

    SERVER["@ahpd/server"]
    SDK["@ahpd/sdk"]

    subgraph Plugins ["Agent Plugins"]
      CLAUDE["@ahpd/agent-claude"]
      COFOLD["@ahpd/agent-cofold"]
      ACP["@ahpd/agent-acp"]
      PI["@ahpd/agent-pi"]
      CUSTOM["Your agent"]
    end

    SERVER --> SDK
    SERVER -. "dynamically loads" .-> Plugins

    CLAUDE -->|"implements"| AGENT["Agent Interface"]
    COFOLD -->|"implements"| AGENT
    ACP -->|"implements"| AGENT
    PI -->|"implements"| AGENT
    CUSTOM -->|"implements"| AGENT

    SDK -->|"hosts & manages"| AGENT

    class SERVER,SDK core
    class CLAUDE claude
    class COFOLD cofold
    class ACP,PI,CUSTOM plugin
Loading

Plugins execute inside the daemon with its permissions: install only code you trust. Add the integrations you need. Remove or disable the ones you do not use.

Write a plugin · Write an agent · Smallest agent example


Documentation

The full documentation is at ahpio.github.io/ahpd.

Document Purpose
Get started Install, configure, start, and connect VS Code
Install Install, and run on Node, Bun or Deno
Upgrade Upgrade the daemon and its plugins
Reference Every command and flag
Plugins Install, update, and configure plugins
Users Users and authorization
Policy Who may use which agent, model and computer, and how much
Usage What each person, team and project has spent
Model gateway Call a model through the host with your ahpd token
Write a plugin The plugin contract, manifest and events
Write an agent The Agent and Session contracts
Build your own host createHost and the ports
AHP compatibility What this host implements of AHP, command by command

Every document is listed in docs/README.md, one line each.

Built on the Agent Host Protocol (AHP). See AHP compatibility for what it implements.


Development

Tips, PRs, and contributions are welcome!

Read DEVELOPER.md for detailed development guidelines.

Discuss development, issues, and ideas on the GitHub Discussions page.

Any development starts with cloning or forking the repository and installing dependencies.

git clone https://github.com/ahpio/ahpd
cd ahpd

pnpm install
pnpm build

pnpm test
pnpm typecheck

Protocol captures can be checked against the strict schema:

pnpm wire -- packages/sdk/test/fixtures/wire.jsonl

Open source. Built for choice.

ahpd is open source and released under the MIT license.

Run it on your own infrastructure. Choose your agents, configure your tools, and build the environment that works for you.

Use it for a personal project, a development team, or an application that needs agent capabilities.

Your infrastructure. Your agents. Your workflow.

ahpd is part of ahpio, the Agent Host Platform. Get to know the whole platform at ahpio.com.

Documentation · Source Code · ahpio.com

Sorry to beg, but if you find this project useful, consider starring the repository on GitHub.

About

An open-source, plugin-driven AHP server with native Claude and pi agents, ACP agents (Codex, Copilot, Gemini), model gateway, tools and MCP servers, sandboxed computers and terminals, automations, conversational bots, and a web UI (ahpw). Users, permissions and usage tracking are built in. And @ahpd/sdk to build your own host or plugin.

Topics

Resources

Stars

28 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages