ต้นแบบ · รุ่นทดลอง: มีทุก server ในทะเบียนทางการ อัปเดตทุก 30 นาที รีวิวและบัญชีผู้ใช้จะมาในขั้นถัดไป
PopNx MCPที่รวม MCP สำหรับคนใช้ AI · อธิบายเป็นภาษาคน

Agent Lease

โดย Buggy1111รุ่น 0.2.0i★ –iรันบนเครื่อง
ชื่อใน registryio.github.Buggy1111/agent-lease-mcp

ติดตั้ง

ภาพรวม

คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)

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

สามเสาของ PopNx MCP

สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน

ใช้ทำอะไรได้

ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry

  • การเชื่อมต่อ: รันบนเครื่อง
  • ช่องทาง (transport): stdio
  • หมวด: อื่น ๆ
  • ต้องใส่ค่าเหล่านี้: AGENT_NAME

ติดตั้ง

เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง

ก่อนติดตั้ง

ต้องเตรียมก่อน

  • PyPIติดตั้ง uv ของ Python (มีคำสั่ง uvx) ในเครื่อง

คุณใช้แอปไหน

เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”

เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json

{
  "mcpServers": {
    "agent-lease": {
      "command": "uvx",
      "args": [
        "agent-lease-mcp"
      ],
      "env": {
        "AGENT_NAME": "ใส่ค่าของคุณ",
        "AGENT_LEASE_DB": "ใส่ค่าของคุณ"
      }
    }
  }
}

พิมพ์คำสั่งนี้ใน Terminal

claude mcp add agent-lease --env AGENT_NAME='ใส่ค่าของคุณ' --env AGENT_LEASE_DB='ใส่ค่าของคุณ' -- uvx agent-lease-mcp

เติมค่าที่เว้นว่างไว้ก่อนรัน

เปิดใน Cursor

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json

{
  "mcpServers": {
    "agent-lease": {
      "command": "uvx",
      "args": [
        "agent-lease-mcp"
      ],
      "env": {
        "AGENT_NAME": "ใส่ค่าของคุณ",
        "AGENT_LEASE_DB": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

เปิดใน VS Code

หรือคัดลอกค่าตั้งเอง

วางในไฟล์ .vscode/mcp.json ของโปรเจกต์

{
  "servers": {
    "agent-lease": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "agent-lease-mcp"
      ],
      "env": {
        "AGENT_NAME": "ใส่ค่าของคุณ",
        "AGENT_LEASE_DB": "ใส่ค่าของคุณ"
      }
    }
  }
}

เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง

ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น

ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี

ค่าที่ต้องใส่เอง

  • AGENT_NAME จำเป็น env
    This agent's name in the room, e.g. claude-code or codex. Must match the hooks.
  • AGENT_LEASE_DB env
    Path to the shared SQLite room (default ~/.agent-lease/room.db).

ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README

ทำอะไรได้บ้าง

รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง

ผลตรวจเบื้องต้นi

เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569

  • ✓ ผ่าน

    ตัวตนผู้ทำตรงกับ repo

    ชื่อใน registry ยืนยันด้วยบัญชี GitHub Buggy1111 ซึ่งเป็นเจ้าของ repo

  • … ยังไม่ตรวจ

    ยังมีคนดูแล

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • … ยังไม่ตรวจ

    มีสัญญาอนุญาต (license)

    ยังไม่ได้อ่านข้อมูล repo จาก GitHub

  • – ไม่เกี่ยว

    endpoint ตอบ

    ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต

  • – ไม่เกี่ยว

    ล็อกอินแบบ OAuth

    ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน

  • … ยังไม่ตรวจ

    คำอธิบายเครื่องมือไม่มีคำสั่งแอบแฝง

    รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต

เทียบกับตัวอื่นในหมวด อื่น ๆi

  • ดาวมากกว่า 0% ของอีก 32718 ตัวในหมวดนี้
  • ส่งรุ่นใหม่เข้า registry ล่าสุดกว่า 64% ของอีก 32718 ตัวในหมวดนี้
  • ผลตรวจเบื้องต้นดีกว่าหรือเท่ากับ 100% ของอีก 32718 ตัวในหมวดนี้

เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo

คำถามที่พบบ่อย

Agent Lease ปลอดภัยไหม?

จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น

ต้องใช้กุญแจหรือรหัสอะไรบ้าง?

ต้องใส่ค่าเหล่านี้: AGENT_NAME

ตัวนี้รันบนเครื่องหรือบนคลาวด์?

รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)

ยังมีคนดูแลอยู่ไหม?

repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.2.0) เข้า registry 21 วันที่ผ่านมา

ใช้กับโปรแกรมไหนได้บ้าง?

โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย

มีตัวไหนใช้แทนได้บ้าง?

ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, MemberVault MCP by usefulapi

ตัวที่ใช้แทนได้

server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว

อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi

Spec Driven Development

โดย formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

รันบนเครื่อง★ 440MITอัปเดต 14 เดือนที่ผ่านมา
ติดตั้ง

Remote Desktop Commander

โดย desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

