SpecLock: MCP Server for Enforcing AI Coding Constraints

✍️ OpenClawRadar📅 Published: March 10, 2026🔗 Source
SpecLock: MCP Server for Enforcing AI Coding Constraints
Ad

SpecLock is an MCP server that remembers project constraints across sessions and blocks AI coding agents from violating them. It's available as a free, open-source tool under MIT license.

How SpecLock Works

The tool catches constraint violations through semantic understanding. Examples from the source show it can detect:

  • Synonyms ("Add social login to the login page" where login → auth)
  • Euphemisms ("Streamline the authentication flow" where streamline → modify)
  • Temporal evasion ("Temporarily disable MFA for testing")
  • Buried violations in compound sentences ("Update UI and also drop the users table")

Performance and Testing

Claude independently tested SpecLock with its own adversarial test suite: 7 suites, 100 tests total. The tool scored 100/100 with zero false positives and zero missed violations. Each constraint check takes 15.7ms on average.

Ad

Setup and Configuration

To use SpecLock as an MCP server in Claude Code, add this configuration to your .mcp.json file:

{
  "mcpServers": {
    "speclock": {
      "command": "npx",
      "args": ["-y", "speclock", "serve", "--project", "."]
    }
  }
}

Installation

Install via npm: npm install speclock. The tool includes 42 MCP tools and is available on GitHub at github.com/sgroy10/speclock.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also