# speclock

Enforces rules written in CLAUDE.md and .cursorrules as active constraints. It intercepts edits and shell calls before they break project boundaries.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 25
- Author: sgroy10
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sgroy10/speclock
- Updated: 2026-08-18
- HTML: https://affpapa.org/en/nevibecode/mcp/speclock

## What it does

The server turns written guidance from `CLAUDE.md` and `.cursorrules` into hard boundaries for coding agents. Instead of literal keyword matches, it spots semantic violations. If your project forbids editing authentication, a request to add social sign-in will be blocked before any file changes. The package exposes 51 MCP tools and checks commands ahead of time.

Everything runs locally through `npx` with no account setup. Decisions are logged to an HMAC audit chain. Git hooks provide an extra checkpoint right before code commits.

Advisory mode is the starting state. It issues warnings without interrupting work. Hard blocking requires the `--strict` flag.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add speclock -- npx -y speclock
```

### Codex

**Platform CLI**
```bash
codex mcp add speclock -- npx -y speclock
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "speclock": {
            "command": "npx",
            "args": [
                "-y",
                "speclock"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "speclock": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "speclock"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add speclock npx -y speclock
```

## When to use it
- block unintended edits to sensitive project components
- catch policy violations based on meaning rather than literal keywords
- intercept forbidden shell commands before the agent executes them
- enforce repository guidelines at the Git commit stage

## Example prompts
- Check if modifying the session handler violates rules in `CLAUDE.md`
- Run `speclock protect --strict` to enable hard enforcement on this repository
- Inspect all active constraint locks for the current project

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
