diff --git a/charts/mcp-stack/templates/configmap-gateway-plugin.yaml b/charts/mcp-stack/templates/configmap-gateway-plugin.yaml new file mode 100644 index 000000000..be94512d2 --- /dev/null +++ b/charts/mcp-stack/templates/configmap-gateway-plugin.yaml @@ -0,0 +1,12 @@ +{{- if .Values.mcpContextForge.pluginConfig.enabled}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mcp-stack.fullname" . }}-gateway-plugins + labels: + {{- include "mcp-stack.labels" . | nindent 4 }} + app.kubernetes.io/component: gateway +data: + config.yaml: | + {{- .Values.mcpContextForge.pluginConfig.plugins | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/charts/mcp-stack/templates/deployment-mcpgateway.yaml b/charts/mcp-stack/templates/deployment-mcpgateway.yaml index 655da79b0..9fbe8156f 100644 --- a/charts/mcp-stack/templates/deployment-mcpgateway.yaml +++ b/charts/mcp-stack/templates/deployment-mcpgateway.yaml @@ -135,3 +135,19 @@ spec: # Resource requests / limits resources: {{- toYaml .Values.mcpContextForge.resources | nindent 12 }} + {{- /* Plugins enabled need the plugins configuration */}} + {{- if .Values.mcpContextForge.pluginConfig.enabled }} + volumeMounts: + - name: plugin-config-volume + mountPath: /app/{{ .Values.mcpContextForge.config.PLUGIN_CONFIG_FILE }} + subPath: config.yaml + {{- end }} +{{- if .Values.mcpContextForge.pluginConfig.enabled }} + volumes: + - name: plugin-config-volume + configMap: + name: {{ include "mcp-stack.fullname" . }}-gateway-plugins + items: + - key: config.yaml + path: config.yaml +{{- end }} diff --git a/charts/mcp-stack/values.schema.json b/charts/mcp-stack/values.schema.json index 0028c0920..42225de97 100644 --- a/charts/mcp-stack/values.schema.json +++ b/charts/mcp-stack/values.schema.json @@ -212,6 +212,22 @@ }, "additionalProperties": false }, + + "pluginConfig": { + "type": "object", + "description": "Content of the plugin file", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable pluginConfig loading for ingress", + "default": false + }, + "plugins": { + "type": "string", + "description": "contents of plugin file" + } + } + }, "env": { "type": "object", "description": "Environment configuration", diff --git a/charts/mcp-stack/values.yaml b/charts/mcp-stack/values.yaml index 7065ffb32..f5ef94d5d 100644 --- a/charts/mcp-stack/values.yaml +++ b/charts/mcp-stack/values.yaml @@ -11,6 +11,12 @@ global: # MCP CONTEXT-FORGE (Gateway / API tier) ######################################################################## mcpContextForge: + # --- Specific plugin file ----# + pluginConfig: + enabled: false + plugins: | + # plugin file + replicaCount: 2 # horizontal scaling for the gateway # --- HORIZONTAL POD AUTOSCALER -------------------------------------- diff --git a/mcpgateway/transports/streamablehttp_transport.py b/mcpgateway/transports/streamablehttp_transport.py index f2c10f6cc..0396198c1 100644 --- a/mcpgateway/transports/streamablehttp_transport.py +++ b/mcpgateway/transports/streamablehttp_transport.py @@ -387,7 +387,7 @@ async def call_tool(name: str, arguments: dict) -> List[Union[types.TextContent, logger.warning(f"No content returned by tool: {name}") return [] - return [types.TextContent(type=result.content[0].type, text=result.content[0].text)] + return [types.TextContent(type=content.type, text=content.text) for content in result.content] except Exception as e: logger.exception(f"Error calling tool '{name}': {e}") return []