mcp-lock-manager
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-lock-manager acquire lock on src/components/Header.tsx"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-lock-manager
An MCP server that provides file-level exclusive locking across multiple Claude Code instances. Prevents conflicts when multiple agents edit files in the same project simultaneously.
How It Works
When multiple Claude Code sessions share a project, they can clobber each other's edits. This MCP server acts as a mutex — each session acquires a lock before editing a file and releases it when done. Locks are stored in a local .locks/ directory using atomic filesystem operations.
Stale locks from crashed sessions are automatically detected via PID liveness checks and cleaned up.
Related MCP server: agnt-lock
Setup
1. Install & Build
git clone https://github.com/maxwellplanck/mcp-lock-manager.git
cd mcp-lock-manager
npm install
npm run build2. Configure Claude Code
Add to your .claude/settings.json (project or user-level):
{
"mcpServers": {
"lock-manager": {
"command": "node",
"args": ["/absolute/path/to/mcp-lock-manager/build/index.js", "--project-root", "/absolute/path/to/your/project"]
}
}
}The --project-root flag tells the server which project directory to manage locks for. If omitted, it defaults to the current working directory.
You can also set the project root via environment variable:
{
"mcpServers": {
"lock-manager": {
"command": "node",
"args": ["/absolute/path/to/mcp-lock-manager/build/index.js"],
"env": {
"PROJECT_ROOT": "/absolute/path/to/your/project"
}
}
}
}Tools
lock_acquire
Acquire exclusive locks on one or more files before editing.
Parameter | Type | Required | Description |
|
| Yes | Project-relative file paths (use forward slashes) |
|
| No | Label for this session (e.g. |
Acquires all-or-nothing — if any file is already locked by another live session, the entire request fails with conflict details.
lock_release
Release file locks when done editing.
Parameter | Type | Required | Description |
|
| No | Paths to release. Omit to release all locks for this session. |
lock_list
List all active locks with owner, PID, alive status, and timestamp. Takes no parameters.
lock_cleanup
Force-remove all stale locks held by dead processes. Takes no parameters. Useful when lock_list shows locks with alive: false.
Adding to Your Workflow
For best results, add instructions to your project's CLAUDE.md telling Claude to use locks:
## File Locking
This project uses mcp-lock-manager for multi-session coordination.
Before editing any file, acquire a lock with `lock_acquire`. Release locks with `lock_release` when done.
If a lock conflict occurs, do not proceed — wait or ask the other session to release.License
MIT
Available Tools
4 toolslock_acquireA
Acquire exclusive file locks. Fails with conflict details if any path is held by another live session. Always call this before editing files.
Inputs: paths (required), owner.
lock_cleanupA
Force-remove all stale locks (dead PIDs). Use when lock_list shows locks with alive: false.
Inputs: no named parameters.
lock_listA
List all current file locks with owner, PID, timestamp, and alive status.
Inputs: no named parameters.
lock_releaseA
Release file locks. If paths are omitted, releases ALL locks for this session.
Inputs: paths.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: acquire, release, list, and cleanup locks. No two tools overlap in functionality.
All tools follow a consistent verb_noun pattern (e.g., lock_acquire, lock_list), making them highly predictable.
Four tools cover the essential operations of a lock manager without unnecessary additions or gaps.
The set provides full lifecycle management: acquire, release (including bulk), list, and cleanup of stale locks. No obvious missing operations.
Maintenance
Related MCP Connectors
Parallel coding agents claim a file before editing, so none overwrites another.
Keeps AI coding agents on one codebase from overwriting each other, and briefs each on its code.
Collision-free locks for AI agents: yours or a clean conflict, never a double booking.
Coding agents from Claude Code, Cursor and Codex claim jobs and lock files on one shared board.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenancePrevents AI coding agents from conflicting by coordinating file claims and resolving conflicts in real-time across multiple sessions.29 npm1MIT
- AlicenseAqualityDmaintenancePrevents AI agents from overwriting each other's work by providing file locking and coordination via MCP tools.42MIT
- AlicenseNot gradedqualityCmaintenanceCoordinates parallel AI coding agents by providing task ownership, scoped file locks, handoffs, and verification workflows.MIT
- AlicenseNot gradedqualityDmaintenanceEnables multiple AI coding agents to safely collaborate in the same git working tree by managing file ownership, merging writes, and preventing snapshot races.3 npm2MIT