SpecLock: MCP Server for Enforcing AI Coding Constraints

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.
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
👀 See Also

OpenClaw skill reduces accessibility tree tokens from 600K to 1.3K for ad-heavy sites
A developer built an OpenClaw skill that uses ML-based element ranking to prune accessibility trees, cutting slickdeals.com from ~598K tokens to ~1.3K tokens by keeping only the top ~50 actionable elements.

PeaDB: Redis-Compatible Database Coded with AI Assistants in C++20
A developer created PeaDB, a Redis 7.2.5 drop-in replacement written in C++20 using Codex, Copilot, and Claude, implementing ~147 commands with persistence, replication, and cluster support. Benchmarks show performance close to Redis.

XLI: Open-Source Python Library for Claude Code-Style Terminal UIs
Building a coding agent? Terminal UX is half the work. XLI is an open-source Python rendering engine that replicates Claude Code's streaming markdown, tool cards, inline approvals, and slash commands without hijacking your terminal scrollback.

Squeez tool compresses bash output 90%+ to extend Claude Code context window
Squeez is a hook that automatically compresses raw bash output like ps aux, docker logs, and git log before it reaches Claude Code. It reduces token usage by 92.8% on average across 19 common commands, helping sessions last longer.