{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/weavz-io/json-schema/weavz-io-mcp-server-schema.json",
  "title": "McpServer",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/weavz-io-openapi.json#/components/schemas/McpServer",
  "type": "object",
  "required": [
    "id",
    "orgId",
    "name",
    "mode",
    "settings",
    "createdBy",
    "createdAt",
    "updatedAt",
    "mcpEndpoint"
  ],
  "properties": {
    "isCanonical": {
      "type": "boolean",
      "description": "The primary endpoint belonging to this MCP Workspace. False identifies a legacy compatibility endpoint."
    },
    "allowWorkspaceMembers": {
      "type": "boolean",
      "description": "Allows authenticated organization members to authorize this endpoint, in addition to pre-added users."
    },
    "id": {
      "type": "string",
      "description": "Server ID (without 'srv_' prefix)"
    },
    "orgId": {
      "type": "string"
    },
    "workspaceId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "TOOLS",
        "CODE"
      ],
      "description": "Server mode (TOOLS for individual tools, CODE for code-mode meta-tools)"
    },
    "settings": {
      "$ref": "#/$defs/McpServerSettings"
    },
    "authMode": {
      "type": "string",
      "enum": [
        "oauth",
        "bearer",
        "oauth_and_bearer"
      ],
      "description": "MCP authentication mode. OAuth is recommended for interactive clients; bearer mode supports end-user scoped bearer tokens and may also have a static service token when safe."
    },
    "endUserAccess": {
      "type": "string",
      "enum": [
        "restricted",
        "open"
      ],
      "description": "Controls who can complete MCP OAuth. restricted allows pre-added workspace end users only; open creates or links an end user during OAuth sign-in."
    },
    "auth": {
      "type": "object",
      "properties": {
        "oauthEnabled": {
          "type": "boolean"
        },
        "bearerEnabled": {
          "type": "boolean",
          "description": "True when a shared static server bearer token exists."
        },
        "staticBearerEnabled": {
          "type": "boolean",
          "description": "True when a shared static server bearer token exists."
        },
        "endUserBearerTokensEnabled": {
          "type": "boolean",
          "description": "True when API-created end-user bearer tokens are accepted for this server."
        },
        "accessTokensEnabled": {
          "type": "boolean",
          "description": "True when programmatic end-user bearer tokens can be issued."
        }
      }
    },
    "createdBy": {
      "type": "string"
    },
    "endUserId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The end user's external ID (your application's user identifier), or null if not user-scoped"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "mcpEndpoint": {
      "type": "string",
      "format": "uri",
      "description": "Full MCP protocol endpoint URL"
    }
  },
  "$defs": {
    "McpServerSettings": {
      "type": "object",
      "properties": {
        "codeMode": {
          "type": "object",
          "properties": {
            "approvalWaitSeconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 60,
              "description": "Seconds to keep a Code Mode approval continuation call open while a Human Gate is pending. Defaults to 0."
            }
          }
        },
        "mcpApp": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Exposes the Weavz MCP App tools and HTML resources on this server endpoint. Defaults to false unless enabled explicitly."
            }
          }
        }
      }
    }
  }
}