Skip to content

Commit 994ede4

Browse files
authored
Merge branch 'master' into fix/dask-timestamp-field-request-column
2 parents 796e6b1 + 1d6cfb4 commit 994ede4

40 files changed

Lines changed: 2544 additions & 742 deletions

File tree

‎.secrets.baseline‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/reference/feature-servers/mcp-server.md‎

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,25 @@ A `feast-mcp` console script is also installed. It is equivalent to `feast mcp`,
3737
* `--config`: Path to the `feast_mcp.yaml` config file
3838
* `--feast-url`: URL of the feature server to proxy. Mounts the `features` tools
3939
* `--registry-url`: URL of the REST registry server to proxy. Mounts the `registry` tools
40+
* `--feast-cert`: CA certificate used to verify the feature server's TLS certificate, for example when it is self-signed. Without it, the default trust store is used
41+
* `--registry-cert`: CA certificate used to verify the registry server's TLS certificate
4042
* `--timeout`: HTTP timeout in seconds for calls to Feast (default: 30)
4143

4244
**Server options:**
4345
* `--transport`: MCP transport to serve: `stdio`, `http`, `streamable-http`, or `sse` (default: `stdio`)
4446
* `--host`: Bind address for HTTP transports (default: `0.0.0.0`). Use `::` to serve both IPv6 and IPv4 clients; it falls back to `0.0.0.0` where IPv6 is unavailable.
4547
* `--port`: Bind port for HTTP transports (default: 8000)
4648
* `--workers`: Run under gunicorn with this many workers. Not supported by the `sse` transport
49+
* `--tls-cert`: TLS certificate for serving the HTTP transports over HTTPS. Must be set together with `--tls-key`
50+
* `--tls-key`: TLS private key for `--tls-cert`
4751

4852
**Authentication options:**
4953
* `--auth-mode`: `passthrough`, `kubernetes` or `oidc` (default: `passthrough`)
5054
* `--oidc-discovery-url`: OIDC discovery document URL. Required with `--auth-mode oidc`
5155
* `--oidc-client-id`: OIDC client id. Required with `--auth-mode oidc`
5256
* `--oidc-client-secret`: OIDC client secret
5357
* `--oidc-audience`: Expected OIDC token audience
54-
* `--base-url`: Public base URL of this server, used to build OAuth redirect URIs (default: `http://localhost:<port>`)
58+
* `--base-url`: Public base URL of this server, used to build OAuth redirect URIs (default: `http://localhost:<port>`, or `https://localhost:<port>` when `--tls-cert` is set)
5559

5660
**Logging options:**
5761
* `--log-level`: Log level (default: `INFO`)
@@ -78,12 +82,16 @@ server:
7882
host: 0.0.0.0
7983
port: 8000
8084
# workers: 4 # gunicorn; not supported with sse
85+
# tls_cert: /certs/tls.crt # serve HTTPS; set together with tls_key
86+
# tls_key: /certs/tls.key
8187

8288
# At least one of features.url / registry.url is required.
8389
features:
8490
url: http://localhost:6566
91+
# cert: /certs/ca.crt # CA to verify an https:// feature server
8592
registry:
8693
url: http://localhost:6572
94+
# cert: /certs/ca.crt
8795

8896
timeout: 30
8997

