{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/geronimo-iia/agent-foundation/schemas/mcp-index.json",
  "title": "MCP Server Hub Index",
  "description": "Schema for index.json generated by agent-hub-indexer for MCP server hubs",
  "type": "object",
  "required": ["type", "version", "entries", "metadata"],
  "properties": {
    "type": {
      "type": "string",
      "const": "mcp"
    },
    "version": {
      "type": "string"
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "name", "description", "version", "wasm_url", "wasm_hash", "path", "commit_hash", "last_updated"],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique MCP server identifier"
          },
          "name": {
            "type": "string",
            "description": "Human-readable server name"
          },
          "description": {
            "type": "string",
            "description": "What tools this server provides"
          },
          "version": {
            "type": "string",
            "description": "Semantic version",
            "pattern": "^\\d+\\.\\d+\\.\\d+$"
          },
          "wasm_url": {
            "type": "string",
            "description": "URL to WASM module",
            "format": "uri"
          },
          "wasm_hash": {
            "type": "string",
            "description": "SHA256 hash of WASM module",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "path": {
            "type": "string",
            "description": "Path in repository"
          },
          "commit_hash": {
            "type": "string",
            "description": "Git commit hash"
          },
          "last_updated": {
            "type": "string",
            "description": "Last update date (YYYY-MM-DD)"
          },
          "capabilities": {
            "type": "object",
            "description": "Required WASI capabilities",
            "properties": {
              "filesystem": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Required filesystem paths"
              },
              "network": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Required network hosts"
              },
              "env": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Required environment variables"
              }
            }
          },
          "tools": {
            "type": "array",
            "items": { "type": "string" },
            "description": "List of tool names provided"
          }
        },
        "additionalProperties": false
      }
    },
    "metadata": {
      "type": "object",
      "required": ["generated_at", "commit_hash", "total_entries"],
      "properties": {
        "generated_at": {
          "type": "string",
          "format": "date-time"
        },
        "commit_hash": {
          "type": "string"
        },
        "total_entries": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
