{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://nod.n8n.io/docs/schemas/apps/v1/app.schema.json"
    },
    "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
    },
    "icon": {
      "type": "string",
      "pattern": "^\\.\\/io\\.n8n\\.nod\\/(?:[a-zA-Z0-9_-]+\\/)*[a-zA-Z0-9_-]+\\.(?:svg|png|webp)$"
    },
    "categories": {
      "default": [],
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 50,
        "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
      }
    },
    "prompts": {
      "minItems": 2,
      "maxItems": 4,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 240,
        "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
      }
    },
    "requirements": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 300,
        "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
      }
    },
    "limitations": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 300,
        "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
      }
    },
    "connection": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "mcp"
            },
            "server": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "oauth2"
                }
              ],
              "items": false,
              "minItems": 1,
              "maxItems": 1
            },
            "scopes": {
              "maxItems": 30,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
              }
            }
          },
          "required": ["type", "server", "authentication"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "mcp"
            },
            "server": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "enum": ["bearer", "x-api-key"]
                }
              ],
              "items": false,
              "minItems": 1,
              "maxItems": 1
            }
          },
          "required": ["type", "server", "authentication"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "mcp"
            },
            "endpoint": {
              "type": "object",
              "properties": {
                "source": {
                  "type": "string",
                  "const": "owner"
                },
                "path": {
                  "type": "string",
                  "pattern": "^\\/(?:[a-zA-Z0-9_-]+\\/)*[a-zA-Z0-9_-]+$"
                }
              },
              "required": ["source", "path"],
              "additionalProperties": false
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "oauth2"
                },
                {
                  "type": "string",
                  "const": "bearer"
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "required": ["type", "endpoint", "authentication"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "http"
            },
            "url": {
              "allOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "string",
                  "maxLength": 2048,
                  "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                }
              ]
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "oauth2"
                }
              ],
              "items": false,
              "minItems": 1,
              "maxItems": 1
            },
            "scopes": {
              "maxItems": 30,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
              }
            },
            "oauth": {
              "type": "object",
              "properties": {
                "issuer": {
                  "allOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "string",
                      "maxLength": 2048,
                      "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                    }
                  ]
                },
                "authorization_endpoint": {
                  "allOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "string",
                      "maxLength": 2048,
                      "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                    }
                  ]
                },
                "token_endpoint": {
                  "allOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "string",
                      "maxLength": 2048,
                      "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                    }
                  ]
                },
                "registration_endpoint": {
                  "allOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "string",
                      "maxLength": 2048,
                      "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                    }
                  ]
                },
                "response_types_supported": {
                  "default": ["code"],
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string",
                      "const": "code"
                    }
                  ],
                  "items": false,
                  "minItems": 1,
                  "maxItems": 1
                },
                "code_challenge_methods_supported": {
                  "default": ["S256"],
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string",
                      "const": "S256"
                    }
                  ],
                  "items": false,
                  "minItems": 1,
                  "maxItems": 1
                },
                "token_endpoint_auth_methods_supported": {
                  "default": ["none"],
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string",
                      "const": "none"
                    }
                  ],
                  "items": false,
                  "minItems": 1,
                  "maxItems": 1
                },
                "authorization_response_iss_parameter_supported": {
                  "type": "boolean"
                }
              },
              "required": ["issuer", "authorization_endpoint", "token_endpoint"],
              "additionalProperties": false
            },
            "clientIdRequired": {
              "type": "boolean"
            }
          },
          "required": ["type", "url", "authentication"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "http"
            },
            "url": {
              "allOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "string",
                  "maxLength": 2048,
                  "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                }
              ]
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "bearer"
                }
              ],
              "items": false,
              "minItems": 1,
              "maxItems": 1
            }
          },
          "required": ["type", "url", "authentication"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "http"
            },
            "url": {
              "allOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "string",
                  "maxLength": 2048,
                  "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                }
              ]
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "x-api-key"
                }
              ],
              "items": false,
              "minItems": 1,
              "maxItems": 1
            },
            "apiKeyHeader": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^(?!(?:[hH][oO][sS][tT]|[cC][oO][oO][kK][iI][eE]|[sS][eE][tT]-[cC][oO][oO][kK][iI][eE]|[cC][oO][nN][nN][eE][cC][tT][iI][oO][nN]|[cC][oO][nN][tT][eE][nN][tT]-.*|[tT][rR][aA][nN][sS][fF][eE][rR]-[eE][nN][cC][oO][dD][iI][nN][gG]|[pP][rR][oO][xX][yY]-.*|[aA][cC][cC][eE][pP][tT]|[uU][sS][eE][rR]-[aA][gG][eE][nN][tT]|[uU][pP][gG][rR][aA][dD][eE]|[tT][eE]|[tT][rR][aA][iI][lL][eE][rR])$)[!#$%&'*+.^_`|~0-9A-Za-z-]+$"
            }
          },
          "required": ["type", "url", "authentication"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "cli"
            },
            "command": {
              "type": "string",
              "pattern": "^(?!(?:[bB][aA][sS][hH]|[dD][aA][sS][hH]|[eE][nN][vV]|[fF][iI][sS][hH]|[nN][oO][dD][eE]|[nN][pP][xX]|[nN][pP][mM]|[pP][yY][tT][hH][oO][nN][0-9]*|[sS][hH]|[sS][uU]|[sS][uU][dD][oO]|[zZ][sS][hH])$)[A-Za-z][A-Za-z0-9_-]{0,63}$"
            },
            "source": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "npm": {
                      "type": "string",
                      "maxLength": 512,
                      "pattern": "^(?:@[a-z0-9][a-z0-9._-]*\\/)?[a-z0-9][a-z0-9._-]*@\\d+\\.\\d+\\.\\d+(?:-[a-zA-Z0-9.-]+)?$"
                    }
                  },
                  "required": ["npm"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "pypi": {
                      "type": "string",
                      "maxLength": 512,
                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*==\\d+(?:\\.\\d+)+(?:[a-zA-Z0-9.]+)?$"
                    }
                  },
                  "required": ["pypi"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "url": {
                      "allOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "string",
                          "maxLength": 2048,
                          "pattern": "^[hH][tT][tT][pP][sS]:\\/\\/"
                        }
                      ]
                    },
                    "sha256": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    }
                  },
                  "required": ["url", "sha256"],
                  "additionalProperties": false
                }
              ]
            },
            "authentication": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "string",
                  "const": "env"
                }
              ],
              "items": false,
              "minItems": 1,
              "maxItems": 1
            },
            "environment": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "maxLength": 64,
                "pattern": "^(?=.*(?:TOKEN|KEY|SECRET|PASSWORD|_ID|_SID|USERNAME|USER|EMAIL|URL)$)[A-Z][A-Z0-9_]*$"
              },
              "additionalProperties": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
              },
              "minProperties": 1,
              "maxProperties": 16
            }
          },
          "required": ["type", "command", "source", "authentication", "environment"],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": ["$schema", "displayName", "prompts", "requirements", "limitations", "connection"],
  "additionalProperties": false,
  "$id": "https://nod.n8n.io/docs/schemas/apps/v1/app.schema.json",
  "title": "Nod app profile v1"
}
