AISchemaGate and DataContractGate

v0.4.3
io.github.nightmoose/contractgate Checked 2 hours ago Published 3 days ago

AISchemaGate validates and repairs structured LLM output against a contract, plus DataContractGate.

Values you need

VariableWhat it is
CONTRACTGATE_API_KEYrequired secret DataContractGate API key (cg_live_...). Create one at https://app.datacontractgate.com/account
CONTRACTGATE_BASE_URLoptional Gateway base URL. Defaults to https://api.datacontractgate.com

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add contractgate -e 'CONTRACTGATE_API_KEY=<CONTRACTGATE_API_KEY>' -- npx -y --package=@nightmoose/contractgate-mcp-server@0.4.3 contractgate-mcp
Add to claude_desktop_config.json
{
  "mcpServers": {
    "contractgate": {
      "args": [
        "-y",
        "--package=@nightmoose/contractgate-mcp-server@0.4.3",
        "contractgate-mcp"
      ],
      "command": "npx",
      "env": {
        "CONTRACTGATE_API_KEY": "<CONTRACTGATE_API_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "contractgate": {
      "args": [
        "-y",
        "--package=@nightmoose/contractgate-mcp-server@0.4.3",
        "contractgate-mcp"
      ],
      "command": "npx",
      "env": {
        "CONTRACTGATE_API_KEY": "<CONTRACTGATE_API_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "CONTRACTGATE_API_KEY",
      "id": "contractgate-api-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "contractgate": {
      "args": [
        "-y",
        "--package=@nightmoose/contractgate-mcp-server@0.4.3",
        "contractgate-mcp"
      ],
      "command": "npx",
      "env": {
        "CONTRACTGATE_API_KEY": "${input:contractgate-api-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.contractgate]
command = "npx"
args = ["-y", "--package=@nightmoose/contractgate-mcp-server@0.4.3", "contractgate-mcp"]
env = { "CONTRACTGATE_API_KEY" = "<CONTRACTGATE_API_KEY>" }

For AI agents

  1. Ask the user for: CONTRACTGATE_API_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: infer_contract, validate_events, deploy_contract, get_quarantine, list_contracts, egress_validate, get_drop_counts.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json