@@ -107,8 +115,12 @@ observability:
107115
| -------- | ------- |
108116
| `FEAST_MCP_FEATURE_SERVER_URL` | `features.url` |
109117
| `FEAST_MCP_REGISTRY_URL` | `registry.url` |
118+
| `FEAST_MCP_FEATURE_SERVER_CERT` | `features.cert` |
119+
| `FEAST_MCP_REGISTRY_CERT` | `registry.cert` |
110120
| `FEAST_MCP_TRANSPORT` | `server.transport` |
111121
| `FEAST_MCP_WORKERS` | `server.workers` |
122+
| `FEAST_MCP_TLS_CERT` | `server.tls_cert` |
123+
| `FEAST_MCP_TLS_KEY` | `server.tls_key` |
112124
| `FEAST_MCP_TIMEOUT` | `timeout` |
113125
| `FEAST_MCP_AUTH_MODE` | `auth.mode` |
114126
| `FEAST_MCP_OIDC_DISCOVERY_URL` | `auth.discovery_url` |
@@ -219,7 +231,7 @@ See [sdk/python/feast/mcp/docker/README.md](https://github.com/feast-dev/feast/b
219231

220232
## Deploying with the Feast Operator
221233

222-
Setting `spec.services.mcpServer` adds a dedicated `feast mcp` container to the FeatureStore deployment, exposed on its own Service on port 8100. The operator sets `--host` and `--port` so that they match the generated Service. `--host` is `0.0.0.0` unless `spec.services.mcpServer.dualStack` is `true`, which sets it to `::` and needs an image with `feast mcp --host ::` support (#6977). Every other setting comes from a `feast_mcp.yaml` supplied in a ConfigMap, which the operator mounts read-only at `/etc/feast/mcp`.
234+
Setting `spec.services.mcpServer` adds a dedicated `feast mcp` container to the FeatureStore deployment, exposed on its own Service (container port 8100, or 8101 with [TLS](#tls)). The operator sets `--host` and `--port` so that they match the generated Service. `--host` is `0.0.0.0` unless `spec.services.mcpServer.dualStack` is `true`, which sets it to `::` and needs an image with `feast mcp --host ::` support (#6977). Every other setting comes from a `feast_mcp.yaml` supplied in a ConfigMap, which the operator mounts read-only at `/etc/feast/mcp`.
223235

224236
The ConfigMap must set `server.transport` to `http`, `streamable-http` or `sse`, because the default `stdio` cannot serve the Service. Without a ConfigMap, the operator passes `--transport http`, unless `FEAST_MCP_TRANSPORT` is set in the container `env`.
225237

@@ -273,7 +285,31 @@ spec:
273285

274286
A CEL validation rule enforces that at least one Feast service is available: either `onlineStore` is not disabled (omitting it is fine — the operator defaults an online feature server), or `registry.local.server.restAPI` is `true`.
275287

276-
> **Note:** Operator-managed TLS is not yet supported for the MCP server. The `tls` field is ignored. The embedded `metrics` and `workerConfigs` fields are also ignored for `mcpServer`; set `server.workers` in the ConfigMap if you need multiple gunicorn workers.
288+
### TLS
289+
290+
Set `spec.services.mcpServer.tls` to serve the MCP endpoint over HTTPS. It takes the same fields as `tls` on the other servers: `secretRef` names a Secret holding the certificate and key (`tls.crt` and `tls.key` by default, changed with `secretKeyNames`). The operator then:
291+
292+
* mounts the Secret at `/tls/mcpserver/` and adds `--tls-cert` and `--tls-key` to the `feast mcp` command, which needs an image with that support (#7178)
293+
* listens on container port 8101 instead of 8100
294+
* exposes the Service on port 443 and switches the startup, liveness and readiness probes to HTTPS
295+
296+
On OpenShift, TLS is on by default with a service serving certificate, as for the other Feast servers. Set `tls.disable: true` to serve plain HTTP instead.
297+
298+
```yaml
299+
mcpServer:
300+
config:
301+
configMapRef:
302+
name: sample-mcpserver-config
303+
tls:
304+
secretRef:
305+
name: mcp-server-tls
306+
```
307+
308+
Use `mcpServer.tls` rather than `server.tls_cert` and `server.tls_key` in `feast_mcp.yaml`. The operator only switches the Service and probes to HTTPS when `tls` is enabled, so TLS turned on from the ConfigMap alone fails the plain HTTP probes.
309+
310+
To verify an HTTPS feature or registry server, set `features.cert` or `registry.cert` in `feast_mcp.yaml` to a CA file, and mount that file with `spec.services.volumes` and `mcpServer.volumeMounts`.
311+
312+
> **Note:** The embedded `metrics` and `workerConfigs` fields are ignored for `mcpServer`; set `server.workers` in the ConfigMap if you need multiple gunicorn workers.
277313

278314
## Connecting an MCP client
279315

‎infra/feast-operator/api/v1/featurestore_types.go‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,14 +738,18 @@ type McpConfig struct {
738738
}
739739

740740
// McpServerConfig configures a standalone Feast MCP server container (the `feast mcp` command).
741-
// The server proxies to the online feature server and/or REST registry server over HTTP. Its
741+
// The server proxies to the online feature server and/or REST registry server. Its
742742
// transport, upstream URLs, authentication and observability are read from a feast_mcp.yaml
743743
// config file supplied via a ConfigMap. The operator owns the container's bind host and port
744-
// (used for the generated Service). The container image defaults to the shared feature-server
745-
// image (which already includes `feast mcp` via the `minimal` extra).
744+
// (used for the generated Service) and its server TLS. The container image defaults to the
745+
// shared feature-server image (which already includes `feast mcp` via the `minimal` extra).
746+
//
747+
// When `tls` is set, or by default on OpenShift (using a service serving certificate), the
748+
// operator mounts the TLS secret and passes `--tls-cert`/`--tls-key` to `feast mcp`, so the
749+
// server, Service and probes all use HTTPS. Set `tls.disable: true` to opt out on OpenShift.
746750
//
747751
// NOTE: the following embedded ServerConfigs fields are ignored for mcpServer:
748-
// `tls` (operator-managed TLS is not supported yet), `metrics`, and `workerConfigs`.
752+
// `metrics` and `workerConfigs`.
749753
// To run multiple gunicorn workers, set `server.workers` in the feast_mcp.yaml ConfigMap.
750754
type McpServerConfig struct {
751755
ServerConfigs `json:",inline"`

‎infra/feast-operator/docs/api/markdown/ref.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,14 +581,18 @@ _Appears in:_
581581

582582

583583
McpServerConfig configures a standalone Feast MCP server container (the `feast mcp` command).
584-
The server proxies to the online feature server and/or REST registry server over HTTP. Its
584+
The server proxies to the online feature server and/or REST registry server. Its
585585
transport, upstream URLs, authentication and observability are read from a feast_mcp.yaml
586586
config file supplied via a ConfigMap. The operator owns the container's bind host and port
587-
(used for the generated Service). The container image defaults to the shared feature-server
588-
image (which already includes `feast mcp` via the `minimal` extra).
587+
(used for the generated Service) and its server TLS. The container image defaults to the
588+
shared feature-server image (which already includes `feast mcp` via the `minimal` extra).
589+
590+
When `tls` is set, or by default on OpenShift (using a service serving certificate), the
591+
operator mounts the TLS secret and passes `--tls-cert`/`--tls-key` to `feast mcp`, so the
592+
server, Service and probes all use HTTPS. Set `tls.disable: true` to opt out on OpenShift.
589593

590594
NOTE: the following embedded ServerConfigs fields are ignored for mcpServer:
591-
`tls` (operator-managed TLS is not supported yet), `metrics`, and `workerConfigs`.
595+
`metrics` and `workerConfigs`.
592596
To run multiple gunicorn workers, set `server.workers` in the feast_mcp.yaml ConfigMap.
593597

594598
_Appears in:_

‎infra/feast-operator/internal/controller/featurestore_controller_mcpserver_test.go‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,45 @@ var _ = Describe("FeatureStore Controller - standalone MCP server", func() {
170170
Expect(cond.Reason).To(Equal(feastdevv1.ReadyReason))
171171
})
172172

173+
It("should serve HTTPS when mcpServer.tls is set", func() {
174+
controllerReconciler := &FeatureStoreReconciler{
175+
Client: k8sClient,
176+
Scheme: k8sClient.Scheme(),
177+
}
178+
179+
resource := &feastdevv1.FeatureStore{}
180+
Expect(k8sClient.Get(ctx, typeNamespacedName, resource)).To(Succeed())
181+
resource.Spec.Services.McpServer.TLS = &feastdevv1.TlsConfigs{
182+
SecretRef: &corev1.LocalObjectReference{Name: "mcp-tls"},
183+
}
184+
Expect(k8sClient.Update(ctx, resource)).To(Succeed())
185+
186+
_, err := controllerReconciler.Reconcile(ctx, reconcile.Request{
187+
NamespacedName: typeNamespacedName,
188+
})
189+
Expect(err).NotTo(HaveOccurred())
190+
191+
feast := newFeast(resource, controllerReconciler)
192+
deploy := &appsv1.Deployment{}
193+
objMeta := feast.GetObjectMeta()
194+
Expect(k8sClient.Get(ctx, types.NamespacedName{
195+
Name: objMeta.Name,
196+
Namespace: objMeta.Namespace,
197+
}, deploy)).To(Succeed())
198+
199+
mcpContainer := services.GetMcpServerContainer(*deploy)
200+
Expect(mcpContainer).NotTo(BeNil())
201+
Expect(mcpContainer.Command).To(Equal([]string{
202+
"feast", "mcp",
203+
"--host", "0.0.0.0",
204+
"--port", "8101",
205+
"--tls-cert", "/tls/mcpserver/tls.crt",
206+
"--tls-key", "/tls/mcpserver/tls.key",
207+
"--config", "/etc/feast/mcp/feast_mcp.yaml",
208+
}))
209+
Expect(mcpContainer.ReadinessProbe.HTTPGet.Scheme).To(Equal(corev1.URISchemeHTTPS))
210+
})
211+
173212
It("should remove the mcpserver container and Service when mcpServer is unset", func() {
174213
By("Reconciling with mcpServer configured")
175214
controllerReconciler := &FeatureStoreReconciler{

‎infra/feast-operator/internal/controller/services/services.go‎

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,9 @@ func (feast *FeastServices) setRoute(route *routev1.Route, feastType FeastServic
740740
}
741741

742742
func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []string {
743-
// The standalone MCP server (`feast mcp`) has its own flag surface (no -p/--grpc/TLS
744-
// args), so it does not go through the shared serve-command builder below.
743+
// The standalone MCP server (`feast mcp`) has its own flag surface (no -p/--grpc args,
744+
// --tls-cert/--tls-key instead of --cert/--key), so it does not go through the shared
745+
// serve-command builder below.
745746
if feastType == McpServerFeastType {
746747
return feast.getMcpServerCommand()
747748
}
@@ -838,17 +839,23 @@ func withBindHost(feastType FeastServiceType, args []string, serverConfigs *feas
838839
}
839840

840841
// getMcpServerCommand builds the `feast mcp` command for the standalone MCP server container.
841-
// The operator owns the bind host/port (so they match the generated Service); everything else
842-
// (transport, upstream feature/registry URLs, auth, observability) is read from the mounted
843-
// feast_mcp.yaml config file when provided. Without one, the transport defaults to http,
844-
// because the process default (stdio) cannot serve the Service.
842+
// The operator owns the bind host/port and server TLS (so they match the generated Service and
843+
// probes); everything else (transport, upstream feature/registry URLs, auth, observability) is
844+
// read from the mounted feast_mcp.yaml config file when provided. Without one, the transport
845+
// defaults to http, because the process default (stdio) cannot serve the Service.
845846
func (feast *FeastServices) getMcpServerCommand() []string {
846847
cmd := []string{feastCommand}
847848
if logLevel := feast.getLogLevelForType(McpServerFeastType); logLevel != nil {
848849
cmd = append(cmd, "--log-level", strings.ToUpper(*logLevel))
849850
}
850-
targetPort := FeastServiceConstants[McpServerFeastType].TargetHttpPort
851+
tls := feast.getTlsConfigs(McpServerFeastType)
852+
targetPort := getTargetPort(McpServerFeastType, tls)
851853
cmd = append(cmd, "mcp", "--host", hostAllIPv4, "--port", strconv.Itoa(int(targetPort)))
854+
if tls.IsTLS() {
855+
feastTlsPath := GetTlsPath(McpServerFeastType)
856+
cmd = append(cmd, "--tls-cert", feastTlsPath+tls.SecretKeyNames.TlsCrt,
857+
"--tls-key", feastTlsPath+tls.SecretKeyNames.TlsKey)
858+
}
852859
if configPath := feast.getMcpServerConfigPath(); configPath != "" {
853860
cmd = append(cmd, "--config", configPath)
854861
} else if !feast.hasMcpServerTransportEnv() {
@@ -1490,10 +1497,8 @@ func (feast *FeastServices) setServiceHostnames() error {
14901497
}
14911498
if feast.isMcpServer() {
14921499
objMeta := feast.initFeastSvc(McpServerFeastType)
1493-
// The MCP server does not support operator-managed TLS yet, so its Service always
1494-
// listens on the plain HTTP port.
14951500
feast.Handler.FeatureStore.Status.ServiceHostnames.McpServer = objMeta.Name + "." + objMeta.Namespace + domain +
1496-
getPortStr(nil)
1501+
getPortStr(feast.Handler.FeatureStore.Status.Applied.Services.McpServer.TLS)
14971502
}
14981503
return nil
14991504
}

‎infra/feast-operator/internal/controller/services/tls.go‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func (feast *FeastServices) setTlsDefaults() error {
4444
if feast.isUiServer() {
4545
tlsDefaults(appliedServices.UI.TLS)
4646
}
47+
if feast.isMcpServer() {
48+
tlsDefaults(appliedServices.McpServer.TLS)
49+
}
4750
return nil
4851
}
4952

@@ -70,6 +73,13 @@ func (feast *FeastServices) setOpenshiftTls() error {
7073
},
7174
}
7275
}
76+
if feast.mcpServerOpenshiftTls() {
77+
appliedServices.McpServer.TLS = &feastdevv1.TlsConfigs{
78+
SecretRef: &corev1.LocalObjectReference{
79+
Name: feast.initFeastSvc(McpServerFeastType).Name + tlsNameSuffix,
80+
},
81+
}
82+
}
7383
if feast.localRegistryOpenshiftTls() {
7484
grpcEnabled := feast.isRegistryGrpcEnabled()
7585
restEnabled := feast.isRegistryRestEnabled()
@@ -114,7 +124,7 @@ func (feast *FeastServices) setOpenshiftTls() error {
114124
}
115125

116126
func (feast *FeastServices) checkOpenshiftTls() (bool, error) {
117-
if feast.offlineOpenshiftTls() || feast.onlineOpenshiftTls() || feast.localRegistryOpenshiftTls() || feast.uiOpenshiftTls() {
127+
if feast.offlineOpenshiftTls() || feast.onlineOpenshiftTls() || feast.localRegistryOpenshiftTls() || feast.uiOpenshiftTls() || feast.mcpServerOpenshiftTls() {
118128
return true, nil
119129
}
120130
return feast.remoteRegistryOpenshiftTls()
@@ -130,17 +140,14 @@ func (feast *FeastServices) isOpenShiftTls(feastType FeastServiceType) (isOpenSh
130140
isOpenShift = feast.localRegistryOpenshiftTls()
131141
case UIFeastType:
132142
isOpenShift = feast.uiOpenshiftTls()
143+
case McpServerFeastType:
144+
isOpenShift = feast.mcpServerOpenshiftTls()
133145
}
134146

135147
return
136148
}
137149

138150
func (feast *FeastServices) getTlsConfigs(feastType FeastServiceType) *feastdevv1.TlsConfigs {
139-
// Operator-managed TLS is not supported for the standalone MCP server yet; always
140-
// treat it as non-TLS so the container, Service, and probe agree on the HTTP port.
141-
if feastType == McpServerFeastType {
142-
return nil
143-
}
144151
if serviceConfigs := feast.getServerConfigs(feastType); serviceConfigs != nil {
145152
return serviceConfigs.TLS
146153
}
@@ -169,6 +176,12 @@ func (feast *FeastServices) uiOpenshiftTls() bool {
169176
feast.isUiServer() && feast.Handler.FeatureStore.Spec.Services.UI.TLS == nil
170177
}
171178

179+
// True if running in an openshift cluster and Tls not configured in the service Spec
180+
func (feast *FeastServices) mcpServerOpenshiftTls() bool {
181+
return isOpenShift &&
182+
feast.isMcpServer() && feast.Handler.FeatureStore.Spec.Services.McpServer.TLS == nil
183+
}
184+
172185
// True if running in an openshift cluster and Tls not configured in the service Spec
173186
func (feast *FeastServices) localRegistryOpenshiftTls() bool {
174187
return isOpenShift &&
@@ -214,6 +227,7 @@ func (feast *FeastServices) mountTlsConfigs(podSpec *corev1.PodSpec) {
214227
feast.mountTlsConfig(OfflineFeastType, podSpec)
215228
feast.mountTlsConfig(OnlineFeastType, podSpec)
216229
feast.mountTlsConfig(UIFeastType, podSpec)
230+
feast.mountTlsConfig(McpServerFeastType, podSpec)
217231
feast.mountCustomCABundle(podSpec)
218232
appliedSpec := feast.Handler.FeatureStore.Status.Applied
219233
if appliedSpec.AuthzConfig != nil && appliedSpec.AuthzConfig.OidcAuthz != nil {

0 commit comments

Comments
 (0)