Skip to main content

MCPWebhookConfig

MCPWebhookConfig is a ToolHive custom resource.

API: toolhive.stacklok.dev/v1alpha1 · Scope: Namespaced · Short names: mwc

Example

mcpwebhookconfig.yaml
apiVersion: toolhive.stacklok.dev/v1alpha1
kind: MCPWebhookConfig
metadata:
name: my-mcpwebhookconfig
namespace: default
spec: {}

Schema

spec

MCPWebhookConfigSpec defines the desired state of MCPWebhookConfig

FieldTypeDescription
mutatingobject[]

Mutating webhooks are called to transform MCP requests before processing.

validatingobject[]

Validating webhooks are called to approve or deny MCP requests.

spec.mutating[]

Mutating webhooks are called to transform MCP requests before processing.

FieldTypeDescription
failurePolicystring

FailurePolicy defines how to handle errors when communicating with the webhook. Supported values: "fail", "ignore". Defaults to "fail".


default "fail" · enum: fail | ignore
hmacSecretRefobject

HMACSecretRef references a Kubernetes Secret containing the HMAC signing key used to sign the webhook payload. If set, the X-Toolhive-Signature header will be injected.

namerequiredstring

Name is a unique identifier for this webhook


minLength 1 · maxLength 63
timeoutstring

Timeout configures the maximum time to wait for the webhook to respond. Defaults to 10s if not specified. Maximum is 30s.


format duration
tlsConfigobject

TLSConfig contains optional TLS configuration for the webhook connection.

urlrequiredstring

URL is the endpoint to call for this webhook. Must be an HTTP/HTTPS URL.


format uri
spec.mutating.hmacSecretRef

HMACSecretRef references a Kubernetes Secret containing the HMAC signing key used to sign the webhook payload. If set, the X-Toolhive-Signature header will be injected.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.mutating.tlsConfig

TLSConfig contains optional TLS configuration for the webhook connection.

FieldTypeDescription
caSecretRefobject

CASecretRef references a Secret containing the CA certificate bundle used to verify the webhook server's certificate. Contains a bundle of PEM-encoded X.509 certificates.

clientCertSecretRefobject

ClientCertSecretRef references a Secret containing the client certificate for mTLS authentication. The referenced key must contain a PEM-encoded client certificate. Use ClientKeySecretRef to provide the corresponding private key.

clientKeySecretRefobject

ClientKeySecretRef references a Secret containing the private key for the client certificate. Required when ClientCertSecretRef is set to enable mTLS.

insecureSkipVerifyboolean

InsecureSkipVerify disables server certificate verification. WARNING: This should only be used for development/testing and not in production environments.

spec.mutating.tlsConfig.caSecretRef

CASecretRef references a Secret containing the CA certificate bundle used to verify the webhook server's certificate. Contains a bundle of PEM-encoded X.509 certificates.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.mutating.tlsConfig.clientCertSecretRef

ClientCertSecretRef references a Secret containing the client certificate for mTLS authentication. The referenced key must contain a PEM-encoded client certificate. Use ClientKeySecretRef to provide the corresponding private key.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.mutating.tlsConfig.clientKeySecretRef

ClientKeySecretRef references a Secret containing the private key for the client certificate. Required when ClientCertSecretRef is set to enable mTLS.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.validating[]

Validating webhooks are called to approve or deny MCP requests.

FieldTypeDescription
failurePolicystring

FailurePolicy defines how to handle errors when communicating with the webhook. Supported values: "fail", "ignore". Defaults to "fail".


default "fail" · enum: fail | ignore
hmacSecretRefobject

HMACSecretRef references a Kubernetes Secret containing the HMAC signing key used to sign the webhook payload. If set, the X-Toolhive-Signature header will be injected.

namerequiredstring

Name is a unique identifier for this webhook


minLength 1 · maxLength 63
timeoutstring

Timeout configures the maximum time to wait for the webhook to respond. Defaults to 10s if not specified. Maximum is 30s.


format duration
tlsConfigobject

TLSConfig contains optional TLS configuration for the webhook connection.

urlrequiredstring

URL is the endpoint to call for this webhook. Must be an HTTP/HTTPS URL.


format uri
spec.validating.hmacSecretRef

HMACSecretRef references a Kubernetes Secret containing the HMAC signing key used to sign the webhook payload. If set, the X-Toolhive-Signature header will be injected.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.validating.tlsConfig

TLSConfig contains optional TLS configuration for the webhook connection.

FieldTypeDescription
caSecretRefobject

CASecretRef references a Secret containing the CA certificate bundle used to verify the webhook server's certificate. Contains a bundle of PEM-encoded X.509 certificates.

clientCertSecretRefobject

ClientCertSecretRef references a Secret containing the client certificate for mTLS authentication. The referenced key must contain a PEM-encoded client certificate. Use ClientKeySecretRef to provide the corresponding private key.

clientKeySecretRefobject

ClientKeySecretRef references a Secret containing the private key for the client certificate. Required when ClientCertSecretRef is set to enable mTLS.

insecureSkipVerifyboolean

InsecureSkipVerify disables server certificate verification. WARNING: This should only be used for development/testing and not in production environments.

spec.validating.tlsConfig.caSecretRef

CASecretRef references a Secret containing the CA certificate bundle used to verify the webhook server's certificate. Contains a bundle of PEM-encoded X.509 certificates.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.validating.tlsConfig.clientCertSecretRef

ClientCertSecretRef references a Secret containing the client certificate for mTLS authentication. The referenced key must contain a PEM-encoded client certificate. Use ClientKeySecretRef to provide the corresponding private key.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

spec.validating.tlsConfig.clientKeySecretRef

ClientKeySecretRef references a Secret containing the private key for the client certificate. Required when ClientCertSecretRef is set to enable mTLS.

FieldTypeDescription
keyrequiredstring

Key is the key within the secret

namerequiredstring

Name is the name of the secret

status

MCPWebhookConfigStatus defines the observed state of MCPWebhookConfig

FieldTypeDescription
conditionsobject[]

Conditions represent the latest available observations

configHashstring

ConfigHash is a hash of the spec, used for detecting changes

observedGenerationinteger

ObservedGeneration is the last observed generation corresponding to the current status


format int64
referencingWorkloadsobject[]

ReferencingWorkloads is a list of workload resources that reference this MCPWebhookConfig. Each entry identifies the workload by kind and name.

status.conditions[]

Conditions represent the latest available observations

FieldTypeDescription
lastTransitionTimerequiredstring

lastTransitionTime is the last time the condition transitioned from one status to another. This 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
messagerequiredstring

message is a human readable message indicating details about the transition. This may be an empty string.


maxLength 32768
observedGenerationinteger

observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.


format int64 · min 0
reasonrequiredstring

reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.


pattern ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ · minLength 1 · maxLength 1024
statusrequiredstring

status of the condition, one of True, False, Unknown.


enum: True | False | Unknown
typerequiredstring

type of condition in CamelCase or in foo.example.com/CamelCase.


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])$ · maxLength 316

status.referencingWorkloads[]

ReferencingWorkloads is a list of workload resources that reference this MCPWebhookConfig. Each entry identifies the workload by kind and name.

FieldTypeDescription
kindrequiredstring

Kind is the type of workload resource


enum: MCPServer | VirtualMCPServer | MCPRemoteProxy
namerequiredstring

Name is the name of the workload resource


minLength 1

Referenced by: