Speclock MCP Server

Stop AI from breaking code you told it not to touch. Enforces .cursorrules, CLAUDE.md, and AGENTS.md — not just suggests. Zero-config: npx speclock

Local serverstdioGo

What is the Speclock MCP server?

Stop AI from breaking code you told it not to touch. Enforces .cursorrules, CLAUDE.md, and AGENTS.md — not just suggests. Zero-config: npx speclock protect reads your existing AI rule files, extracts constraints, installs pre-commit hooks. That is what the speclock mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

The tools it exposes

The server publishes 14 tools. What each one is for:

  • speclock_init — Initialize SpecLock in project
  • speclock_get_context — Full context pack (the key tool)
  • speclock_set_goal — Set project goal
  • speclock_add_lock — Add constraint + auto-guard files
  • speclock_remove_lock — Soft-delete a lock
  • speclock_add_decision — Record architectural decision
  • speclock_add_note — Add pinned note
  • speclock_set_deploy_facts — Record deploy config
  • speclock_check_conflict — Semantic conflict check against all locks
  • speclock_set_enforcement — Switch advisory/hard mode
  • speclock_override_lock — Override with reason (audit logged)
  • speclock_override_history — View override audit trail

What it needs from you

Configuration is passed through the environment: SPECLOCK_ENCRYPTION_KEY. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

speclock on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Speclock's toolset — speclock_init, speclock_get_context, speclock_set_goal and 11 more — is a fair guide to whether it matches your workflow. It is maintained by sgroy10; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Speclock.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
speclock_initInitialize SpecLock in project
speclock_get_contextFull context pack (the key tool)
speclock_set_goalSet project goal
speclock_add_lockAdd constraint + auto-guard files
speclock_remove_lockSoft-delete a lock
speclock_add_decisionRecord architectural decision
speclock_add_noteAdd pinned note
speclock_set_deploy_factsRecord deploy config
speclock_check_conflictSemantic conflict check against all locks
speclock_set_enforcementSwitch advisory/hard mode
speclock_override_lockOverride with reason (audit logged)
speclock_override_historyView override audit trail
speclock_semantic_auditAnalyze git diff against locks
speclock_detect_driftScan for constraint violations

How to install the Speclock MCP server

{
  "mcpServers": {
    "speclock": {
      "command": "npx",
      "args": ["-y", "speclock"],
      "env": {
        "SPECLOCK_ENCRYPTION_KEY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SPECLOCK_ENCRYPTION_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Speclock to speclock init.
  • Use Speclock to speclock get context.
  • Use Speclock to speclock set goal.

Frequently asked questions

It connects Speclock to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (speclock_init, speclock_get_context, speclock_set_goal, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Speclock directly.