รันบนคลาวด์★ 211อัปเดต เมื่อวานซืน
ติดตั้ง

README จากผู้ทำ

เปิดอ่าน README

ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ

agent-lease-mcp

Keep two coding agents (Claude Code and Codex, or two sessions of either) from overwriting each other's work in the same repository.

agent-lease gives them leases on paths, presence and a shared message log — and the lease is enforced by a PreToolUse hook, not by good intentions. An agent that tries to edit a file another agent is working on is refused before the edit happens.

Česky / Czech version

Why it exists

9 September 2026. A coordination file, docs/AGENT-HANDOFF.md, existed and both agents knew about it. At 22:28 they still both touched deploy/make-work-package.sh: one was editing it while the other was running it. Bash reads a script as it goes, the text shifted under the running process, and instead of a 3.7 GB installer the build produced a useless 198 MB one.

The lesson the whole project rests on: coordination that can be ignored will be ignored. Not out of malice — an agent at work simply does not look at the notice board.

The same collision was later replayed on purpose: Codex ran the script, Claude Code tried to edit it mid-run, and the hook refused the edit. The file stayed intact.

How it differs

locksenforcementTTLpresencemessagesaudit
AgentRoom (paper)✅prompt only?✅✅✅
Agent Claim MCP✅prompt only✅❌❌❌
agent-orchestration✅prompt only❌✅✅❌
agent-lease-mcp✅PreToolUse hook✅✅✅✅

Advisory locks get broken; AgentRoom documents this itself. Claude Code and Codex both have PreToolUse hooks with the same semantics (exit 2 = block, reason on stderr), so a lease can be enforced deterministically at the tool-call level. One script serves both clients.

Rules it is built on

  • A lease, not a lock. 30-minute TTL. A crashed agent cannot block the repo forever.
  • All or nothing. A claim on several paths succeeds completely or not at all.
  • A lease on a directory covers everything under it.
  • A free file is claimed automatically on the first edit, so nobody has to remember to call claim.
  • A running script is leased for the duration of the run — exactly the combination that broke the build.
  • Fail-open by default. Broken coordination must not stop work; otherwise the first thing anyone does is switch the hook off. AGENT_LEASE_FAIL_CLOSED=1 flips this for unattended runs.

What runs on its own

hook eventwhat happens
SessionStartthe room state is injected into context: who is here, what they hold, messages for you
UserPromptSubmitnew messages are delivered once, via a cursor
PreToolUse (Edit/Write/apply_patch…)an edit of a file someone else holds is refused
PreToolUse (Bash)a script being run is leased; obvious writes (>, tee, sed -i, cp/mv target) into a held file are refused
Stop / SessionEndall leases are returned when the agent finishes its turn

Injections stay silent when there is nothing to say.

Waking a sleeping agent

Hooks only fire when the agent acts, so an idle session is woken from outside, without spending model tokens:

  • Claude Code: agent-lease init claude-code --write --rewake adds an asyncRewake hook on SessionStart and Stop. It waits on a signal file and wakes the session when an addressed message from someone else arrives. Broadcasts and automatic receipts do not wake it.
  • Codex: the agent-lease-codex-wake service nudges a named session through codex queue (only message numbers, never their text). After a provider limit ends, it nudges once for unfinished work. Setup: /rename nox in Codex, AGENT_LEASE_CODEX_THREAD=nox in ~/.config/agent-lease/environment, then enable deploy/systemd/agent-lease-codex-wake.service.

A message from another agent is information, not a human instruction. For agents to hand work to each other unattended, the human writes the allowed scope (and what always needs asking) into the agent's own instructions, e.g. ~/.codex/AGENTS.md. Template and details (in Czech): docs/ZPRAVY-A-POTVRZENI.md.

Tools

MCP toolpurpose
claim(paths, purpose, ttl_seconds)reserve ahead — typically a directory before running a script
release(paths?)give back; without arguments returns everything you hold
owner(path)who holds this path (including through a directory lease)
room(status?)one call per checkpoint: who is here, what is held, what is new
say(text) / inbox(since_id)messages to the room
send / jobs / next_task / ack / retry / canceladdressed messages and durable tasks with delivery state
accept(message_id, note)acknowledge you are taking an addressed message — the sender sees it
report_limit(minutes, reason)out of quota: your unstarted tasks move to a fallback agent
history(path?)who touched what and how it ended — the answer to "why was I blocked"

The same operations exist as a CLI (agent-lease room|claim|release|say|send|…), because Codex in non-interactive mode cannot approve MCP calls but can run Bash. agent-lease wait --for blocks without spending model tokens and wakes a background session when a message arrives.

say/inbox is not a live chat: MCP is pull, the other side reads a message when it next looks. For a live view there is a local web room: agent-lease web --open (loopback only, see Security).

Quick start (two minutes)

uv tool install agent-lease-mcp

agent-lease init claude-code --write --rewake # writes all hooks, keeps a .bak backup agent-lease init codex --write agent-lease simulate # 2 s: replays a full scenario in a temp DB agent-lease doctor # checks it really works agent-lease web --open # live room in the browser

init without --write only shows what it would write. Manual setup below.

