{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tomschueppler.de/mcp-control-contract.schema.json",
  "title": "MCP Control Contract",
  "description": "A review artifact for mapping MCP tools to explicit operational controls. This is not part of the MCP specification.",
  "type": "object",
  "required": ["format", "generatedAt", "status", "context", "tools"],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "format": { "const": "tomschueppler.de/mcp-control-contract/v1" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "status": { "const": "review-required" },
    "disclaimer": { "type": "string" },
    "enforcementHint": { "type": "string" },
    "context": {
      "type": "object",
      "required": ["environment", "dataClass", "actor"],
      "additionalProperties": false,
      "properties": {
        "environment": { "enum": ["development", "internal", "production"] },
        "dataClass": { "enum": ["public", "internal", "confidential", "personal"] },
        "actor": { "enum": ["single-user", "team", "service"] }
      }
    },
    "tools": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["name", "riskTier", "enabledByDefault", "approval", "bindArguments", "requiredIdentity", "auditFields", "rateLimit", "dataClass", "reasons"],
        "additionalProperties": false,
        "properties": {
          "name": { "type": "string", "minLength": 1 },
          "riskTier": { "enum": ["R0", "R1", "R2", "R3"] },
          "enabledByDefault": { "type": "boolean" },
          "approval": { "enum": ["none", "session", "exact_arguments"] },
          "bindArguments": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
          "requiredIdentity": { "enum": ["delegated-user", "per-user", "workload-identity"] },
          "auditFields": { "type": "array", "items": { "type": "string" }, "minItems": 1, "uniqueItems": true },
          "rateLimit": { "type": "string", "minLength": 1 },
          "dataClass": { "enum": ["public", "internal", "confidential", "personal"] },
          "reasons": { "type": "array", "items": { "type": "string" }, "minItems": 1 }
        }
      }
    }
  },
  "additionalProperties": false
}
