Skip to main content
Glama

devcontract

Evidence-backed Team Engineering Contract + guided AI workflows (Understand, Build), served over MCP stdio so Grok, Claude Code, Codex, Kiro, and Cursor share the same tools.

npx -y devcontract

Requires Node.js 22+ and git on PATH. Build plans need XAI_API_KEY (xAI / SpaceXAI). Understand is deterministic and works without a key.

First onboarding

In the git repo you want the agent to learn (not in this package unless you are dogfooding):

npm install -g devcontract
cd your-service
devcontract init

That compiles the Team Engineering Contract, writes .devcontract/ (gitignored except README), and prints MCP snippets.

Then hook Codex once per machine:

codex mcp add devcontract -- devcontract
codex mcp list
codex

In Codex: /mcp should show devcontract. Ask: Why does <file> exist? Use dev.understand.

Optional: devcontract init --write drops .codex/config.toml / .mcp.json into the repo (Codex project config only applies after the directory is trusted).

Related MCP server: repo-history

Status

v0.1.1. Working now:

  • devcontract init — first-run onboarding

  • devcontract (no args) — MCP stdio with dev.understand

  • devcontract contract compile — Team Engineering Contract from git artifacts

  • devcontract understand <path-or-ticket> — cited git history (no API key)

Still stubbed: build, approve, run.

Product overview: docs/PRODUCT.md
Design: docs/DESIGN.md

MCP clients

Claude Code / Cursor — .mcp.json or .cursor/mcp.json:

{
  "mcpServers": {
    "devcontract": {
      "command": "npx",
      "args": ["-y", "devcontract"]
    }
  }
}

Codex / Grok — project MCP config, command = "npx", args = ["-y", "devcontract"], startup_timeout_sec = 60.

Kiro — best-effort .kiro/settings/mcp.json (same JSON shape).

Put XAI_API_KEY in the host environment. Do not commit it.

CLI

npx -y devcontract              # MCP stdio (default)
npx -y devcontract --help
npx -y devcontract init
npx -y devcontract contract compile
npx -y devcontract understand <path-or-ticket>
npx -y devcontract build <ticket>
npx -y devcontract approve <runId>    # TTY only; not an MCP tool
npx -y devcontract run <runId> [--resume]

Develop

npm install
npm test
npm run build

License: Apache-2.0

Available Tools

1 tool
dev.understandUnderstandA
Read-onlyIdempotent

Cited answer for why a file, module, ticket, or commit exists. Deterministic; no API key required.

Inputs: target (required), private. Returns: claims, owners, outcome, subject, +6 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusing it with another tool; its purpose is unique and clearly stated.

    Naming Consistency5/5

    A single tool with a clear namespace prefix and descriptive name; no inconsistency possible.

    Tool Count2/5

    A single tool is too thin for a server named devcontract; this appears to be a trivial or underdeveloped surface.

    Completeness2/5

    Only one operation is provided, with no create, update, delete, or listing capabilities; the lifecycle for understanding development context is severely incomplete.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Automatically extracts architectural decisions, patterns, and insights from Git commits to build a local, structured project memory. It exposes this living context to AI tools via MCP, allowing them to understand the historical reasoning and evolution behind your codebase.
      45 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes a repo's historical engineering memory (decisions, landmines, guardrails) via MCP tools for AI coding agents.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides MCP tools that give AI agents persistent, append-only memory in a git repository, letting them record observations, decisions, and corrections while retrieving context briefs, current facts, conflicts, and traceable event history without a vector database.
      4 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI coding agents with Git repository history analysis, including churn hotspot detection, semantic file coupling, and recent context summaries through MCP tools.
      MIT