# contract-ops-mcp [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/DrBaher/contract-ops-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 336  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/contract-ops-mcp

## Description
One MCP server for the contract-ops suite: all nine local-first CLIs as agent tools.

## Tools
Capabilities this server exposes over MCP:

- **extract_contract** — Ingest any contract (.md/.txt/.html/.docx/.pdf) into structured JSON — parties, dates, term, governing law, a clause map, defined terms — each with a confidence + source. Deterministic, no network.
- **lint_contract** — Lint one contract for internal-consistency defects — leftover placeholders, broken cross-references, undefined/unused defined terms, numbering gaps, party/date inconsistencies. Returns findings (rule, severity, line).
- **compare_versions** — Clause-aware drift detection between two contract versions. exitCode: 0 clean · 2 substantive drift · 3 cosmetic · 4 clauses moved · 1 I/O error.
- **fill_template** — Fill placeholders in a markdown/.docx template with parameter values (deterministic; no LLM). Returns the filled document on stdout.
- **convert_to_pdf** — Convert a Word document to PDF (needs a PDF backend such as LibreOffice on the host).
- **review_nda** — Review an NDA against a house playbook — deterministic scoring with evidence per finding. Returns the structured review report (decision, risk_score, findings with evidence).
- **nda_setup** — One-time: generate the org NDA policy + default playbook in the workspace (needed before draft_nda / negotiate_*). Idempotent; writes config into the workspace.
- **generate_redlines** — Generate a clause-ready redline draft from a review_nda JSON report. Writes redline markdown to `out`. Deterministic; no org policy needed.
- **draft_nda** — Draft a new NDA from a built-in template into `out` (markdown; optional .docx). Deterministic. If placeholders are missing the result lists them — fill and retry. Needs nda_setup first.
- **negotiate_status** — Show a negotiation's rounds, per-clause status, and signatures. Read-only.
- **negotiate_review** — Review the latest negotiation round against your policy. Read-only.
- **negotiate_diff** — Clause-by-clause changes between two negotiation rounds (defaults to the last two). Read-only.
- **negotiate_analyze** — Post-hoc negotiation dashboard: trajectory, per-clause winners, source breakdown, outcome. Read-only.
- **negotiate_validate** — Integrity check on a negotiation state file: schema + hash-chain + per-round shape. Read-only.
- **negotiate_init** — Start a negotiation: draft from a template + parties, SIGN as Party A, and write the state file. Signs a negotiating commitment. Needs nda_setup first.
- **negotiate_counter** — Sign a counter-round with amendments — either from a JSON amendments file you provide, or deterministic --auto with a stance. Signs a negotiating commitment.
- **negotiate_accept** — Accept the current negotiated text, SIGNING convergence on your side. Signs a binding acceptance.
- **negotiate_finalize** — Finalize a converged negotiation: emit the final .md and .docx. The legal SIGNATURE stays with the human — no e-signature is applied here; hand off to sign-cli.
- **template_vault_find** — Search the template vault by category, tag, jurisdiction, or keyword. Read-only.
- **template_vault_get** — Resolve and return a versioned template's text by reference (e.g. nda/house-mutual). Read-only.
- **template_vault_list** — List templates in the vault, optionally filtered by category / tag / jurisdiction. Read-only.
- **template_vault_info** — Show metadata for a template (category, tags, jurisdiction, versions). Read-only.
- **template_vault_diff** — Unified diff between two versions of one template. Read-only.
- **template_vault_history** — Chronological timeline for a template: versions, swaps, and amendments. Read-only.
- **template_vault_clauses** — List the clauses detected in a template. Read-only.
- **template_vault_clause_library** — Find clauses that repeat across the vault (a reusable clause library). Read-only.
- **template_vault_compare_clauses** — Compare clauses between two templates (optionally one named clause). Read-only.
- **template_vault_stats** — Vault dashboard: template counts, coverage, and last activity. Read-only.
- **template_vault_verify** — Content-level sha256 integrity check of the vault. Read-only (never rewrites hashes).
- **template_vault_compose** — Fork a template into a new derived template in the vault. Writes a new versioned template.
- **template_vault_swap** — Replace one clause in a template with the same clause from another template. Writes a new version.
- **template_vault_export** — Export a template to another format (e.g. .docx) at a workspace path.
- **contract_vault_query** — Query the register of signed contracts (read-only): list | find | get | show | stats | history.
- **contract_vault_due** — Project upcoming renewal / notice / payment deadlines from the signed-contract register.
- **contract_vault_risk** — Renewal-exposure analysis: missed/imminent auto-renewal notice deadlines and expirations.
- **contract_vault_obligations** — Project upcoming date/obligation actions from the register. Read-only.
- **contract_vault_remind** — Obligations whose reminder window is open right now — a digest for agents/cron. Read-only.
- **contract_vault_at_risk** — Renewal exposure: missed / imminent auto-renewal notice deadlines and expirations. Read-only.
- **contract_vault_review** — List register fields needing review (unidentified / LLM-derived / low-confidence). Read-only.
- **contract_vault_verify** — Integrity check of the register (source sha256 + git state). Read-only.
- **contract_vault_export** — Export the register as csv | md | json (for spreadsheets / reports). Returns the export; writes no file. Read-only.
- **contract_vault_ingest** — Register a contract into the vault from an extract_contract JSON file. Writes to the register.
- **contract_vault_obligation** — Track one obligation's lifecycle (status / owner / recurrence / reminder days). Writes to the register.
- **contract_vault_accept** — Mark register field(s) as manually verified (single, or bulk via a file). Writes to the register.
- **verify_signature** — Verify a signed PDF matches what was recorded for its request. (Read-only; signing itself stays human-gated behind sign-cli's own MCP.)
- **verify_receipt** — Re-verify a portable signing receipt bundle, fully offline. Read-only.
- **audit_show** — Show the hash-chained audit log for a sign request. Read-only.
- **catalog** — Return a CLI's full machine-readable command/flag catalog (`<cli> --catalog json`). Use this to discover the long tail beyond the curated tools.
- **run** — Escape hatch: run any suite CLI with raw arguments (no shell). For commands the curated tools don't cover. Call `catalog` first to learn the flags. Note: signing stays human-gated — only sign-cli's read/verify subcommands are reachable here; request-create/send/sign/approve are rejected and must go through sign-cli's own MCP with its per-signer approval tokens.
- **suite_status** — Report which suite CLIs are installed (with versions) and how to install any that are missing. Call this first if a tool reports a CLI isn't installed.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "contract-ops-mcp": {
    "command": "npx",
    "args": ["-y","contract-ops-mcp"]
  }
}
```

## Documentation & README

# contract-ops-mcp

One [MCP](https://modelcontextprotocol.io) server for the whole **[contract-ops CLI suite](https://cli.drbaher.com/)** — wire it up once and an agent (Claude, Cursor, Codex, …) gets all nine local-first CLIs as tools: extract, draft, lint, compare, convert, review, and the template + signed-contract vaults. **Signing stays human-gated.**

## Run this

```jsonc
// e.g. Claude Desktop / Cursor MCP config
{
  "mcpServers": {
    "contract-ops": { "command": "npx", "args": ["-y", "contract-ops-mcp"] }
  }
}
```

The CLIs themselves must be installed (the server shells out to them). Fastest way to get all nine:

```bash
curl -fsSL https://cli.drbaher.com/install.sh | sh     # local
# …or run the server + CLIs in one container: ghcr.io/drbaher/contract-ops
```

Call **`suite_status`** any time to see which CLIs are present and how to install any that aren't.

> **Prefer a ready-made agent?** [**contract-ops-agent**](https://github.com/DrBaher/contract-ops-agent) is a
> terminal agent that already wraps this server in an *enclosure* — the model's only tools are the contract-ops
> tools, no shell/filesystem/signing by construction. Bring your own model (Claude, OpenAI, or any
> OpenAI-compatible endpoint): `npm i -g contract-ops-agent`.

## Tools

Curated, ergonomic tools (typed inputs, JSON out) for the common operations, plus two escape hatches for the long tail:

| Tool | What it does |
|---|---|
| `extract_contract` | Any contract (.md/.txt/.html/.docx/.pdf) → structured JSON (parties, dates, clauses, …) |
| `lint_contract` | Internal-consistency findings (placeholders, broken refs, defined-term/numbering/date defects) |
| `compare_versions` | Clause-aware drift between two versions (exit 0 clean · 2 substantive · 3 cosmetic · 4 moved) |
| `fill_template` | Fill a template's placeholders with typed params (deterministic) |
| `convert_to_pdf` | DOCX → PDF (needs a PDF backend, e.g. LibreOffice) |
| `review_nda` | Score an NDA against a house playbook, with evidence |
| `template_vault_find` / `template_vault_get` | Search / resolve versioned templates (read-only) |
| `contract_vault_query` / `contract_vault_due` / `contract_vault_risk` | Query the signed-contract register; project renewal/notice deadlines; renewal-exposure (read-only) |
| `verify_signature` / `verify_receipt` / `audit_show` | Verify a signed PDF / a receipt bundle / walk the audit log (**read-only**) |
| `catalog(cli)` | Return any CLI's full `--catalog json` — discover the long tail |
| `run(cli, args)` | Escape hatch: run any suite CLI with raw args (no shell) |
| `suite_status` | Which CLIs are installed (+ versions) and how to install the rest |

The curated set and `catalog`/`run` are **discovery-driven** — they ride the suite's uniform `--catalog json` contract, so they stay in sync as the CLIs evolve.

## Safety

- **Signing is human-gated.** Only sign-cli's **read/verify** operations are exposed (`verify_signature`, `verify_receipt`, `audit_show`) — never request-create or sign. This is enforced: the `run`/`catalog` escape hatches reject any `sign` subcommand outside a read-only allowlist, so request-create/send/sign/approve can't be reached here. Those stay behind [sign-cli](https://github.com/DrBaher/sign-cli)'s own MCP server with its per-signer approval tokens, so this server can't become an unguarded signing path.
- **Filesystem lockdown.** File-path arguments to the curated tools are confined to `CONTRACT_OPS_MCP_BASE_DIR` (default: the working directory). Set it to widen the sandbox.
- **No shell.** CLIs are invoked with `execFile` (no shell interpolation).

## License

MIT. Part of the [contract-ops CLI suite](https://cli.drbaher.com/). See [`AGENTS.md`](https://github.com/DrBaher/contract-ops-mcp/blob/HEAD/AGENTS.md) for the agent contract.

