From 65ba894528a6947fa9d7dbb64140b773eb331718 Mon Sep 17 00:00:00 2001 From: LiteSun Date: Mon, 19 Oct 2026 18:32:48 +0800 Subject: [PATCH] feat(gateway): extra env vars for the OpenAPI-to-MCP sidecar and bump it to 1.0.9 The OpenAPI-to-MCP service is configured through environment variables (`TIMEOUT`, `CACHE_ENABLED`, `CACHE_TTL`, ...), but the chart only ever set `SSE_PORT` on the sidecar container and gave no way to add more, so Helm deployments could not change the backend request timeout at all. Add `openapiToMcp.extraEnvVars`, rendered after `SSE_PORT` the same way `apisix.extraEnvVars` is, and bump the sidecar image to 1.0.9, the first release in which `TIMEOUT` is actually honored (api7/OpenAPI2MCP#60). Chart version 3.10.16 -> 3.10.17. --- charts/gateway/Chart.yaml | 2 +- charts/gateway/README.md | 3 ++- charts/gateway/templates/_pod.tpl | 3 +++ charts/gateway/values.yaml | 13 ++++++++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/charts/gateway/Chart.yaml b/charts/gateway/Chart.yaml index 75dfd10d..d92eed5c 100644 --- a/charts/gateway/Chart.yaml +++ b/charts/gateway/Chart.yaml @@ -16,7 +16,7 @@ type: application # Versions are expected to follow Semantic Versioning (https://semver.org/) # major.minor mirrors the API7 EE release line (3.10.x), patch is this chart's # own counter on that line and is decoupled from the app patch (see appVersion). -version: 3.10.16 +version: 3.10.17 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/gateway/README.md b/charts/gateway/README.md index a2d26bf4..45ce4590 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -336,9 +336,10 @@ apisix: | nginx.workerRlimitNofile | string | `"20480"` | The number of files a worker process can open, should be larger than nginx.workerConnections | | nginx.workerShutdownTimeout | string | `"240s"` | Timeout for a graceful shutdown of worker processes | | openapiToMcp.enabled | bool | `false` | Enable or disable the OpenAPI-to-MCP sidecar. Required when using the `openapi-to-mcp` or `mcp-tools-acl` plugins. The container runs alongside the gateway in the same pod and is reached on 127.0.0.1. | +| openapiToMcp.extraEnvVars | list | `[]` | extraEnvVars An array of extra env vars for the OpenAPI-to-MCP sidecar container. The service is configured through environment variables, for example `TIMEOUT` (inactivity timeout in milliseconds for the requests the generated tools send to the backend API, default 30000), `CACHE_ENABLED` or `CACHE_TTL`. Do not set `SSE_PORT` here; it is managed by `openapiToMcp.port`. e.g: extraEnvVars: - name: TIMEOUT value: "60000" | | openapiToMcp.image.pullPolicy | string | `"IfNotPresent"` | OpenAPI-to-MCP image pull policy | | openapiToMcp.image.repository | string | `"api7/openapi-to-mcp"` | OpenAPI-to-MCP image repository | -| openapiToMcp.image.tag | string | `"1.0.6"` | OpenAPI-to-MCP image tag | +| openapiToMcp.image.tag | string | `"1.0.9"` | OpenAPI-to-MCP image tag | | openapiToMcp.port | int | `3000` | Port that the sidecar listens on. Must match the `port` configured under `plugin_attr.openapi-to-mcp` in the gateway config (defaults to 3000). | | openapiToMcp.resources | object | `{}` | Resources for the OpenAPI-to-MCP sidecar container. | | pluginAttrs | object | `{}` | Set APISIX plugin attributes, see [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L376) for more details | diff --git a/charts/gateway/templates/_pod.tpl b/charts/gateway/templates/_pod.tpl index 8aa4d40a..a2fdeb0a 100644 --- a/charts/gateway/templates/_pod.tpl +++ b/charts/gateway/templates/_pod.tpl @@ -247,6 +247,9 @@ spec: env: - name: SSE_PORT value: {{ .Values.openapiToMcp.port | quote }} + {{- if .Values.openapiToMcp.extraEnvVars }} + {{- include "apisix.tplvalues.render" (dict "value" .Values.openapiToMcp.extraEnvVars "context" $) | nindent 6 }} + {{- end }} ports: - containerPort: {{ .Values.openapiToMcp.port }} name: http diff --git a/charts/gateway/values.yaml b/charts/gateway/values.yaml index 59bc6e3d..cb70e4a8 100644 --- a/charts/gateway/values.yaml +++ b/charts/gateway/values.yaml @@ -892,7 +892,7 @@ openapiToMcp: # -- OpenAPI-to-MCP image repository repository: api7/openapi-to-mcp # -- OpenAPI-to-MCP image tag - tag: 1.0.6 + tag: 1.0.9 # -- OpenAPI-to-MCP image pull policy pullPolicy: IfNotPresent # -- Port that the sidecar listens on. Must match the `port` configured under @@ -900,6 +900,17 @@ openapiToMcp: port: 3000 # -- Resources for the OpenAPI-to-MCP sidecar container. resources: {} + # -- extraEnvVars An array of extra env vars for the OpenAPI-to-MCP sidecar + # container. The service is configured through environment variables, for + # example `TIMEOUT` (inactivity timeout in milliseconds for the requests the + # generated tools send to the backend API, default 30000), `CACHE_ENABLED` + # or `CACHE_TTL`. Do not set `SSE_PORT` here; it is managed by + # `openapiToMcp.port`. + # e.g: + # extraEnvVars: + # - name: TIMEOUT + # value: "60000" + extraEnvVars: [] control: # -- Enable Control API