speclaw
Click on "Install 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., "@speclawInitialize speclaw and set up the project constitution"
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.
Install once, then one command sets everything up. Install speclaw globally, run
speclaw init, pick the agents you use, and speclaw scaffolds the project, indexes
your code, and hands your agent a ready-to-paste prompt to finish the setup.
Quick start
Install speclaw globally (once), then run init in your project root:
npm i -g @esneiderbravo/speclaw
speclaw initThe speclaw command is now available everywhere — run speclaw index,
speclaw visualize, or speclaw lawbook … directly in any project.
init will:
Ask which agents you use (Claude Code, Cursor, Codex, …) — and configure only those. Add more later; nothing is forced on you.
Write the foundation (constitution + standards) and the lawbook workflow.
Index your code with a live progress bar and a summary of what it found.
Register the speclaw MCP server in each chosen agent's config.
Print a prompt to paste into your agent so it fills the constitution with your project's real architecture and conventions.
Prefer not to install globally? A one-off npx @esneiderbravo/speclaw init works
too (also pnpm dlx / yarn dlx) — but installing globally means you can run the
speclaw commands directly afterwards.
Related MCP server: Graph
It looks like this
The suite — four modules
Module | What it does |
Foundation | The project's constitution: |
Compass | speclaw's own local code graph. Parses your code (tree-sitter) into nodes + edges plus a local vector store, so an agent finds and understands code with a fraction of the tokens a grep/read loop would cost. No LLM, 100% local, lives in |
Lawbook | speclaw's own spec-driven workflow: |
Tools | Opt-in packs of skills and subagents (currently the dev-agents) that agents use for specific tasks. |
Compass is inspired by CodeGraph and the Lawbook module by OpenSpec — both MIT. speclaw reimplements the ideas as its own code and gives full credit; see ATTRIBUTION.md.
The spec-driven workflow (Lawbook)
Lawbook is speclaw's answer to the biggest risk with AI agents: code that drifts from intent. The intent is written first, the code is made to match it, and the spec is promoted to the project's canonical record — so nothing non-trivial lands without a spec change. It's a loop of five steps:
┌─────────┐ ┌───────┐ ┌───────┐ ┌──────┐ ┌─────────┐
│ explore │ ─▶ │ draft │ ─▶ │ build │ ─▶ │ sync │ ─▶ │ archive │
└─────────┘ └───────┘ └───────┘ └──────┘ └─────────┘Step | What happens |
explore | Think an idea through before committing to it — should we do this, and how. Writes nothing. |
draft | Capture the intent as a change under |
build | Implement the tasks in order, keeping code and spec in agreement, and record test results under |
sync | Reconcile the delta specs against what was actually built, then promote them into the canonical |
archive | Reconcile, then validate, promote, and move the change to |
Every draft writes four artifacts under lawbook/changes/<name>/ — none optional:
Artifact | What it captures |
| The why — motivation, what changes, non-goals, and whether migrations are needed. |
| The delta specs — one per affected capability, normative and testable. |
| The how — approach, alternatives weighed, and the trade-offs behind the decision. |
| The plan — ordered, checkable steps, including the mandatory ones from |
Plus a reports/ folder — scaffolded at draft, filled at build with one report per discipline (backend.md, frontend.md, …) recording the real unit/integration/e2e results. Evidence of testing travels with the change, and lawbook_archive refuses to archive without it.
Delta specs are normative and testable. Requirements use SHALL/MUST
under ### Requirement: headers, each with one or more #### Scenario: blocks
whose acceptance criteria hold without production integrations. lawbook_validate
checks that the code matches what the spec promises before you sync or archive.
Three ways to drive it — same engine, no external CLI:
In your agent — the
/lawbook:explore,/lawbook:draft,/lawbook:build,/lawbook:sync,/lawbook:archivecommands (installed as skills).MCP tools —
lawbook_init,lawbook_validate,lawbook_sync,lawbook_archive,lawbook_list.CLI —
speclaw lawbook init | list | validate | sync | archive.
The workspace is committed under lawbook/: specs/ (canonical), changes/
(in-flight), changes/archive/ (shipped), and config.yaml (the mandatory task
steps every change must include). The standards themselves are amended the same
way — through a spec change reviewed by a human.
Two ways to use it
speclaw meets you where you are. Everything works through the CLI — so no one is blocked by MCP setup — and the same capabilities are exposed as MCP tools for a smoother, integrated experience once configured. An agent without MCP can still use Compass and the lawbook engine by calling the CLI from its shell.
What lands in your project
Philosophy — why "laws"?
A guideline is a suggestion. Alaw is enforced. The most common failure mode of AI coding agents isn't lack of capability — it's working without the project's tacit knowledge: the rules the team actually lives by. speclaw makes that knowledge explicit, executable, and binding, and gives agents a local map (Compass) and a disciplined workflow (Lawbook) to act on it — without burning tokens.
Staying up to date
speclaw checks for new releases in the background (at most once a day) and nudges you when one lands. To upgrade:
speclaw updateupdate upgrades the global package and brings the current project up to date
without a re-init, splitting files by who owns them:
Managed files (speclaw's workflow machinery — the skills, commands, rules, and agent packs under
ai-specs/) are refreshed to the new version, so improvements actually reach your project. If you edited one locally,updatereports the overwrite so you can recover your copy from git; pass--backupto also keep a<file>.bak. Any*.bakis gitignored.Personalized files (your constitution and standards —
CLAUDE.md,AGENTS.md,LAWS.md,docs/standards/*,docs/compass.md,lawbook/config.yaml) are never auto-edited. When a release changes their speclaw-authored content,updateprints a prompt for the agent you're using to apply the change while preserving your project's specifics.speclaw update --check— report whether an update exists, change nothing.NO_UPDATE_NOTIFIER=1— silence the reminder.
Requirements
Node.js ≥ 22 — uses the built-in
node:sqlite.No native builds, no services, no API keys, no LLM download. Tree-sitter parsers ship as WASM; the vector store is local.
MIT · built on ideas from OpenSpec & CodeGraph · see ATTRIBUTION.md
speclaw · where specs become law
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceA local-first MCP server that provides AI agents with safe codebase access through file discovery, hybrid lexical-semantic search, and project introspection. It features durable local memory and semantic indexing while keeping all data and processing entirely on your local machine.Last updated74615MIT
- Alicense-qualityCmaintenanceAn MCP server that gives your agent a persistent project brain: vision, architecture decisions, conventions, roadmaps, and automatic session handoff.Last updated796MIT
- Alicense-qualityAmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.Last updated28MIT

Vibgrate AI Contextofficial
Alicense-qualityBmaintenanceLocal-first MCP server that gives AI assistants codebase intelligence—code graph, drift analysis, vulnerability attribution, and version-correct library docs—all from the user's machine.Last updated3,5703Apache 2.0
Related MCP Connectors
Local-first RAG engine with MCP server for AI agent integration.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/esneiderbravo/speclaw'
If you have feedback or need assistance with the MCP directory API, please join our Discord server