Install

uv tool install agent-lease-mcp

This puts agent-lease-mcp, agent-lease, agent-lease-guard, agent-lease-context and agent-lease-release on your PATH.

MCP server (stdio; each client runs its own process, the shared state is a SQLite file):

# Claude Code

claude mcp add agent-lease -e AGENT_NAME=claude-code -- agent-lease-mcp

# Codex — ~/.codex/config.toml

[mcp_servers.agent-lease] command = "agent-lease-mcp" env = { AGENT_NAME = "codex" }

Codex writes to ~/.agent-lease, outside the workspace — allow it:

[sandbox_workspace_write] writable_roots = ["/home/YOU/.agent-lease"]

Hooks — without them this is just a polite notice board:

// ~/.claude/settings.json

{ "hooks": { "PreToolUse": [{ "matcher": "Edit|Write|MultiEdit|NotebookEdit|Bash", "hooks": [{ "type": "command", "command": "AGENT_NAME=claude-code agent-lease-guard" }] }], "SessionStart": [{ "hooks": [{ "type": "command", "command": "AGENT_NAME=claude-code agent-lease-context" }] }], "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "AGENT_NAME=claude-code agent-lease-context" }] }], "Stop": [{ "hooks": [{ "type": "command", "command": "AGENT_NAME=claude-code agent-lease-release" }] }] } }

// ~/.codex/hooks.json — same events, AGENT_NAME=codex

{ "hooks": { "PreToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "AGENT_NAME=codex agent-lease-guard" }] }] } }

AGENT_NAME must match between the server and the hooks, otherwise an agent blocks its own files. An agent called unconfigured-* in room means exactly that.

variabledefaultpurpose
AGENT_NAMEunconfigured- - name in the room
AGENT_LEASE_DB~/.agent-lease/room.dbwhere the state lives
AGENT_LEASE_TTL1800default lease length (s)
AGENT_LEASE_RETENTION_DAYS30messages and audit older than this are deleted (0 = keep)
AGENT_LEASE_FAIL_CLOSEDoff1 = block the tool call when the hook itself fails
AGENT_LEASE_HUMANhumanthe human's name in the room (stored next to the DB by the web UI)
AGENT_LEASE_TASK_SENDERShuman + configured agentswho may create tasks (comma-separated)
AGENT_LEASE_FALLBACKS—failover chains, e.g. codex=claude-code;claude-code=codex
Optional: Bash safety gate

A separate PreToolUse hook (agent-lease-jev-guard) for a different question — not "who holds this file" but "is this command destructive". Hard rules (rm -rf /, force push, git reset --hard, curl | sh, mkfs…) apply as soon as it is wired in. An optional external classifier (TypeSafe Jev) is off by default, starts in shadow mode, receives only redacted commands and is advisory — never the only safeguard. Details in ADR 0003.

Receipts, failover, bridge and broker

  • Every addressed message has a visible state ⏳ → 👁 seen → ✔ taking → done. "Seen" is written by the hook automatically; "taking" must be acknowledged by the agent (accept) and is reminded on every prompt. Nothing gets lost silently. agent-lease overdue lists what nobody acknowledged.
  • Limits and failover. Codex workers read the explicit typed availability signal from the local App Server. Other workers record a limit only after a real provider/CLI error; if no reset time is supplied, agent-lease does not invent one. Manual agent-lease limit / MCP report_limit remains available. Unaccepted, unstarted tasks then move to the next agent in AGENT_LEASE_FALLBACKS (e.g. codex=claude-code;claude-code=codex) after a grace period, and the sender is told.
  • Bridge (agent-lease bridge --agent codex) — an autonomous worker: takes a task, acknowledges it, runs codex exec / claude -p read-only and returns the result. --provider openrouter --model sends it to any model through OpenRouter as plain text without tools (read-only; good for review and a second opinion). Keys only from the environment. Worker presence/provider state uses a separate identity (codex-bridge, claude-code-bridge), so a headless quota cannot overwrite the state of an interactive agent.
  • A task never runs twice. A task held by a worker (leased/started) can be accepted only with its lease token; the bridge skips a task an interactive session has accepted and, with --interactive-grace, leaves fresh tasks to a present interactive agent first.
  • Broker (agent-lease broker) — single SQLite writer over a 0600 Unix socket; other tools use it automatically when it runs, so a sandboxed Codex does not need direct access to the database. Clients survive a broker restart: the connect is retried (nothing was sent yet), an interrupted call is never repeated, and long-running workers continue with the next call.
  • Overview panel in the live room: each agent's active task, queue, unacknowledged items, typed provider state, reason for waiting, limits and items to review. Tasks may declare repeatable --path worksets and a --priority; the scheduler skips paths held by another agent and the board shows the blocking path, owner and TTL. agent-lease notify --loop sends to Telegram only what waits on the human, each event at most once (TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID from the environment; --dry to test).
  • Operating workers safely. agent-lease worker-activate and agent-lease failover-activate set a safe starting point without running or moving any task: only wo

ตัดมาแค่ช่วงต้น อ่านต่อใน repo

ถาม PopNx