MCP servers · buggy1111

Agent Lease: hook-enforced path leases for Claude Code and Codex

An MCP server that stops Claude Code and Codex agents working in the same repository from overwriting each other's files, using hook-enforced path leases, presence and a shared message log.

This text was machine-translated from the publisher's own information and has not been checked by a human editor. The publisher's original text is the reference.

This resource was imported automatically from the sources listed below and has not been reviewed by the AI Gate team yet. The description is the publisher's own, as published. Check the repository before installing.

What it does

Agent Lease gives coding agents leases on paths, a presence view of who is active in the repository, and a shared message log. A PreToolUse hook enforces the leases, so an agent trying to edit a file that another agent holds is refused before the edit happens. Leases expire after 30 minutes, claims on several paths succeed completely or not at all, and a lease on a directory covers everything beneath it. Free files are claimed automatically on the first edit, and a running script is leased for the length of its run.

It suits two agents, or two sessions of one agent, working in the same repository. The publisher describes a case where one agent edited a deploy script while another was running it, which produced a broken build. Agents can reserve paths with claim, release them, check ownership with owner, and read the room state and messages. A CLI offers the same operations for Codex in non-interactive mode, which cannot approve MCP calls.

Setup involves registering hooks for session start, prompt submission, tool use and session stop. For Claude Code, an init option adds a hook that wakes an idle session when an addressed message arrives. For Codex, a wake service nudges a named session, which requires renaming the session, setting an environment variable and enabling a systemd unit. An optional local web room runs on loopback only.

Limitations and requirements

Coordination fails open by default, so broken coordination does not stop work; setting AGENT_LEASE_FAIL_CLOSED=1 changes this for unattended runs. Enforcement depends on Claude Code or Codex PreToolUse hooks. Codex waking requires a named session, an environment file and a systemd service. Messages are pulled when an agent next reads them, so it is not a live chat. The web room is loopback only. The publisher states that production activation and independent review of the Quality Gate are pending, and that the dashboard alone does not enforce merges.

Safety

Our team has not reviewed this resource. Only automated rules checked it; resources with high-risk signals are not published. These are signals, not a guarantee that installing it is safe. Try it in a sandbox project first.

  • Runs code or changes an assistant's behaviour

Sources

  • Official MCP Registry first seen 13 Nov 2026 · last seen 13 Nov 2026 · its page on the source
    Agent Lease

    Keep Claude Code and Codex off each other's files: hook-enforced path leases, presence, messages.

    v0.2.0
    As shown on registry.modelcontextprotocol.io when we last read it
MCP servers
hashicorp

Terraform MCP Server (HashiCorp)

HashiCorp's MCP server that gives an assistant current Terraform Registry information on providers, modules and policies, and can manage HCP Terraform workspaces.

1.6K GitHub starsCloud & DevOpsSoftware development
Updated 17 Nov 2026
MCP servers
modelcontextprotocol

MCP reference servers

Seven small example servers maintained by the Model Context Protocol project: files, Git, web fetching, memory, time, step-by-step thinking and a test server.

92K GitHub starsSoftware development
Updated 18 Nov 2026
MCP servers
redis

Redis MCP Server

Redis's official MCP server that lets an AI assistant store, read and search data in a Redis database, including streams, JSON documents and vector indexes.

642 GitHub starsData & databasesSoftware development
Updated 17 Nov 2026
MCP servers
firecrawl

Firecrawl MCP Server (web search and scraping)

Firecrawl's MCP server that lets an AI assistant search the web, turn pages and PDFs into clean Markdown, crawl sites and interact with dynamic pages.

7.8K GitHub starsWeb, search & browserProductivity & automation
Updated 17 Nov 2026