Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions docs/llm-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ documentation.
deployed as a `stable` version, and their event producer calling the validation
gateway — verified with a dry run before anything writes.

> **MCP first.** If your host has the ContractGate MCP server connected
> (`@contractgate/mcp-server` in Cursor, Claude Desktop, Windsurf, Copilot,
> Codex, …), skip the `curl` recipes below and use the typed tools:
> `infer_contract`, `validate_events`, `deploy_contract`, `get_quarantine`,
> `list_contracts`. They wrap the same endpoints, with argument validation
> and no shell-escaping. Setup: <https://app.datacontractgate.com/mcp-reference.md>.
> The rest of this playbook stays authoritative for the flow, contract shape,
> and semantics — only the transport changes.

---

## §0 — Preconditions
Expand All @@ -36,12 +45,8 @@ gateway — verified with a dry run before anything writes.
invent a key, and do not fall back to the self-hosted path silently.
- Add `.env` / `.env.local` to `.gitignore` if the user's project stores it there.

Every request below sends the key as the `X-Api-Key` header.

If the ContractGate MCP server is connected, prefer its tools
(`infer_contract`, `validate_events`, `deploy_contract`, `get_quarantine`,
`list_contracts`) over constructing `curl` calls. Setup:
<https://app.datacontractgate.com/mcp-reference.md>.
Every request below sends the key as the `X-Api-Key` header. (MCP tools read
the same key from the host process environment.)

---

Expand Down
22 changes: 4 additions & 18 deletions docs/mcp-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ validation itself. Auth is the same API key the CLI and playbook already use.
## Install

Add this to the host's MCP config (`~/.cursor/mcp.json`, Claude Desktop
`claude_desktop_config.json`, etc.).

Once `@contractgate/mcp-server` is on npm:
`claude_desktop_config.json`, etc.):

```json
{
Expand All @@ -27,21 +25,9 @@ Once `@contractgate/mcp-server` is on npm:
}
```

Until then, from a clone (`cd mcp && npm install && npm run build`):

```json
{
"mcpServers": {
"contractgate": {
"command": "node",
"args": ["<repo>/mcp/dist/index.js"],
"env": {
"CONTRACTGATE_API_KEY": "${CONTRACTGATE_API_KEY}"
}
}
}
}
```
The package is published at
<https://www.npmjs.com/package/@contractgate/mcp-server>. `npx -y` fetches the
latest release on first use, so no separate install step is needed.

Restart the host after editing the config.

Expand Down
Loading