# airlock [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/adamorad/airlock  
**GitHub Stars:** 2  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/airlock

## Description
Local daemon giving AI agents named locks, shared state, events, and a task queue over MCP.

## Tools
Capabilities this server exposes over MCP:

- **lock_resource** — {locked:true, lock_token, expires_in_seconds}` — or, if contended, `{locked:false, held_by, expires_in_seconds}` plus `{wake_token, queue_position, retry_with}` when you were queued
- **unlock_resource** — {released: bool}
- **renew_lock** — {renewed:true, expires_in_seconds}` or `{renewed:false, error}
- **list_locks** — [{name, agent_id, expires_in_seconds}]
- **lock_resources** — all-or-nothing: `{locked:true, tokens:{name:token}}` or `{locked:false, held_by}
- **set_note** — {saved:true}
- **get_note** — {key, value, author?, expires_in_seconds?}` or `{found:false}
- **list_notes** — [{key, value, author?, expires_in_seconds?}]

## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What the airlock MCP server does

The airlock MCP server gives agents a shared coordination layer for work on the same repository or host. Its primary mechanism is a named resource lock: an agent can acquire a lock, wait on a busy lock for up to 50 seconds, renew it, release it, or inspect current holders. Multiple resources can be acquired atomically, using a documented name ordering to avoid deadlocks.

Shared notes provide lightweight key-value state with optional authors and expiration. The newer conditional-update operation supports compare-and-swap behavior, while counters provide collision-free numeric increments under concurrent access. Agents can also register their presence, inspect active agents, and have locks released when a registration expires or is explicitly removed.

Generation-counted events support handoffs without polling. A waiting agent supplies the last generation it observed and can block until a newer signal arrives. The task queue adds priority, claims, leases, completion, failure, and inspection. Expired leases return tasks to the pending queue, allowing another worker to continue after a claimant crashes.

## How it works

A single Go daemon runs as a background service and exposes MCP over HTTP on 127.0.0.1:27183. The daemon keeps connections open while supported operations wait, so a caller does not need to implement a retry loop for a contended lock or event. Lock and task tokens act as capabilities for subsequent release, renewal, completion, or failure operations.

State is stored in SQLite at ~/.airlock/state.db with WAL mode. The database uses transactions, supports concurrent readers, and has one writer. The implementation uses the pure-Go modernc.org/sqlite package, so it does not require cgo or an external database.

## Setup and configuration

Install with `go install github.com/adamorad/airlock/v2@latest`, Homebrew using `brew install adamorad/tap/airlock`, or a source build. Run `airlock install-service` to register a launchd service on macOS or a systemd user unit on Linux. `airlock status` reports the local daemon status and current coordination state.

Configure Claude Code with `claude mcp add --transport http airlock http://localhost:27183`. Cursor, Windsurf, and other MCP clients can use an HTTP MCP entry pointing to `http://127.0.0.1:27183`.

On Linux and other multi-user hosts, authentication requires a bearer token because loopback is shared between users. The daemon creates `~/.airlock/token` with restrictive permissions on first run. Set the token in an Authorization header, or use `AIRLOCK_TOKEN` to override the file on any operating system. macOS is loopback-only by default and does not require the token.

## Tools and capabilities

The airlock MCP server exposes 22 tools across five areas:

- Locks: acquire, release, renew, list, and atomically acquire multiple named resources.
- Notes and state: save, read, list, delete, conditionally update notes, and increment counters.
- Presence: register, unregister, and list agents.
- Events: signal, wait for, and clear generation-counted events.
- Tasks: enqueue work, claim it with a lease, complete or fail it, and list queue entries.

Lock and note lifetimes use TTL values. The `ttl_minutes` input is retained as a deprecated alias for lock and note operations that accept TTLs. Wait windows for locks and events are capped at 50 seconds.

## Limitations and notes

The daemon is local rather than a hosted coordination service: clients connect to the loopback address, and the state database resides on the machine running it. The documented platform support is macOS and Linux. On Linux, loopback alone is not an authorization boundary, so the bearer-token configuration is required for multi-user safety.

The agent identity path for unlocking and renewing locks remains for version-one compatibility, but lock tokens are the preferred capability. Presence registrations must be renewed before their TTL expires if an agent needs its locks to remain held. Task claims also require completion or failure before their lease expires; otherwise the task is eligible for requeue.

_Full upstream README: https://allmcps.com/mcp/airlock/readme_

