{
  "description": "VirtualMCPServer is the Schema for the virtualmcpservers API\nVirtualMCPServer aggregates multiple backend MCPServers into a unified endpoint",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "VirtualMCPServerSpec defines the desired state of VirtualMCPServer",
      "properties": {
        "authServerConfig": {
          "additionalProperties": false,
          "description": "AuthServerConfig configures an embedded OAuth authorization server.\nWhen set, the vMCP server acts as an OIDC issuer, drives users through\nupstream IDPs, and issues ToolHive JWTs. The embedded AS becomes the\nIncomingAuth OIDC provider — its issuer must match IncomingAuth.OIDCConfigRef\nso that tokens it issues are accepted by the vMCP's incoming auth middleware.\nWhen nil, IncomingAuth uses an external IDP and behavior is unchanged.",
          "properties": {
            "authorizationEndpointBaseUrl": {
              "description": "AuthorizationEndpointBaseURL overrides the base URL used for the authorization_endpoint\nin the OAuth discovery document. When set, the discovery document will advertise\n`{authorizationEndpointBaseUrl}/oauth/authorize` instead of `{issuer}/oauth/authorize`.\nAll other endpoints (token, registration, JWKS) remain derived from the issuer.\nThis is useful when the browser-facing authorization endpoint needs to be on a\ndifferent host than the issuer used for backend-to-backend calls.\nMust be a valid HTTPS URL (or HTTP for localhost) without query, fragment, or trailing slash.",
              "pattern": "^https?://[^\\s?#]+[^/\\s?#]$",
              "type": [
                "string",
                "null"
              ]
            },
            "hmacSecretRefs": {
              "description": "HMACSecretRefs references Kubernetes Secrets containing symmetric secrets for signing\nauthorization codes and refresh tokens (opaque tokens).\nCurrent secret must be at least 32 bytes and cryptographically random.\nSupports secret rotation via multiple entries (first is current, rest are for verification).\nIf not specified, an ephemeral secret will be auto-generated (development only -\nauth codes and refresh tokens will be invalid after restart).",
              "items": {
                "additionalProperties": false,
                "description": "SecretKeyRef is a reference to a key within a Secret",
                "properties": {
                  "key": {
                    "description": "Key is the key within the secret",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name is the name of the secret",
                    "type": "string"
                  }
                },
                "required": [
                  "key",
                  "name"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ],
              "x-kubernetes-list-type": "atomic"
            },
            "issuer": {
              "description": "Issuer is the issuer identifier for this authorization server.\nThis will be included in the \"iss\" claim of issued tokens.\nMust be a valid HTTPS URL (or HTTP for localhost) without query, fragment, or trailing slash (per RFC 8414).",
              "pattern": "^https?://[^\\s?#]+[^/\\s?#]$",
              "type": "string"
            },
            "signingKeySecretRefs": {
              "description": "SigningKeySecretRefs references Kubernetes Secrets containing signing keys for JWT operations.\nSupports key rotation by allowing multiple keys (oldest keys are used for verification only).\nIf not specified, an ephemeral signing key will be auto-generated (development only -\nJWTs will be invalid after restart).",
              "items": {
                "additionalProperties": false,
                "description": "SecretKeyRef is a reference to a key within a Secret",
                "properties": {
                  "key": {
                    "description": "Key is the key within the secret",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name is the name of the secret",
                    "type": "string"
                  }
                },
                "required": [
                  "key",
                  "name"
                ],
                "type": "object"
              },
              "maxItems": 5,
              "type": [
                "array",
                "null"
              ],
              "x-kubernetes-list-type": "atomic"
            },
            "storage": {
              "additionalProperties": false,
              "description": "Storage configures the storage backend for the embedded auth server.\nIf not specified, defaults to in-memory storage.",
              "properties": {
                "redis": {
                  "additionalProperties": false,
                  "description": "Redis configures the Redis storage backend.\nRequired when type is \"redis\".",
                  "properties": {
                    "aclUserConfig": {
                      "additionalProperties": false,
                      "description": "ACLUserConfig configures Redis ACL user authentication.",
                      "properties": {
                        "passwordSecretRef": {
                          "additionalProperties": false,
                          "description": "PasswordSecretRef references a Secret containing the Redis ACL password.",
                          "properties": {
                            "key": {
                              "description": "Key is the key within the secret",
                              "type": "string"
                            },
                            "name": {
                              "description": "Name is the name of the secret",
                              "type": "string"
                            }
                          },
                          "required": [
                            "key",
                            "name"
                          ],
                          "type": "object"
                        },
                        "usernameSecretRef": {
                          "additionalProperties": false,
                          "description": "UsernameSecretRef references a Secret containing the Redis ACL username.",
                          "properties": {
                            "key": {
                              "description": "Key is the key within the secret",
                              "type": "string"
                            },
                            "name": {
                              "description": "Name is the name of the secret",
                              "type": "string"
                            }
                          },
                          "required": [
                            "key",
                            "name"
                          ],
                          "type": "object"
                        }
                      },
                      "required": [
                        "passwordSecretRef",
                        "usernameSecretRef"
                      ],
                      "type": "object"
                    },
                    "dialTimeout": {
                      "default": "5s",
                      "description": "DialTimeout is the timeout for establishing connections.\nFormat: Go duration string (e.g., \"5s\", \"1m\").",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "readTimeout": {
                      "default": "3s",
                      "description": "ReadTimeout is the timeout for socket reads.\nFormat: Go duration string (e.g., \"3s\", \"1m\").",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentinelConfig": {
                      "additionalProperties": false,
                      "description": "SentinelConfig holds Redis Sentinel configuration.",
                      "properties": {
                        "db": {
                          "default": 0,
                          "description": "DB is the Redis database number.",
                          "format": "int32",
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "masterName": {
                          "description": "MasterName is the name of the Redis master monitored by Sentinel.",
                          "type": "string"
                        },
                        "sentinelAddrs": {
                          "description": "SentinelAddrs is a list of Sentinel host:port addresses.\nMutually exclusive with SentinelService.",
                          "items": {
                            "type": "string"
                          },
                          "type": [
                            "array",
                            "null"
                          ],
                          "x-kubernetes-list-type": "atomic"
                        },
                        "sentinelService": {
                          "additionalProperties": false,
                          "description": "SentinelService enables automatic discovery from a Kubernetes Service.\nMutually exclusive with SentinelAddrs.",
                          "properties": {
                            "name": {
                              "description": "Name of the Sentinel Service.",
                              "type": "string"
                            },
                            "namespace": {
                              "description": "Namespace of the Sentinel Service (defaults to same namespace).",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "port": {
                              "default": 26379,
                              "description": "Port of the Sentinel service.",
                              "format": "int32",
                              "type": [
                                "integer",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "name"
                          ],
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "masterName"
                      ],
                      "type": "object"
                    },
                    "sentinelTls": {
                      "additionalProperties": false,
                      "description": "SentinelTLS configures TLS for connections to Sentinel instances.\nPresence of this field enables TLS. Omit to use plaintext.\nWhen omitted, sentinel connections use plaintext (no fallback to TLS config).",
                      "properties": {
                        "caCertSecretRef": {
                          "additionalProperties": false,
                          "description": "CACertSecretRef references a Secret containing a PEM-encoded CA certificate\nfor verifying the server. When not specified, system root CAs are used.",
                          "properties": {
                            "key": {
                              "description": "Key is the key within the secret",
                              "type": "string"
                            },
                            "name": {
                              "description": "Name is the name of the secret",
                              "type": "string"
                            }
                          },
                          "required": [
                            "key",
                            "name"
                          ],
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "insecureSkipVerify": {
                          "description": "InsecureSkipVerify skips TLS certificate verification.\nUse when connecting to services with self-signed certificates.",
                          "type": [
                            "boolean",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "tls": {
                      "additionalProperties": false,
                      "description": "TLS configures TLS for connections to the Redis/Valkey master.\nPresence of this field enables TLS. Omit to use plaintext.",
                      "properties": {
                        "caCertSecretRef": {
                          "additionalProperties": false,
                          "description": "CACertSecretRef references a Secret containing a PEM-encoded CA certificate\nfor verifying the server. When not specified, system root CAs are used.",
                          "properties": {
                            "key": {
                              "description": "Key is the key within the secret",
                              "type": "string"
                            },
                            "name": {
                              "description": "Name is the name of the secret",
                              "type": "string"
                            }
                          },
                          "required": [
                            "key",
                            "name"
                          ],
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "insecureSkipVerify": {
                          "description": "InsecureSkipVerify skips TLS certificate verification.\nUse when connecting to services with self-signed certificates.",
                          "type": [
                            "boolean",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "writeTimeout": {
                      "default": "3s",
                      "description": "WriteTimeout is the timeout for socket writes.\nFormat: Go duration string (e.g., \"3s\", \"1m\").",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "aclUserConfig",
                    "sentinelConfig"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": {
                  "default": "memory",
                  "description": "Type specifies the storage backend type.\nValid values: \"memory\" (default), \"redis\".",
                  "enum": [
                    "memory",
                    "redis"
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "tokenLifespans": {
              "additionalProperties": false,
              "description": "TokenLifespans configures the duration that various tokens are valid.\nIf not specified, defaults are applied (access: 1h, refresh: 7d, authCode: 10m).",
              "properties": {
                "accessTokenLifespan": {
                  "description": "AccessTokenLifespan is the duration that access tokens are valid.\nFormat: Go duration string (e.g., \"1h\", \"30m\", \"24h\").\nIf empty, defaults to 1 hour.",
                  "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "authCodeLifespan": {
                  "description": "AuthCodeLifespan is the duration that authorization codes are valid.\nFormat: Go duration string (e.g., \"10m\", \"5m\").\nIf empty, defaults to 10 minutes.",
                  "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "refreshTokenLifespan": {
                  "description": "RefreshTokenLifespan is the duration that refresh tokens are valid.\nFormat: Go duration string (e.g., \"168h\", \"7d\" as \"168h\").\nIf empty, defaults to 7 days (168h).",
                  "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "upstreamProviders": {
              "description": "UpstreamProviders configures connections to upstream Identity Providers.\nThe embedded auth server delegates authentication to these providers.\nMCPServer and MCPRemoteProxy support a single upstream; VirtualMCPServer supports multiple.",
              "items": {
                "additionalProperties": false,
                "description": "UpstreamProviderConfig defines configuration for an upstream Identity Provider.",
                "properties": {
                  "name": {
                    "description": "Name uniquely identifies this upstream provider.\nUsed for routing decisions and session binding in multi-upstream scenarios.\nMust be lowercase alphanumeric with hyphens (DNS-label-like).",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
                    "type": "string"
                  },
                  "oauth2Config": {
                    "additionalProperties": false,
                    "description": "OAuth2Config contains OAuth 2.0-specific configuration.\nRequired when Type is \"oauth2\", must be nil when Type is \"oidc\".",
                    "properties": {
                      "authorizationEndpoint": {
                        "description": "AuthorizationEndpoint is the URL for the OAuth authorization endpoint.",
                        "pattern": "^https?://.*$",
                        "type": "string"
                      },
                      "clientId": {
                        "description": "ClientID is the OAuth 2.0 client identifier registered with the upstream IDP.",
                        "type": "string"
                      },
                      "clientSecretRef": {
                        "additionalProperties": false,
                        "description": "ClientSecretRef references a Kubernetes Secret containing the OAuth 2.0 client secret.\nOptional for public clients using PKCE instead of client secret.",
                        "properties": {
                          "key": {
                            "description": "Key is the key within the secret",
                            "type": "string"
                          },
                          "name": {
                            "description": "Name is the name of the secret",
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "name"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "redirectUri": {
                        "description": "RedirectURI is the callback URL where the upstream IDP will redirect after authentication.\nWhen not specified, defaults to `{resourceUrl}/oauth/callback` where `resourceUrl` is the\nURL associated with the resource (e.g., MCPServer or vMCP) using this config.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "scopes": {
                        "description": "Scopes are the OAuth scopes to request from the upstream IDP.",
                        "items": {
                          "type": "string"
                        },
                        "type": [
                          "array",
                          "null"
                        ],
                        "x-kubernetes-list-type": "atomic"
                      },
                      "tokenEndpoint": {
                        "description": "TokenEndpoint is the URL for the OAuth token endpoint.",
                        "pattern": "^https?://.*$",
                        "type": "string"
                      },
                      "tokenResponseMapping": {
                        "additionalProperties": false,
                        "description": "TokenResponseMapping configures custom field extraction from non-standard token responses.\nSome OAuth providers (e.g., GovSlack) nest token fields under non-standard paths\ninstead of returning them at the top level. When set, ToolHive performs the token\nexchange HTTP call directly and extracts fields using the configured dot-notation paths.\nIf nil, standard OAuth 2.0 token response parsing is used.",
                        "properties": {
                          "accessTokenPath": {
                            "description": "AccessTokenPath is the dot-notation path to the access token in the response.\nExample: \"authed_user.access_token\"",
                            "minLength": 1,
                            "type": "string"
                          },
                          "expiresInPath": {
                            "description": "ExpiresInPath is the dot-notation path to the expires_in value (in seconds).\nIf not specified, defaults to \"expires_in\".",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "refreshTokenPath": {
                            "description": "RefreshTokenPath is the dot-notation path to the refresh token in the response.\nIf not specified, defaults to \"refresh_token\".",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scopePath": {
                            "description": "ScopePath is the dot-notation path to the scope string in the response.\nIf not specified, defaults to \"scope\".",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "accessTokenPath"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "userInfo": {
                        "additionalProperties": false,
                        "description": "UserInfo contains configuration for fetching user information from the upstream provider.\nRequired for OAuth2 providers to resolve user identity.",
                        "properties": {
                          "additionalHeaders": {
                            "additionalProperties": {
                              "type": "string"
                            },
                            "description": "AdditionalHeaders contains extra headers to include in the userinfo request.\nUseful for providers that require specific headers (e.g., GitHub's Accept header).",
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "endpointUrl": {
                            "description": "EndpointURL is the URL of the userinfo endpoint.",
                            "pattern": "^https?://.*$",
                            "type": "string"
                          },
                          "fieldMapping": {
                            "additionalProperties": false,
                            "description": "FieldMapping contains custom field mapping configuration for non-standard providers.\nIf nil, standard OIDC field names are used (\"sub\", \"name\", \"email\").",
                            "properties": {
                              "emailFields": {
                                "description": "EmailFields is an ordered list of field names to try for the email address.\nThe first non-empty value found will be used.\nDefault: [\"email\"]",
                                "items": {
                                  "type": "string"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "x-kubernetes-list-type": "atomic"
                              },
                              "nameFields": {
                                "description": "NameFields is an ordered list of field names to try for the display name.\nThe first non-empty value found will be used.\nDefault: [\"name\"]",
                                "items": {
                                  "type": "string"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "x-kubernetes-list-type": "atomic"
                              },
                              "subjectFields": {
                                "description": "SubjectFields is an ordered list of field names to try for the user ID.\nThe first non-empty value found will be used.\nDefault: [\"sub\"]",
                                "items": {
                                  "type": "string"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "x-kubernetes-list-type": "atomic"
                              }
                            },
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "httpMethod": {
                            "description": "HTTPMethod is the HTTP method to use for the userinfo request.\nIf not specified, defaults to GET.",
                            "enum": [
                              "GET",
                              "POST"
                            ],
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "endpointUrl"
                        ],
                        "type": "object"
                      }
                    },
                    "required": [
                      "authorizationEndpoint",
                      "clientId",
                      "tokenEndpoint",
                      "userInfo"
                    ],
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "oidcConfig": {
                    "additionalProperties": false,
                    "description": "OIDCConfig contains OIDC-specific configuration.\nRequired when Type is \"oidc\", must be nil when Type is \"oauth2\".",
                    "properties": {
                      "clientId": {
                        "description": "ClientID is the OAuth 2.0 client identifier registered with the upstream IDP.",
                        "type": "string"
                      },
                      "clientSecretRef": {
                        "additionalProperties": false,
                        "description": "ClientSecretRef references a Kubernetes Secret containing the OAuth 2.0 client secret.\nOptional for public clients using PKCE instead of client secret.",
                        "properties": {
                          "key": {
                            "description": "Key is the key within the secret",
                            "type": "string"
                          },
                          "name": {
                            "description": "Name is the name of the secret",
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "name"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "issuerUrl": {
                        "description": "IssuerURL is the OIDC issuer URL for automatic endpoint discovery.\nMust be a valid HTTPS URL.",
                        "pattern": "^https://.*$",
                        "type": "string"
                      },
                      "redirectUri": {
                        "description": "RedirectURI is the callback URL where the upstream IDP will redirect after authentication.\nWhen not specified, defaults to `{resourceUrl}/oauth/callback` where `resourceUrl` is the\nURL associated with the resource (e.g., MCPServer or vMCP) using this config.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "scopes": {
                        "description": "Scopes are the OAuth scopes to request from the upstream IDP.\nIf not specified, defaults to [\"openid\", \"offline_access\"].",
                        "items": {
                          "type": "string"
                        },
                        "type": [
                          "array",
                          "null"
                        ],
                        "x-kubernetes-list-type": "atomic"
                      },
                      "userInfoOverride": {
                        "additionalProperties": false,
                        "description": "UserInfoOverride allows customizing UserInfo fetching behavior for OIDC providers.\nBy default, the UserInfo endpoint is discovered automatically via OIDC discovery.\nUse this to override the endpoint URL, HTTP method, or field mappings for providers\nthat return non-standard claim names in their UserInfo response.",
                        "properties": {
                          "additionalHeaders": {
                            "additionalProperties": {
                              "type": "string"
                            },
                            "description": "AdditionalHeaders contains extra headers to include in the userinfo request.\nUseful for providers that require specific headers (e.g., GitHub's Accept header).",
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "endpointUrl": {
                            "description": "EndpointURL is the URL of the userinfo endpoint.",
                            "pattern": "^https?://.*$",
                            "type": "string"
                          },
                          "fieldMapping": {
                            "additionalProperties": false,
                            "description": "FieldMapping contains custom field mapping configuration for non-standard providers.\nIf nil, standard OIDC field names are used (\"sub\", \"name\", \"email\").",
                            "properties": {
                              "emailFields": {
                                "description": "EmailFields is an ordered list of field names to try for the email address.\nThe first non-empty value found will be used.\nDefault: [\"email\"]",
                                "items": {
                                  "type": "string"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "x-kubernetes-list-type": "atomic"
                              },
                              "nameFields": {
                                "description": "NameFields is an ordered list of field names to try for the display name.\nThe first non-empty value found will be used.\nDefault: [\"name\"]",
                                "items": {
                                  "type": "string"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "x-kubernetes-list-type": "atomic"
                              },
                              "subjectFields": {
                                "description": "SubjectFields is an ordered list of field names to try for the user ID.\nThe first non-empty value found will be used.\nDefault: [\"sub\"]",
                                "items": {
                                  "type": "string"
                                },
                                "type": [
                                  "array",
                                  "null"
                                ],
                                "x-kubernetes-list-type": "atomic"
                              }
                            },
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "httpMethod": {
                            "description": "HTTPMethod is the HTTP method to use for the userinfo request.\nIf not specified, defaults to GET.",
                            "enum": [
                              "GET",
                              "POST"
                            ],
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "endpointUrl"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "clientId",
                      "issuerUrl"
                    ],
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "type": {
                    "description": "Type specifies the provider type: \"oidc\" or \"oauth2\"",
                    "enum": [
                      "oidc",
                      "oauth2"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "type"
                ],
                "type": "object"
              },
              "minItems": 1,
              "type": "array",
              "x-kubernetes-list-map-keys": [
                "name"
              ],
              "x-kubernetes-list-type": "map"
            }
          },
          "required": [
            "issuer",
            "upstreamProviders"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "config": {
          "additionalProperties": false,
          "description": "Config is the Virtual MCP server configuration.\nThe audit config from here is also supported, but not required.",
          "properties": {
            "aggregation": {
              "additionalProperties": false,
              "description": "Aggregation defines tool aggregation and conflict resolution strategies.\nSupports ToolConfigRef for Kubernetes-native MCPToolConfig resource references.",
              "properties": {
                "conflictResolution": {
                  "default": "prefix",
                  "description": "ConflictResolution defines the strategy for resolving tool name conflicts.\n- prefix: Automatically prefix tool names with workload identifier\n- priority: First workload in priority order wins\n- manual: Explicitly define overrides for all conflicts",
                  "enum": [
                    "prefix",
                    "priority",
                    "manual"
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "conflictResolutionConfig": {
                  "additionalProperties": false,
                  "description": "ConflictResolutionConfig provides configuration for the chosen strategy.",
                  "properties": {
                    "prefixFormat": {
                      "default": "{workload}_",
                      "description": "PrefixFormat defines the prefix format for the \"prefix\" strategy.\nSupports placeholders: {workload}, {workload}_, {workload}.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "priorityOrder": {
                      "description": "PriorityOrder defines the workload priority order for the \"priority\" strategy.",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "excludeAllTools": {
                  "description": "ExcludeAllTools hides all backend tools from MCP clients when true.\nHidden tools are NOT advertised in tools/list responses, but they ARE\navailable in the routing table for composite tools to use.\nThis enables the use case where you want to hide raw backend tools from\ndirect client access while exposing curated composite tool workflows.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "tools": {
                  "description": "Tools defines per-workload tool filtering and overrides.",
                  "items": {
                    "additionalProperties": false,
                    "description": "WorkloadToolConfig defines tool filtering and overrides for a specific workload.",
                    "properties": {
                      "excludeAll": {
                        "description": "ExcludeAll hides all tools from this workload from MCP clients when true.\nHidden tools are NOT advertised in tools/list responses, but they ARE\navailable in the routing table for composite tools to use.\nThis enables the use case where you want to hide raw backend tools from\ndirect client access while exposing curated composite tool workflows.",
                        "type": [
                          "boolean",
                          "null"
                        ]
                      },
                      "filter": {
                        "description": "Filter is an allow-list of tool names to advertise to MCP clients.\nTools NOT in this list are hidden from clients (not in tools/list response)\nbut remain available in the routing table for composite tools to use.\nThis enables selective exposure of backend tools while allowing composite\nworkflows to orchestrate all backend capabilities.\nOnly used if ToolConfigRef is not specified.",
                        "items": {
                          "type": "string"
                        },
                        "type": [
                          "array",
                          "null"
                        ]
                      },
                      "overrides": {
                        "additionalProperties": {
                          "additionalProperties": false,
                          "description": "ToolOverride defines tool name, description, and annotation overrides.",
                          "properties": {
                            "annotations": {
                              "additionalProperties": false,
                              "description": "Annotations overrides specific tool annotation fields.\nOnly specified fields are overridden; others pass through from the backend.",
                              "properties": {
                                "destructiveHint": {
                                  "description": "DestructiveHint overrides the destructive hint annotation.",
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "idempotentHint": {
                                  "description": "IdempotentHint overrides the idempotent hint annotation.",
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "openWorldHint": {
                                  "description": "OpenWorldHint overrides the open-world hint annotation.",
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "readOnlyHint": {
                                  "description": "ReadOnlyHint overrides the read-only hint annotation.",
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "title": {
                                  "description": "Title overrides the human-readable title annotation.",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "type": [
                                "object",
                                "null"
                              ]
                            },
                            "description": {
                              "description": "Description is the new tool description.",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "name": {
                              "description": "Name is the new tool name (for renaming).",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "type": "object"
                        },
                        "description": "Overrides is an inline map of tool overrides for renaming and description changes.\nOverrides are applied to tools before conflict resolution and affect both\nadvertising and routing (the overridden name is used everywhere).\nOnly used if ToolConfigRef is not specified.",
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "toolConfigRef": {
                        "additionalProperties": false,
                        "description": "ToolConfigRef references an MCPToolConfig resource for tool filtering and renaming.\nIf specified, Filter and Overrides are ignored.\nOnly used when running in Kubernetes with the operator.",
                        "properties": {
                          "name": {
                            "description": "Name is the name of the MCPToolConfig resource in the same namespace.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "name"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "workload": {
                        "description": "Workload is the name of the backend MCPServer workload.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "workload"
                    ],
                    "type": "object"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "audit": {
              "additionalProperties": false,
              "description": "Audit configures audit logging for the Virtual MCP server.\nWhen present, audit logs include MCP protocol operations.\nSee audit.Config for available configuration options.",
              "properties": {
                "component": {
                  "description": "Component is the component name to use in audit events.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "enabled": {
                  "default": false,
                  "description": "Enabled controls whether audit logging is enabled.\nWhen true, enables audit logging with the configured options.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "eventTypes": {
                  "description": "EventTypes specifies which event types to audit. If empty, all events are audited.",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "excludeEventTypes": {
                  "description": "ExcludeEventTypes specifies which event types to exclude from auditing.\nThis takes precedence over EventTypes.",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "includeRequestData": {
                  "default": false,
                  "description": "IncludeRequestData determines whether to include request data in audit logs.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "includeResponseData": {
                  "default": false,
                  "description": "IncludeResponseData determines whether to include response data in audit logs.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "logFile": {
                  "description": "LogFile specifies the file path for audit logs. If empty, logs to stdout.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "maxDataSize": {
                  "default": 1024,
                  "description": "MaxDataSize limits the size of request/response data included in audit logs (in bytes).",
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "backends": {
              "description": "Backends defines pre-configured backend servers for static mode.\nWhen OutgoingAuth.Source is \"inline\", this field contains the full list of backend\nservers with their URLs and transport types, eliminating the need for K8s API access.\nWhen OutgoingAuth.Source is \"discovered\", this field is empty and backends are\ndiscovered at runtime via Kubernetes API.",
              "items": {
                "additionalProperties": false,
                "description": "StaticBackendConfig defines a pre-configured backend server for static mode.\nThis allows vMCP to operate without Kubernetes API access by embedding all backend\ninformation directly in the configuration.",
                "properties": {
                  "caBundlePath": {
                    "description": "CABundlePath is the file path to a custom CA certificate bundle for TLS verification.\nOnly valid when Type is \"entry\". The operator mounts CA bundles at\n/etc/toolhive/ca-bundles/\u003cname\u003e/ca.crt.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "metadata": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Metadata is a custom key-value map for storing additional backend information\nsuch as labels, tags, or other arbitrary data (e.g., \"env\": \"prod\", \"region\": \"us-east-1\").\nThis is NOT Kubernetes ObjectMeta - it's a simple string map for user-defined metadata.\nReserved keys: \"group\" is automatically set by vMCP and any user-provided value will be overridden.",
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "name": {
                    "description": "Name is the backend identifier.\nMust match the backend name from the MCPGroup for auth config resolution.",
                    "type": "string"
                  },
                  "transport": {
                    "description": "Transport is the MCP transport protocol: \"sse\" or \"streamable-http\"\nOnly network transports supported by vMCP client are allowed.",
                    "enum": [
                      "sse",
                      "streamable-http"
                    ],
                    "type": "string"
                  },
                  "type": {
                    "description": "Type is the backend workload type: \"entry\" for MCPServerEntry backends, or empty\nfor container/proxy backends. Entry backends connect directly to remote MCP servers.",
                    "enum": [
                      "entry",
                      ""
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "url": {
                    "description": "URL is the backend's MCP server base URL.",
                    "pattern": "^https?://",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "transport",
                  "url"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "compositeToolRefs": {
              "description": "CompositeToolRefs references VirtualMCPCompositeToolDefinition resources\nfor complex, reusable workflows. Only applicable when running in Kubernetes.\nReferenced resources must be in the same namespace as the VirtualMCPServer.",
              "items": {
                "additionalProperties": false,
                "description": "CompositeToolRef defines a reference to a VirtualMCPCompositeToolDefinition resource.\nThe referenced resource must be in the same namespace as the VirtualMCPServer.",
                "properties": {
                  "name": {
                    "description": "Name is the name of the VirtualMCPCompositeToolDefinition resource in the same namespace.",
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "compositeTools": {
              "description": "CompositeTools defines inline composite tool workflows.\nFull workflow definitions are embedded in the configuration.\nFor Kubernetes, complex workflows can also reference VirtualMCPCompositeToolDefinition CRDs.",
              "items": {
                "additionalProperties": false,
                "description": "CompositeToolConfig defines a composite tool workflow.\nThis matches the YAML structure from the proposal (lines 173-255).",
                "properties": {
                  "description": {
                    "description": "Description describes what the workflow does.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "name": {
                    "description": "Name is the workflow name (unique identifier).",
                    "type": "string"
                  },
                  "output": {
                    "additionalProperties": false,
                    "description": "Output defines the structured output schema for this workflow.\nIf not specified, the workflow returns the last step's output (backward compatible).",
                    "properties": {
                      "properties": {
                        "additionalProperties": {
                          "additionalProperties": false,
                          "description": "OutputProperty defines a single output property.\nFor non-object types, Value is required.\nFor object types, either Value or Properties must be specified (but not both).",
                          "properties": {
                            "default": {
                              "description": "Default is the fallback value if template expansion fails.\nType coercion is applied to match the declared Type.",
                              "x-kubernetes-preserve-unknown-fields": true
                            },
                            "description": {
                              "description": "Description is a human-readable description exposed to clients and models",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "properties": {
                              "description": "Properties defines nested properties for object types.\nEach nested property has full metadata (type, description, value/properties).",
                              "type": [
                                "object",
                                "null"
                              ],
                              "x-kubernetes-preserve-unknown-fields": true
                            },
                            "type": {
                              "description": "Type is the JSON Schema type: \"string\", \"integer\", \"number\", \"boolean\", \"object\", \"array\"",
                              "enum": [
                                "string",
                                "integer",
                                "number",
                                "boolean",
                                "object",
                                "array"
                              ],
                              "type": "string"
                            },
                            "value": {
                              "description": "Value is a template string for constructing the runtime value.\nFor object types, this can be a JSON string that will be deserialized.\nSupports template syntax: {{.steps.step_id.output.field}}, {{.params.param_name}}",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "type"
                          ],
                          "type": "object"
                        },
                        "description": "Properties defines the output properties.\nMap key is the property name, value is the property definition.",
                        "type": "object"
                      },
                      "required": {
                        "description": "Required lists property names that must be present in the output.",
                        "items": {
                          "type": "string"
                        },
                        "type": [
                          "array",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "properties"
                    ],
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "parameters": {
                    "description": "Parameters defines input parameter schema in JSON Schema format.\nShould be a JSON Schema object with \"type\": \"object\" and \"properties\".\nExample:\n  {\n    \"type\": \"object\",\n    \"properties\": {\n      \"param1\": {\"type\": \"string\", \"default\": \"value\"},\n      \"param2\": {\"type\": \"integer\"}\n    },\n    \"required\": [\"param2\"]\n  }\n\nWe use json.Map rather than a typed struct because JSON Schema is highly\nflexible with many optional fields (default, enum, minimum, maximum, pattern,\nitems, additionalProperties, oneOf, anyOf, allOf, etc.). Using json.Map\nallows full JSON Schema compatibility without needing to define every possible\nfield, and matches how the MCP SDK handles inputSchema.",
                    "type": [
                      "object",
                      "null"
                    ],
                    "x-kubernetes-preserve-unknown-fields": true
                  },
                  "steps": {
                    "description": "Steps are the workflow steps to execute.",
                    "items": {
                      "additionalProperties": false,
                      "description": "WorkflowStepConfig defines a single workflow step.\nThis matches the proposal's step configuration (lines 180-255).",
                      "properties": {
                        "arguments": {
                          "description": "Arguments is a map of argument values with template expansion support.\nSupports Go template syntax with .params and .steps for string values.\nNon-string values (integers, booleans, arrays, objects) are passed as-is.\nNote: the templating is only supported on the first level of the key-value pairs.",
                          "type": [
                            "object",
                            "null"
                          ],
                          "x-kubernetes-preserve-unknown-fields": true
                        },
                        "collection": {
                          "description": "Collection is a Go template expression that resolves to a JSON array or a slice.\nOnly used when Type is \"forEach\".",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "condition": {
                          "description": "Condition is a template expression that determines if the step should execute",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "defaultResults": {
                          "description": "DefaultResults provides fallback output values when this step is skipped\n(due to condition evaluating to false) or fails (when onError.action is \"continue\").\nEach key corresponds to an output field name referenced by downstream steps.\nRequired if the step may be skipped AND downstream steps reference this step's output.",
                          "x-kubernetes-preserve-unknown-fields": true
                        },
                        "dependsOn": {
                          "description": "DependsOn lists step IDs that must complete before this step",
                          "items": {
                            "type": "string"
                          },
                          "type": [
                            "array",
                            "null"
                          ]
                        },
                        "id": {
                          "description": "ID is the unique identifier for this step.",
                          "type": "string"
                        },
                        "itemVar": {
                          "description": "ItemVar is the variable name used to reference the current item in forEach templates.\nDefaults to \"item\" if not specified.\nOnly used when Type is \"forEach\".",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "maxIterations": {
                          "description": "MaxIterations limits the number of items that can be iterated over.\nDefaults to 100, hard cap at 1000.\nOnly used when Type is \"forEach\".",
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "maxParallel": {
                          "description": "MaxParallel limits the number of concurrent iterations in a forEach step.\nDefaults to the DAG executor's maxParallel (10).\nOnly used when Type is \"forEach\".",
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "message": {
                          "description": "Message is the elicitation message\nOnly used when Type is \"elicitation\"",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "onCancel": {
                          "additionalProperties": false,
                          "description": "OnCancel defines the action to take when the user cancels/dismisses the elicitation\nOnly used when Type is \"elicitation\"",
                          "properties": {
                            "action": {
                              "default": "abort",
                              "description": "Action defines the action to take when the user declines or cancels\n- skip_remaining: Skip remaining steps in the workflow\n- abort: Abort the entire workflow execution\n- continue: Continue to the next step",
                              "enum": [
                                "skip_remaining",
                                "abort",
                                "continue"
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "onDecline": {
                          "additionalProperties": false,
                          "description": "OnDecline defines the action to take when the user explicitly declines the elicitation\nOnly used when Type is \"elicitation\"",
                          "properties": {
                            "action": {
                              "default": "abort",
                              "description": "Action defines the action to take when the user declines or cancels\n- skip_remaining: Skip remaining steps in the workflow\n- abort: Abort the entire workflow execution\n- continue: Continue to the next step",
                              "enum": [
                                "skip_remaining",
                                "abort",
                                "continue"
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "onError": {
                          "additionalProperties": false,
                          "description": "OnError defines error handling behavior",
                          "properties": {
                            "action": {
                              "default": "abort",
                              "description": "Action defines the action to take on error",
                              "enum": [
                                "abort",
                                "continue",
                                "retry"
                              ],
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "retryCount": {
                              "description": "RetryCount is the maximum number of retries\nOnly used when Action is \"retry\"",
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "retryDelay": {
                              "description": "RetryDelay is the delay between retry attempts\nOnly used when Action is \"retry\"",
                              "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "schema": {
                          "description": "Schema defines the expected response schema for elicitation",
                          "type": [
                            "object",
                            "null"
                          ],
                          "x-kubernetes-preserve-unknown-fields": true
                        },
                        "step": {
                          "description": "InnerStep defines the step to execute for each item in the collection.\nOnly used when Type is \"forEach\". Only tool-type inner steps are supported.",
                          "type": [
                            "object",
                            "null"
                          ],
                          "x-kubernetes-preserve-unknown-fields": true
                        },
                        "timeout": {
                          "description": "Timeout is the maximum execution time for this step",
                          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tool": {
                          "description": "Tool is the tool to call (format: \"workload.tool_name\")\nOnly used when Type is \"tool\"",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "type": {
                          "default": "tool",
                          "description": "Type is the step type (tool, elicitation, etc.)",
                          "enum": [
                            "tool",
                            "elicitation",
                            "forEach"
                          ],
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "timeout": {
                    "description": "Timeout is the maximum workflow execution time.",
                    "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name",
                  "steps"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "groupRef": {
              "description": "Group references an existing MCPGroup that defines backend workloads.\nIn standalone CLI mode, this is set from the YAML config file.\nIn Kubernetes, the operator populates this from spec.groupRef during conversion.",
              "type": [
                "string",
                "null"
              ]
            },
            "incomingAuth": {
              "additionalProperties": false,
              "description": "IncomingAuth configures how clients authenticate to the virtual MCP server.\nWhen using the Kubernetes operator, this is populated by the converter from\nVirtualMCPServerSpec.IncomingAuth and any values set here will be superseded.",
              "properties": {
                "authz": {
                  "additionalProperties": false,
                  "description": "Authz contains authorization configuration (optional).",
                  "properties": {
                    "policies": {
                      "description": "Policies contains Cedar policy definitions (when Type = \"cedar\").",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "primaryUpstreamProvider": {
                      "description": "PrimaryUpstreamProvider names the upstream IDP provider whose access\ntoken should be used as the source of JWT claims for Cedar evaluation.\nWhen empty, claims from the ToolHive-issued token are used.\nMust match an upstream provider name configured in the embedded auth server\n(e.g. \"default\", \"github\"). Only relevant when the embedded auth server is active.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "description": "Type is the authz type: \"cedar\", \"none\"",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "oidc": {
                  "additionalProperties": false,
                  "description": "OIDC contains OIDC configuration (when Type = \"oidc\").",
                  "properties": {
                    "audience": {
                      "description": "Audience is the required token audience.",
                      "type": "string"
                    },
                    "clientId": {
                      "description": "ClientID is the OAuth client ID.",
                      "type": "string"
                    },
                    "clientSecretEnv": {
                      "description": "ClientSecretEnv is the name of the environment variable containing the client secret.\nThis is the secure way to reference secrets - the actual secret value is never stored\nin configuration files, only the environment variable name.\nThe secret value will be resolved from this environment variable at runtime.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "insecureAllowHttp": {
                      "description": "InsecureAllowHTTP allows HTTP (non-HTTPS) OIDC issuers for development/testing\nWARNING: This is insecure and should NEVER be used in production",
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "introspectionUrl": {
                      "description": "IntrospectionURL is the token introspection endpoint URL (RFC 7662).\nWhen set, enables token introspection for opaque (non-JWT) tokens.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "issuer": {
                      "description": "Issuer is the OIDC issuer URL.",
                      "pattern": "^https?://",
                      "type": "string"
                    },
                    "jwksAllowPrivateIp": {
                      "description": "JwksAllowPrivateIP allows OIDC discovery and JWKS fetches to private IP addresses.\nEnable when the embedded auth server runs on a loopback address and\nthe OIDC middleware needs to fetch its JWKS from that address.\nUse with caution - only enable for trusted internal IDPs or testing.",
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "jwksUrl": {
                      "description": "JWKSURL is the explicit JWKS endpoint URL.\nWhen set, skips OIDC discovery and fetches the JWKS directly from this URL.\nThis is useful when the OIDC issuer does not serve a /.well-known/openid-configuration.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "protectedResourceAllowPrivateIp": {
                      "description": "ProtectedResourceAllowPrivateIP allows protected resource endpoint on private IP addresses\nUse with caution - only enable for trusted internal IDPs or testing",
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "resource": {
                      "description": "Resource is the OAuth 2.0 resource indicator (RFC 8707).\nUsed in WWW-Authenticate header and OAuth discovery metadata (RFC 9728).\nIf not specified, defaults to Audience.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scopes": {
                      "description": "Scopes are the required OAuth scopes.",
                      "items": {
                        "type": "string"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "audience",
                    "clientId",
                    "issuer"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": {
                  "description": "Type is the auth type: \"oidc\", \"local\", \"anonymous\"",
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "metadata": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Metadata stores additional configuration metadata.",
              "type": [
                "object",
                "null"
              ]
            },
            "name": {
              "description": "Name is the virtual MCP server name.",
              "type": [
                "string",
                "null"
              ]
            },
            "operational": {
              "additionalProperties": false,
              "description": "Operational configures operational settings.",
              "properties": {
                "failureHandling": {
                  "additionalProperties": false,
                  "description": "FailureHandling configures failure handling behavior.",
                  "properties": {
                    "circuitBreaker": {
                      "additionalProperties": false,
                      "description": "CircuitBreaker configures circuit breaker behavior.",
                      "properties": {
                        "enabled": {
                          "default": false,
                          "description": "Enabled controls whether circuit breaker is enabled.",
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "failureThreshold": {
                          "default": 5,
                          "description": "FailureThreshold is the number of failures before opening the circuit.\nMust be \u003e= 1.",
                          "minimum": 1,
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "timeout": {
                          "default": "60s",
                          "description": "Timeout is the duration to wait before attempting to close the circuit.\nMust be \u003e= 1s to prevent thrashing.",
                          "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                          "type": [
                            "string",
                            "null"
                          ],
                          "x-kubernetes-validations": [
                            {
                              "message": "timeout must be \u003e= 1s",
                              "rule": "self == '' || duration(self) \u003e= duration('1s')"
                            }
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "healthCheckInterval": {
                      "default": "30s",
                      "description": "HealthCheckInterval is the interval between health checks.",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "healthCheckTimeout": {
                      "default": "10s",
                      "description": "HealthCheckTimeout is the maximum duration for a single health check operation.\nShould be less than HealthCheckInterval to prevent checks from queuing up.",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "partialFailureMode": {
                      "default": "fail",
                      "description": "PartialFailureMode defines behavior when some backends are unavailable.\n- fail: Fail entire request if any backend is unavailable\n- best_effort: Continue with available backends",
                      "enum": [
                        "fail",
                        "best_effort"
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "statusReportingInterval": {
                      "default": "30s",
                      "description": "StatusReportingInterval is the interval for reporting status updates to Kubernetes.\nThis controls how often the vMCP runtime reports backend health and phase changes.\nLower values provide faster status updates but increase API server load.",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "unhealthyThreshold": {
                      "default": 3,
                      "description": "UnhealthyThreshold is the number of consecutive failures before marking unhealthy.",
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "logLevel": {
                  "description": "LogLevel sets the logging level for the Virtual MCP server.\nThe only valid value is \"debug\" to enable debug logging.\nWhen omitted or empty, the server uses info level logging.",
                  "enum": [
                    "debug"
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "timeouts": {
                  "additionalProperties": false,
                  "description": "Timeouts configures timeout settings.",
                  "properties": {
                    "default": {
                      "default": "30s",
                      "description": "Default is the default timeout for backend requests.",
                      "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "perWorkload": {
                      "additionalProperties": {
                        "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                        "type": "string"
                      },
                      "description": "PerWorkload defines per-workload timeout overrides.",
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "optimizer": {
              "additionalProperties": false,
              "description": "Optimizer configures the MCP optimizer for context optimization on large toolsets.\nWhen enabled, vMCP exposes only find_tool and call_tool operations to clients\ninstead of all backend tools directly. This reduces token usage by allowing\nLLMs to discover relevant tools on demand rather than receiving all tool definitions.",
              "properties": {
                "embeddingService": {
                  "description": "EmbeddingService is the full base URL of the embedding service endpoint\n(e.g., http://my-embedding.default.svc.cluster.local:8080) for semantic\ntool discovery.\n\nIn a Kubernetes environment, it is more convenient to use the\nVirtualMCPServerSpec.EmbeddingServerRef field instead of setting this\ndirectly. EmbeddingServerRef references an EmbeddingServer CRD by name,\nand the operator automatically resolves the referenced resource's\nStatus.URL to populate this field. This provides managed lifecycle\n(the operator watches the EmbeddingServer for readiness and URL changes)\nand avoids hardcoding service URLs in the config. If both\nEmbeddingServerRef and this field are set, EmbeddingServerRef takes\nprecedence and this value is overridden with a warning.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "embeddingServiceTimeout": {
                  "default": "30s",
                  "description": "EmbeddingServiceTimeout is the HTTP request timeout for calls to the embedding service.\nDefaults to 30s if not specified.",
                  "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "hybridSearchSemanticRatio": {
                  "description": "HybridSearchSemanticRatio controls the balance between semantic (meaning-based)\nand keyword search results. 0.0 = all keyword, 1.0 = all semantic.\nDefaults to \"0.5\" if not specified or empty.\nSerialized as a string because CRDs do not support float types portably.",
                  "pattern": "^([0-9]*[.])?[0-9]+$",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "maxToolsToReturn": {
                  "description": "MaxToolsToReturn is the maximum number of tool results returned by a search query.\nDefaults to 8 if not specified or zero.",
                  "maximum": 50,
                  "minimum": 1,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "semanticDistanceThreshold": {
                  "description": "SemanticDistanceThreshold is the maximum distance for semantic search results.\nResults exceeding this threshold are filtered out from semantic search.\nThis threshold does not apply to keyword search.\nRange: 0 = identical, 2 = completely unrelated.\nDefaults to \"1.0\" if not specified or empty.\nSerialized as a string because CRDs do not support float types portably.",
                  "pattern": "^([0-9]*[.])?[0-9]+$",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "outgoingAuth": {
              "additionalProperties": false,
              "description": "OutgoingAuth configures how the virtual MCP server authenticates to backends.\nWhen using the Kubernetes operator, this is populated by the converter from\nVirtualMCPServerSpec.OutgoingAuth and any values set here will be superseded.",
              "properties": {
                "backends": {
                  "additionalProperties": {
                    "additionalProperties": false,
                    "description": "BackendAuthStrategy defines how to authenticate to a specific backend.\n\nThis struct provides type-safe configuration for different authentication strategies\nusing HeaderInjection or TokenExchange fields based on the Type field.",
                    "properties": {
                      "headerInjection": {
                        "additionalProperties": false,
                        "description": "HeaderInjection contains configuration for header injection auth strategy.\nUsed when Type = \"header_injection\".",
                        "properties": {
                          "headerName": {
                            "description": "HeaderName is the name of the header to inject (e.g., \"Authorization\").",
                            "type": "string"
                          },
                          "headerValue": {
                            "description": "HeaderValue is the static header value to inject.\nEither HeaderValue or HeaderValueEnv should be set, not both.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "headerValueEnv": {
                            "description": "HeaderValueEnv is the environment variable name containing the header value.\nThe value will be resolved at runtime from this environment variable.\nEither HeaderValue or HeaderValueEnv should be set, not both.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "headerName"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "tokenExchange": {
                        "additionalProperties": false,
                        "description": "TokenExchange contains configuration for token exchange auth strategy.\nUsed when Type = \"token_exchange\".",
                        "properties": {
                          "audience": {
                            "description": "Audience is the target audience for the exchanged token.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientId": {
                            "description": "ClientID is the OAuth client ID for the token exchange request.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientSecret": {
                            "description": "ClientSecret is the OAuth client secret (use ClientSecretEnv for security).",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "clientSecretEnv": {
                            "description": "ClientSecretEnv is the environment variable name containing the client secret.\nThe value will be resolved at runtime from this environment variable.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scopes": {
                            "description": "Scopes are the requested scopes for the exchanged token.",
                            "items": {
                              "type": "string"
                            },
                            "type": [
                              "array",
                              "null"
                            ]
                          },
                          "subjectProviderName": {
                            "description": "SubjectProviderName selects which upstream provider's token to use as the\nsubject token. When set, the token is looked up from Identity.UpstreamTokens\ninstead of using Identity.Token.\nWhen left empty and an embedded authorization server is configured, the system\nautomatically populates this field with the first configured upstream provider name.\nSet it explicitly to override that default or to select a specific provider when\nmultiple upstreams are configured.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subjectTokenType": {
                            "description": "SubjectTokenType is the token type of the incoming subject token.\nDefaults to \"urn:ietf:params:oauth:token-type:access_token\" if not specified.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "tokenUrl": {
                            "description": "TokenURL is the OAuth token endpoint URL for token exchange.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "tokenUrl"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      },
                      "type": {
                        "description": "Type is the auth strategy: \"unauthenticated\", \"header_injection\", \"token_exchange\", \"upstream_inject\"",
                        "type": "string"
                      },
                      "upstreamInject": {
                        "additionalProperties": false,
                        "description": "UpstreamInject contains configuration for upstream inject auth strategy.\nUsed when Type = \"upstream_inject\".",
                        "properties": {
                          "providerName": {
                            "description": "ProviderName is the name of the upstream provider configured in the\nembedded authorization server. Must match an entry in AuthServer.Upstreams.",
                            "type": "string"
                          }
                        },
                        "required": [
                          "providerName"
                        ],
                        "type": [
                          "object",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  "description": "Backends contains per-backend auth configuration.",
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "default": {
                  "additionalProperties": false,
                  "description": "Default is the default auth strategy for backends without explicit config.",
                  "properties": {
                    "headerInjection": {
                      "additionalProperties": false,
                      "description": "HeaderInjection contains configuration for header injection auth strategy.\nUsed when Type = \"header_injection\".",
                      "properties": {
                        "headerName": {
                          "description": "HeaderName is the name of the header to inject (e.g., \"Authorization\").",
                          "type": "string"
                        },
                        "headerValue": {
                          "description": "HeaderValue is the static header value to inject.\nEither HeaderValue or HeaderValueEnv should be set, not both.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "headerValueEnv": {
                          "description": "HeaderValueEnv is the environment variable name containing the header value.\nThe value will be resolved at runtime from this environment variable.\nEither HeaderValue or HeaderValueEnv should be set, not both.",
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "headerName"
                      ],
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "tokenExchange": {
                      "additionalProperties": false,
                      "description": "TokenExchange contains configuration for token exchange auth strategy.\nUsed when Type = \"token_exchange\".",
                      "properties": {
                        "audience": {
                          "description": "Audience is the target audience for the exchanged token.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientId": {
                          "description": "ClientID is the OAuth client ID for the token exchange request.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientSecret": {
                          "description": "ClientSecret is the OAuth client secret (use ClientSecretEnv for security).",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "clientSecretEnv": {
                          "description": "ClientSecretEnv is the environment variable name containing the client secret.\nThe value will be resolved at runtime from this environment variable.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scopes": {
                          "description": "Scopes are the requested scopes for the exchanged token.",
                          "items": {
                            "type": "string"
                          },
                          "type": [
                            "array",
                            "null"
                          ]
                        },
                        "subjectProviderName": {
                          "description": "SubjectProviderName selects which upstream provider's token to use as the\nsubject token. When set, the token is looked up from Identity.UpstreamTokens\ninstead of using Identity.Token.\nWhen left empty and an embedded authorization server is configured, the system\nautomatically populates this field with the first configured upstream provider name.\nSet it explicitly to override that default or to select a specific provider when\nmultiple upstreams are configured.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "subjectTokenType": {
                          "description": "SubjectTokenType is the token type of the incoming subject token.\nDefaults to \"urn:ietf:params:oauth:token-type:access_token\" if not specified.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tokenUrl": {
                          "description": "TokenURL is the OAuth token endpoint URL for token exchange.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "tokenUrl"
                      ],
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "type": {
                      "description": "Type is the auth strategy: \"unauthenticated\", \"header_injection\", \"token_exchange\", \"upstream_inject\"",
                      "type": "string"
                    },
                    "upstreamInject": {
                      "additionalProperties": false,
                      "description": "UpstreamInject contains configuration for upstream inject auth strategy.\nUsed when Type = \"upstream_inject\".",
                      "properties": {
                        "providerName": {
                          "description": "ProviderName is the name of the upstream provider configured in the\nembedded authorization server. Must match an entry in AuthServer.Upstreams.",
                          "type": "string"
                        }
                      },
                      "required": [
                        "providerName"
                      ],
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "source": {
                  "description": "Source defines how to discover backend auth: \"inline\", \"discovered\"\n- inline: Explicit configuration in OutgoingAuth\n- discovered: Auto-discover from backend MCPServer.externalAuthConfigRef (Kubernetes only)",
                  "type": "string"
                }
              },
              "required": [
                "source"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "sessionStorage": {
              "additionalProperties": false,
              "description": "SessionStorage configures session storage for stateful horizontal scaling.\nWhen provider is \"redis\", the operator injects Redis connection parameters\n(address, db, keyPrefix) here. The Redis password is provided separately via\nthe THV_SESSION_REDIS_PASSWORD environment variable.",
              "properties": {
                "address": {
                  "description": "Address is the Redis server address (required when provider is redis).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "db": {
                  "default": 0,
                  "description": "DB is the Redis database number.",
                  "format": "int32",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "keyPrefix": {
                  "description": "KeyPrefix is an optional prefix for all Redis keys used by ToolHive.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "provider": {
                  "description": "Provider is the session storage backend type.",
                  "enum": [
                    "memory",
                    "redis"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "provider"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "telemetry": {
              "additionalProperties": false,
              "description": "Telemetry configures OpenTelemetry-based observability for the Virtual MCP server\nincluding distributed tracing, OTLP metrics export, and Prometheus metrics endpoint.\nDeprecated (Kubernetes operator only): When deploying via the operator, use\nVirtualMCPServer.spec.telemetryConfigRef to reference a shared MCPTelemetryConfig\nresource instead. This field remains valid for standalone (non-operator) deployments.",
              "properties": {
                "caCertPath": {
                  "description": "CACertPath is the file path to a CA certificate bundle for the OTLP endpoint.\nWhen set, the OTLP exporters use this CA to verify the collector's TLS certificate\ninstead of relying solely on the system CA pool.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "customAttributes": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "CustomAttributes contains custom resource attributes to be added to all telemetry signals.\nThese are parsed from CLI flags (--otel-custom-attributes) or environment variables\n(OTEL_RESOURCE_ATTRIBUTES) as key=value pairs.",
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "enablePrometheusMetricsPath": {
                  "default": false,
                  "description": "EnablePrometheusMetricsPath controls whether to expose Prometheus-style /metrics endpoint.\nThe metrics are served on the main transport port at /metrics.\nThis is separate from OTLP metrics which are sent to the Endpoint.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "endpoint": {
                  "description": "Endpoint is the OTLP endpoint URL",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "environmentVariables": {
                  "description": "EnvironmentVariables is a list of environment variable names that should be\nincluded in telemetry spans as attributes. Only variables in this list will\nbe read from the host machine and included in spans for observability.\nExample: [\"NODE_ENV\", \"DEPLOYMENT_ENV\", \"SERVICE_VERSION\"]",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "headers": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "Headers contains authentication headers for the OTLP endpoint.",
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "insecure": {
                  "default": false,
                  "description": "Insecure indicates whether to use HTTP instead of HTTPS for the OTLP endpoint.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "metricsEnabled": {
                  "default": false,
                  "description": "MetricsEnabled controls whether OTLP metrics are enabled.\nWhen false, OTLP metrics are not sent even if an endpoint is configured.\nThis is independent of EnablePrometheusMetricsPath.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "samplingRate": {
                  "default": "0.05",
                  "description": "SamplingRate is the trace sampling rate (0.0-1.0) as a string.\nOnly used when TracingEnabled is true.\nExample: \"0.05\" for 5% sampling.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "serviceName": {
                  "description": "ServiceName is the service name for telemetry.\nWhen omitted, defaults to the server name (e.g., VirtualMCPServer name).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "serviceVersion": {
                  "description": "ServiceVersion is the service version for telemetry.\nWhen omitted, defaults to the ToolHive version.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tracingEnabled": {
                  "default": false,
                  "description": "TracingEnabled controls whether distributed tracing is enabled.\nWhen false, no tracer provider is created even if an endpoint is configured.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "useLegacyAttributes": {
                  "default": true,
                  "description": "UseLegacyAttributes controls whether legacy (pre-MCP OTEL semconv) attribute names\nare emitted alongside the new standard attribute names. When true, spans include both\nold and new attribute names for backward compatibility with existing dashboards.\nCurrently defaults to true; this will change to false in a future release.",
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-preserve-unknown-fields": true
        },
        "embeddingServerRef": {
          "additionalProperties": false,
          "description": "EmbeddingServerRef references an existing EmbeddingServer resource by name.\nWhen the optimizer is enabled, this field is required to point to a ready EmbeddingServer\nthat provides embedding capabilities.\nThe referenced EmbeddingServer must exist in the same namespace and be ready.",
          "properties": {
            "name": {
              "description": "Name is the name of the EmbeddingServer resource",
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "groupRef": {
          "additionalProperties": false,
          "description": "GroupRef references the MCPGroup that defines backend workloads.\nThe referenced MCPGroup must exist in the same namespace.",
          "properties": {
            "name": {
              "description": "Name is the name of the MCPGroup resource in the same namespace",
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "type": "object"
        },
        "incomingAuth": {
          "additionalProperties": false,
          "description": "IncomingAuth configures authentication for clients connecting to the Virtual MCP server.\nMust be explicitly set - use \"anonymous\" type when no authentication is required.\nThis field takes precedence over config.IncomingAuth and should be preferred because it\nsupports Kubernetes-native secret references (SecretKeyRef, ConfigMapRef) for secure\ndynamic discovery of credentials, rather than requiring secrets to be embedded in config.",
          "properties": {
            "authzConfig": {
              "additionalProperties": false,
              "description": "AuthzConfig defines authorization policy configuration\nReuses MCPServer authz patterns",
              "properties": {
                "configMap": {
                  "additionalProperties": false,
                  "description": "ConfigMap references a ConfigMap containing authorization configuration\nOnly used when Type is \"configMap\"",
                  "properties": {
                    "key": {
                      "default": "authz.json",
                      "description": "Key is the key in the ConfigMap that contains the authorization configuration",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "description": "Name is the name of the ConfigMap",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "inline": {
                  "additionalProperties": false,
                  "description": "Inline contains direct authorization configuration\nOnly used when Type is \"inline\"",
                  "properties": {
                    "entitiesJson": {
                      "default": "[]",
                      "description": "EntitiesJSON is a JSON string representing Cedar entities",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "policies": {
                      "description": "Policies is a list of Cedar policy strings",
                      "items": {
                        "type": "string"
                      },
                      "minItems": 1,
                      "type": "array",
                      "x-kubernetes-list-type": "atomic"
                    }
                  },
                  "required": [
                    "policies"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": {
                  "default": "configMap",
                  "description": "Type is the type of authorization configuration",
                  "enum": [
                    "configMap",
                    "inline"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": [
                "object",
                "null"
              ],
              "x-kubernetes-validations": [
                {
                  "message": "configMap must be set when type is 'configMap', and must not be set otherwise",
                  "rule": "self.type == 'configMap' ? has(self.configMap) : !has(self.configMap)"
                },
                {
                  "message": "inline must be set when type is 'inline', and must not be set otherwise",
                  "rule": "self.type == 'inline' ? has(self.inline) : !has(self.inline)"
                }
              ]
            },
            "oidcConfigRef": {
              "additionalProperties": false,
              "description": "OIDCConfigRef references a shared MCPOIDCConfig resource for OIDC authentication.\nThe referenced MCPOIDCConfig must exist in the same namespace as this VirtualMCPServer.\nPer-server overrides (audience, scopes) are specified here; shared provider config\nlives in the MCPOIDCConfig resource.",
              "properties": {
                "audience": {
                  "description": "Audience is the expected audience for token validation.\nThis MUST be unique per server to prevent token replay attacks.",
                  "minLength": 1,
                  "type": "string"
                },
                "name": {
                  "description": "Name is the name of the MCPOIDCConfig resource",
                  "minLength": 1,
                  "type": "string"
                },
                "resourceUrl": {
                  "description": "ResourceURL is the public URL for OAuth protected resource metadata (RFC 9728).\nWhen the server is exposed via Ingress or gateway, set this to the external\nURL that MCP clients connect to. If not specified, defaults to the internal\nKubernetes service URL.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "scopes": {
                  "description": "Scopes is the list of OAuth scopes to advertise in the well-known endpoint (RFC 9728).\nIf empty, defaults to [\"openid\"].",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ],
                  "x-kubernetes-list-type": "atomic"
                }
              },
              "required": [
                "audience",
                "name"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "type": {
              "description": "Type defines the authentication type: anonymous or oidc\nWhen no authentication is required, explicitly set this to \"anonymous\"",
              "enum": [
                "anonymous",
                "oidc"
              ],
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "spec.incomingAuth.oidcConfigRef is required when type is oidc",
              "rule": "self.type == 'oidc' ? has(self.oidcConfigRef) : true"
            }
          ]
        },
        "outgoingAuth": {
          "additionalProperties": false,
          "description": "OutgoingAuth configures authentication from Virtual MCP to backend MCPServers.\nThis field takes precedence over config.OutgoingAuth and should be preferred because it\nsupports Kubernetes-native secret references (SecretKeyRef, ConfigMapRef) for secure\ndynamic discovery of credentials, rather than requiring secrets to be embedded in config.",
          "properties": {
            "backends": {
              "additionalProperties": {
                "additionalProperties": false,
                "description": "BackendAuthConfig defines authentication configuration for a backend MCPServer",
                "properties": {
                  "externalAuthConfigRef": {
                    "additionalProperties": false,
                    "description": "ExternalAuthConfigRef references an MCPExternalAuthConfig resource\nOnly used when Type is \"externalAuthConfigRef\"",
                    "properties": {
                      "name": {
                        "description": "Name is the name of the MCPExternalAuthConfig resource",
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "type": {
                    "description": "Type defines the authentication type",
                    "enum": [
                      "discovered",
                      "externalAuthConfigRef"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "type"
                ],
                "type": "object"
              },
              "description": "Backends defines per-backend authentication overrides\nWorks in all modes (discovered, inline)",
              "type": [
                "object",
                "null"
              ]
            },
            "default": {
              "additionalProperties": false,
              "description": "Default defines default behavior for backends without explicit auth config",
              "properties": {
                "externalAuthConfigRef": {
                  "additionalProperties": false,
                  "description": "ExternalAuthConfigRef references an MCPExternalAuthConfig resource\nOnly used when Type is \"externalAuthConfigRef\"",
                  "properties": {
                    "name": {
                      "description": "Name is the name of the MCPExternalAuthConfig resource",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": {
                  "description": "Type defines the authentication type",
                  "enum": [
                    "discovered",
                    "externalAuthConfigRef"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "source": {
              "default": "discovered",
              "description": "Source defines how backend authentication configurations are determined\n- discovered: Automatically discover from backend's MCPServer.spec.externalAuthConfigRef\n- inline: Explicit per-backend configuration in VirtualMCPServer",
              "enum": [
                "discovered",
                "inline"
              ],
              "type": [
                "string",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        },
        "podTemplateSpec": {
          "description": "PodTemplateSpec defines the pod template to use for the Virtual MCP server\nThis allows for customizing the pod configuration beyond what is provided by the other fields.\nNote that to modify the specific container the Virtual MCP server runs in, you must specify\nthe 'vmcp' container name in the PodTemplateSpec.\nThis field accepts a PodTemplateSpec object as JSON/YAML.",
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-preserve-unknown-fields": true
        },
        "replicas": {
          "description": "Replicas is the desired number of vMCP pod replicas.\nVirtualMCPServer creates a single Deployment for the vMCP aggregator process,\nso there is only one replicas field (unlike MCPServer which has separate\nReplicas and BackendReplicas for its two Deployments).\nWhen nil, the operator does not set Deployment.Spec.Replicas, leaving replica\nmanagement to an HPA or other external controller.",
          "format": "int32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "serviceAccount": {
          "description": "ServiceAccount is the name of an already existing service account to use by the Virtual MCP server.\nIf not specified, a ServiceAccount will be created automatically and used by the Virtual MCP server.",
          "type": [
            "string",
            "null"
          ]
        },
        "serviceType": {
          "default": "ClusterIP",
          "description": "ServiceType specifies the Kubernetes service type for the Virtual MCP server",
          "enum": [
            "ClusterIP",
            "NodePort",
            "LoadBalancer"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "sessionAffinity": {
          "default": "ClientIP",
          "description": "SessionAffinity controls whether the Service routes repeated client connections to the same pod.\nMCP protocols (SSE, streamable-http) are stateful, so ClientIP is the default.\nSet to \"None\" for stateless servers or when using an external load balancer with its own affinity.",
          "enum": [
            "ClientIP",
            "None"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "sessionStorage": {
          "additionalProperties": false,
          "description": "SessionStorage configures session storage for stateful horizontal scaling.\nWhen nil, no session storage is configured.",
          "properties": {
            "address": {
              "description": "Address is the Redis server address (required when provider is redis)",
              "minLength": 1,
              "type": [
                "string",
                "null"
              ]
            },
            "db": {
              "default": 0,
              "description": "DB is the Redis database number",
              "format": "int32",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "keyPrefix": {
              "description": "KeyPrefix is an optional prefix for all Redis keys used by ToolHive",
              "type": [
                "string",
                "null"
              ]
            },
            "passwordRef": {
              "additionalProperties": false,
              "description": "PasswordRef is a reference to a Secret key containing the Redis password",
              "properties": {
                "key": {
                  "description": "Key is the key within the secret",
                  "type": "string"
                },
                "name": {
                  "description": "Name is the name of the secret",
                  "type": "string"
                }
              },
              "required": [
                "key",
                "name"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "provider": {
              "description": "Provider is the session storage backend type",
              "enum": [
                "memory",
                "redis"
              ],
              "type": "string"
            }
          },
          "required": [
            "provider"
          ],
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-validations": [
            {
              "message": "address is required",
              "rule": "self.provider == 'redis' ? has(self.address) : true"
            }
          ]
        },
        "telemetryConfigRef": {
          "additionalProperties": false,
          "description": "TelemetryConfigRef references an MCPTelemetryConfig resource for shared telemetry configuration.\nThe referenced MCPTelemetryConfig must exist in the same namespace as this VirtualMCPServer.\nCross-namespace references are not supported for security and isolation reasons.",
          "properties": {
            "name": {
              "description": "Name is the name of the MCPTelemetryConfig resource",
              "minLength": 1,
              "type": "string"
            },
            "serviceName": {
              "description": "ServiceName overrides the telemetry service name for this specific server.\nThis MUST be unique per server for proper observability (e.g., distinguishing\ntraces and metrics from different servers sharing the same collector).\nIf empty, defaults to the server name with \"thv-\" prefix at runtime.",
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "name"
          ],
          "type": [
            "object",
            "null"
          ]
        }
      },
      "required": [
        "groupRef",
        "incomingAuth"
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "status": {
      "additionalProperties": false,
      "description": "VirtualMCPServerStatus defines the observed state of VirtualMCPServer",
      "properties": {
        "backendCount": {
          "description": "BackendCount is the number of healthy/ready backends\n(excludes unavailable, degraded, and unknown backends)",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        },
        "conditions": {
          "description": "Conditions represent the latest available observations of the VirtualMCPServer's state",
          "items": {
            "additionalProperties": false,
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ],
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "discoveredBackends": {
          "description": "DiscoveredBackends lists discovered backend configurations from the MCPGroup",
          "items": {
            "additionalProperties": false,
            "description": "DiscoveredBackend represents a backend server discovered by vMCP runtime.\nThis type is shared with the Kubernetes operator CRD (VirtualMCPServer.Status.DiscoveredBackends).",
            "properties": {
              "authConfigRef": {
                "description": "AuthConfigRef is the name of the discovered MCPExternalAuthConfig (if any)",
                "type": [
                  "string",
                  "null"
                ]
              },
              "authType": {
                "description": "AuthType is the type of authentication configured",
                "type": [
                  "string",
                  "null"
                ]
              },
              "circuitBreakerState": {
                "description": "CircuitBreakerState is the current circuit breaker state (closed, open, half-open).\nEmpty when circuit breaker is disabled or not configured.",
                "enum": [
                  "closed",
                  "open",
                  "half-open"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "circuitLastChanged": {
                "description": "CircuitLastChanged is the timestamp when the circuit breaker state last changed.\nEmpty when circuit breaker is disabled or has never changed state.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "consecutiveFailures": {
                "description": "ConsecutiveFailures is the current count of consecutive health check failures.\nResets to 0 when the backend becomes healthy again.",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "lastHealthCheck": {
                "description": "LastHealthCheck is the timestamp of the last health check",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "message": {
                "description": "Message provides additional information about the backend status",
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "description": "Name is the name of the backend MCPServer",
                "type": "string"
              },
              "status": {
                "description": "Status is the current status of the backend (ready, degraded, unavailable, unknown).\nUse BackendHealthStatus.ToCRDStatus() to populate this field.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "description": "URL is the URL of the backend MCPServer",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ],
          "x-kubernetes-list-map-keys": [
            "name"
          ],
          "x-kubernetes-list-type": "map"
        },
        "message": {
          "description": "Message provides additional information about the current phase",
          "type": [
            "string",
            "null"
          ]
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the most recent generation observed for this VirtualMCPServer",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "oidcConfigHash": {
          "description": "OIDCConfigHash is the hash of the referenced MCPOIDCConfig spec for change detection.\nOnly populated when IncomingAuth.OIDCConfigRef is set.",
          "type": [
            "string",
            "null"
          ]
        },
        "phase": {
          "default": "Pending",
          "description": "Phase is the current phase of the VirtualMCPServer",
          "enum": [
            "Pending",
            "Ready",
            "Degraded",
            "Failed"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "telemetryConfigHash": {
          "description": "TelemetryConfigHash is the hash of the referenced MCPTelemetryConfig spec for change detection.\nOnly populated when TelemetryConfigRef is set.",
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "description": "URL is the URL where the Virtual MCP server can be accessed",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}