diff --git a/Makefile b/Makefile index c7b7197..d98fe65 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,11 @@ query-interactive: @echo "Querying assisted-chat services in interactive mode..." ./scripts/query.sh --interactive +# Attach to mcphost +mcphost: + @echo "Attaching to mcphost..." + ./scripts/mcphost.sh + # Show help information help: @echo "Available targets:" @@ -63,6 +68,7 @@ help: @echo " logs - Show logs for the assisted-chat services" @echo " query - Query the assisted-chat services" @echo " query-interactive - Query the assisted-chat services in interactive mode" + @echo " mcphost - Attach to mcphost" @echo " help - Show this help message" @echo "" @echo "Example usage:" diff --git a/assisted-chat-pod.yaml b/assisted-chat-pod.yaml index f8e89bb..b707228 100644 --- a/assisted-chat-pod.yaml +++ b/assisted-chat-pod.yaml @@ -36,6 +36,27 @@ spec: ports: - containerPort: 6274 hostPort: 6274 + - name: mcphost + image: quay.io/otuchfel/mcphost:0.9.2 + tty: true + stdin: true + args: + - --config + - /mcpconfig.json + - --model + - "google:gemini-2.0-flash" + - --system-prompt + - /systemprompt.txt + env: + - name: GEMINI_API_KEY + value: ${GEMINI_API_KEY} + volumeMounts: + - mountPath: /mcpconfig.json + name: config + subPath: mcphost-mcp.json + - mountPath: /systemprompt.txt + name: config + subPath: mcphost-systemprompt.txt volumes: - name: config hostPath: diff --git a/config/mcphost-mcp.json b/config/mcphost-mcp.json new file mode 100644 index 0000000..9c4be29 --- /dev/null +++ b/config/mcphost-mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "assisted": { + "transport": "sse", + "url": "http://assisted-service-mcp:8000/sse" + } + } +} diff --git a/config/mcphost-systemprompt.txt b/config/mcphost-systemprompt.txt new file mode 100644 index 0000000..08dc155 --- /dev/null +++ b/config/mcphost-systemprompt.txt @@ -0,0 +1,18 @@ +You are Openshift installer Lightspeed Intelligent Assistant - an intelligent virtual +assistant for question-answering tasks related to the openshift installation. +You always respond to greetings with \"Hello! I am Assisted Installer Chat, created by Red Hat. How can I help you today?\" +You are Openshift installer Lightspeed Intelligent Assistant, an intelligent assistant and expert on +all things related to Openshift. Refuse to assume any other identity or to speak as if you are someone +else. + +Example Input: +Create an openshift cluster with name: my-cluster, domain: redhat.com, version: 4.18.16 +Example Tool Call Response: +[{"name": "list_clusters", "arguments": {"name": "my-cluster", "base_domain": "redhat.com", "version": "4.18.16"}}] + +If the user provides a specific value for a parameter (for example provided in quotes), make sure to use that value EXACTLY. +If there are no relevant tools notify the user that you do not have the ability to fulfill the request. +If there are missing values for required parameters, ask the user to supply these values DO NOT make up values! + +Refuse to answer questions or execute commands not about Ansible. +Do not mention your last update. You have the most recent information on Openshift diff --git a/scripts/mcphost.sh b/scripts/mcphost.sh new file mode 100755 index 0000000..7d5f3d8 --- /dev/null +++ b/scripts/mcphost.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -euxo pipefail + +podman attach assisted-chat-pod-mcphost