Skip to content

CoderMCPServer

API identity

  • Group/version: coder.com/v1alpha1
  • Kind: CoderMCPServer
  • Resource: codermcpservers
  • Scope: namespaced

Spec

Field Type Description
controlPlaneRef CoderControlPlaneReference ControlPlaneRef names the CoderControlPlane in the same namespace. The controller calls Coder with that control plane's operator token.
organization string Organization is the name of the Coder organization that holds the config. Coder cannot move a config to another organization. Coder reserves the names new and create.
slug string Slug is the Coder slug of the config, unique in its organization. The model sees the server's tools as <slug>__<tool>.
displayName string DisplayName is the name that Coder shows to users in chat.
description string Description is a short summary of what the server provides.
iconURL string IconURL is the icon URL, path or emoji that Coder shows.
url string URL is the http:// or https:// MCP endpoint that Coder connects to. It must not hold user info. Every Secret in auth must list its origin as an allowed destination.
transport string Transport is the MCP transport that Coder uses.
availability string Availability decides how chats offer the server. force_on adds it to every new chat of a user who can read it. Coder's web UI preselects default_on servers. The Coder server treats default_on and default_off alike.
enabled boolean Enabled turns the server on or off in Coder. Chats never connect to a disabled server. When omitted, the default is true.
allowInPlanMode boolean AllowInPlanMode offers the server in plan-mode chats.
modelIntent boolean ModelIntent asks the model to state its intent with each tool call.
forwardCoderHeaders boolean ForwardCoderHeaders sends the chat owner, chat and workspace IDs to the server as X-Coder-* headers. Coder sends no token in them.
auth CoderMCPServerAuth Auth is how Coder authenticates to the server.
access CoderMCPServerAccess Access, when set, makes the controller own the server's access list in Coder: exactly the listed groups can read the server. Every sync therefore also removes each user entry, for example a user that an admin added in the Coder dashboard. Coder does not show the entry of a deleted group, so the sync cannot remove it, but it grants nothing. When omitted, the controller leaves the access list alone, and Coder's default lets every organization member read the server.

Status

Field Type Description
observedGeneration integer ObservedGeneration is the generation the controller last processed.
appliedGeneration integer AppliedGeneration is the last generation whose spec Coder fully holds, or that a kill switch holds: when the controller disables the config because a credential Secret or the control plane withdrew consent, it sets this field before it sends the disable, so only a later spec edit enables the config again. Ready tells whether Coder holds the spec.
organizationID string OrganizationID is the Coder organization ID that spec.organization resolved to first.
configID string ConfigID is the Coder MCP server config ID.
createAttemptTime Time CreateAttemptTime is set before every create request. While it is set and ConfigID is empty, a create request can be in flight or already committed in Coder.
credentials CoderMCPServerCredentialStatus array Credentials record the Secret values last sent to Coder.
conditions Condition array Conditions are Ready, Reconciling, and Stalled.

Referenced types

CoderControlPlaneReference

CoderControlPlaneReference names a CoderControlPlane in the same namespace.

Field Type Description
name string Name is the CoderControlPlane name.

CoderMCPServerAPIKeyAuth

CoderMCPServerAPIKeyAuth sends one Secret value in one header. Coder sends the value as it is, so a bearer token is stored as Bearer <token>.

Field Type Description
header string Header is the HTTP header name.
secretRef SecretKeySelector SecretRef references the key in a Secret in the same namespace that holds the header value. The Secret must opt in to the credential Secret contract and list the origin of spec.url.

CoderMCPServerAccess

CoderMCPServerAccess lists the Coder groups that can read the server.

Field Type Description
groups string array Groups are Coder group names in the server's organization. Everyone is the group of all organization members. An empty list leaves the server to organization admins. Coder reserves the names new and create. While a listed group does not exist, the controller removes the access of every group that this list does not name, adds none, disables the server if the spec disables it, and waits with GroupNotFound for the rest.

CoderMCPServerAuth

CoderMCPServerAuth is how Coder authenticates to the MCP server. Exactly the block that matches type is set. +kubebuilder:validation:XValidation:rule="(self.type == 'api_key') == has(self.apiKey)",message="auth.apiKey must be set exactly when auth.type is api_key" +kubebuilder:validation:XValidation:rule="(self.type == 'custom_headers') == has(self.customHeaders)",message="auth.customHeaders must be set exactly when auth.type is custom_headers" +kubebuilder:validation:XValidation:rule="(self.type == 'oauth2') == has(self.oauth2)",message="auth.oauth2 must be set exactly when auth.type is oauth2"

Field Type Description
type string Type is the auth type. Coder's user_oidc type is not supported, because it sends each user's login token to the server URL.
apiKey CoderMCPServerAPIKeyAuth APIKey sends one Secret value in one header.
customHeaders CoderMCPServerHeader array CustomHeaders sends each Secret value in its own header.
oauth2 CoderMCPServerOAuth2Auth OAuth2 lets each user connect with an OAuth2 client that the admin registered at the authorization server.

CoderMCPServerCredentialStatus

CoderMCPServerCredentialStatus records which Secret value was last sent to Coder for one credential field. It holds no secret data and nothing derived from it.

Field Type Description
field string Field names the credential: apiKey, oauth2ClientSecret, or header:<name>.
secretName string SecretName is the Secret name that was read.
secretKey string SecretKey is the key in the Secret that was read.
secretUID string SecretUID is the UID of the Secret that was read.
secretResourceVersion string SecretResourceVersion is the resourceVersion of the Secret that was read.

CoderMCPServerHeader

CoderMCPServerHeader is one header whose value comes from a Secret.

Field Type Description
name string Name is the HTTP header name.
secretRef SecretKeySelector SecretRef references the key in a Secret in the same namespace that holds the header value. The Secret must opt in to the credential Secret contract and list the origin of spec.url.

CoderMCPServerOAuth2Auth

CoderMCPServerOAuth2Auth is a manually registered OAuth2 client. Coder's automatic discovery and dynamic client registration are not supported.

Field Type Description
clientID string ClientID is the OAuth2 client ID.
clientSecretRef SecretKeySelector ClientSecretRef references the key in a Secret in the same namespace that holds the client secret. The Secret must opt in to the credential Secret contract and list the origins of spec.url, authURL, tokenURL and revocationURL.
authURL string AuthURL is the authorization endpoint that users' browsers open.
tokenURL string TokenURL is the token endpoint that Coder sends the client secret to.
revocationURL string RevocationURL is the https:// token revocation endpoint. Coder sends the client secret there when a user disconnects.
scopes string array Scopes are the OAuth2 scopes that Coder requests.

SecretKeySelector

SecretKeySelector identifies a key in a Secret.

Field Type Description
name string Name is the Kubernetes Secret name.
key string Key is the key inside the Secret data map.

Source

  • Go type: api/v1alpha1/codermcpserver_types.go
  • Generated CRD: config/crd/bases/coder.com_codermcpservers.yaml