Skip to content

Commit 763fc2b

Browse files
committed
mcp: jira client
1 parent be21ddf commit 763fc2b

File tree

9 files changed

+103
-26
lines changed

9 files changed

+103
-26
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ BugZooka supports two complementary modes for monitoring Slack channels that can
7979
# Run with both polling AND socket mode
8080
make run ARGS="--product openshift --ci prow --enable-socket-mode"
8181
```
82-
82+
8383
**Socket Mode Requirements:**
8484
- An app-level token (`xapp-*`) must be configured as `SLACK_APP_TOKEN`
8585
- Socket Mode must be enabled in your Slack app settings
@@ -124,6 +124,7 @@ GENERIC_INFERENCE_URL="YOUR_INFERENCE_ENDPOINT"
124124
GENERIC_INFERENCE_TOKEN="YOUR_INFERENCE_TOKEN"
125125
GENERIC_MODEL="YOUR_INFERENCE_MODEL"
126126
```
127+
127128
**Note**: Please make sure to provide details for all the mandatory attributes and for the product that is intended to be used for testing along with fallback (i.e. GENERIC details) to handle failover use-cases.
128129
129130
@@ -263,6 +264,11 @@ make podman-run # Requires .env file in project root
263264
export QUAY_CRED='<base64 encoded pull secret>'
264265
export BUGZOOKA_IMAGE='<image tag>'
265266
export BUGZOOKA_NAMESPACE='<your namespace>'
267+
# optional Jira fields
268+
export JIRA_BASE_URL="YOUR_JIRA_URL"
269+
export JIRA_TOKEN="YOUR_JIRA_TOKEN"
270+
export JIRA_ALLOWED_PROJECTS="YOUR_JIRA_PROJECT"
271+
266272
kustomize build ./kustomize | envsubst | oc apply -f -
267273
268274
# Cleanup resources

kustomize/base/configmap-mcp.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: bugzooka-mcp-config
5+
namespace: ${BUGZOOKA_NAMESPACE}
6+
labels:
7+
app: ${BUGZOOKA_NAMESPACE}
8+
data:
9+
mcp_config.json: |
10+
{
11+
"mcp_servers": {
12+
"jira_mcp_server": {
13+
"command": "python3",
14+
"args": [
15+
"-m",
16+
"bugzooka.integrations.jira_client"
17+
],
18+
"env": {
19+
"PYTHONPATH": "/app-packages",
20+
"JIRA_BASE_URL": "${JIRA_BASE_URL}",
21+
"JIRA_TOKEN": "${JIRA_TOKEN}",
22+
"JIRA_ALLOWED_PROJECTS": "${JIRA_ALLOWED_PROJECTS}"
23+
},
24+
"transport": "stdio"
25+
}
26+
}
27+
}

kustomize/base/configmap-prompts.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ metadata:
88
data:
99
prompts.json: |
1010
{
11-
"OPENSHIFT_PROMPT": {
12-
"system": "You are an expert in OpenShift, Kubernetes, and cloud infrastructure. Your task is to analyze logs and summaries related to OpenShift environments. Given a log summary, identify the root cause, potential fixes, and affected components. Be as consise as possible (under 5000 characters), but precise and avoid generic troubleshooting steps. Prioritize OpenShift-specific debugging techniques. Keep in mind that the cluster is ephemeral and is destroyed after the build is complete, but all relevant logs and metrics are available. Use markdown formatting for the output with only one level of bullet points, do not use bold text except for the headers.",
13-
"user": "Here is the log summary from an OpenShift environment:\n\n{summary}\n\nBased on this summary, provide a structured breakdown of:\n- The OpenShift component likely affected (e.g., etcd, kube-apiserver, ingress, SDN, Machine API)\n- The probable root cause\n- Steps to verify the issue further\n- Suggested resolution, including OpenShift-specific commands or configurations.",
14-
"assistant": "**Affected Component:** <Identified component>\n\n**Probable Root Cause:** <Describe why this issue might be occurring>\n\n**Verification Steps:**\n- <Step 1>\n- <Step 2>\n- <Step 3>\n\n**Suggested Resolution:**\n- <OpenShift CLI commands>\n- <Relevant OpenShift configurations>"
15-
},
11+
"OPENSHIFT_PROMPT": {
12+
"system": "You are an expert in OpenShift, Kubernetes, and cloud infrastructure. Your task is to analyze logs and summaries related to OpenShift environments. Given a log summary, identify the root cause, potential fixes, and affected components. Be as consise as possible (under 5000 characters), but precise and avoid generic troubleshooting steps. Prioritize OpenShift-specific debugging techniques. Keep in mind that the cluster is ephemeral and is destroyed after the build is complete, but all relevant logs and metrics are available. Use markdown formatting for the output with only one level of bullet points, do not use bold text except for the headers.\n\nIMPORTANT: You have access to JIRA search tools. After analyzing the error, ALWAYS search for related issues in JIRA using the search_jira_issues tool with the OCPBUGS project. Extract key error terms, component names, or operators from the log summary to search for similar issues. Include the top 3 most relevant JIRA issues in your final response under a 'Related JIRA Issues' section.",
13+
"user": "Here is the log summary from an OpenShift environment:\n\n{summary}\n\nBased on this summary, provide a structured breakdown of:\n- The OpenShift component likely affected (e.g., etcd, kube-apiserver, ingress, SDN, Machine API)\n- The probable root cause\n- Steps to verify the issue further\n- Suggested resolution, including OpenShift-specific commands or configurations\n- Related JIRA issues (search using search_jira_issues tool with OCPBUGS project and include the top 3 most relevant issues)",
14+
"assistant": "**Affected Component:** <Identified component>\n\n**Probable Root Cause:** <Describe why this issue might be occurring>\n\n**Verification Steps:**\n- <Step 1>\n- <Step 2>\n- <Step 3>\n\n**Suggested Resolution:**\n- <OpenShift CLI commands>\n- <Relevant OpenShift configurations>\n\n**Related JIRA Issues:**\n- <Top 3 relevant issues from JIRA search>"
15+
},
1616
"ANSIBLE_PROMPT": {
1717
"system": "You are an expert in Ansible automation, playbook debugging, and infrastructure as code (IaC). Your task is to analyze log summaries related to Ansible execution, playbook failures, and task errors. Given a log summary, identify the root cause, affected tasks, and potential fixes. Prioritize Ansible-specific debugging techniques over generic troubleshooting.",
1818
"user": "Here is the log summary from an Ansible execution:\n\n{summary}\n\nBased on this summary, provide a structured breakdown of:\n- The failed Ansible task and module involved\n- The probable root cause\n- Steps to reproduce or verify the issue\n- Suggested resolution, including relevant playbook changes or command-line fixes.",

kustomize/base/deploymentconfig.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ spec:
4545
envFrom:
4646
- secretRef:
4747
name: bugzooka-env
48+
- secretRef:
49+
name: bugzooka-jira
4850
volumeMounts:
4951
- name: prompts
5052
mountPath: /app/prompts.json
5153
subPath: prompts.json
54+
- name: mcp-config
55+
mountPath: /app/mcp_config.json
56+
subPath: mcp_config.json
5257
resources:
5358
requests:
5459
cpu: "1"
@@ -63,3 +68,9 @@ spec:
6368
items:
6469
- key: prompts.json
6570
path: prompts.json
71+
- name: mcp-config
72+
configMap:
73+
name: bugzooka-mcp-config
74+
items:
75+
- key: mcp_config.json
76+
path: mcp_config.json

kustomize/base/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ namespace: ${BUGZOOKA_NAMESPACE}
66
resources:
77
- namespace.yaml
88
- secret-quay.yaml
9+
- secret-jira.yaml
910
- serviceaccount-patch.yaml
1011
- imagestream.yaml
1112
- configmap-prompts.yaml
13+
- configmap-mcp.yaml
1214
- deploymentconfig.yaml
1315

1416
generatorOptions:

kustomize/base/secret-jira.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: bugzooka-jira
5+
namespace: ${BUGZOOKA_NAMESPACE}
6+
annotations:
7+
kubernetes.io/service-account.name: default
8+
type: Opaque
9+
stringData:
10+
JIRA_BASE_URL: "${JIRA_BASE_URL}"
11+
JIRA_TOKEN: "${JIRA_TOKEN}"
12+
JIRA_ALLOWED_PROJECTS: "${JIRA_ALLOWED_PROJECTS}"

mcp_config.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,18 @@
1313
"transport": "stdio"
1414
},
1515
"jira_mcp_server": {
16-
"command": "docker",
16+
"command": "python3",
1717
"args": [
18-
"run",
19-
"-i",
20-
"--rm",
21-
"-e", "JIRA_URL",
22-
"-e", "JIRA_USERNAME",
23-
"-e", "JIRA_API_TOKEN",
24-
"ghcr.io/sooperset/mcp-atlassian:latest"
18+
"-m",
19+
"bugzooka.integrations.jira_client"
2520
],
2621
"env": {
27-
"JIRA_URL": "<YOUR_ORG_JIRA_URL>",
28-
"JIRA_USERNAME": "<YOUR_COMPANY_EMAIL>",
29-
"JIRA_API_TOKEN": "<YOUR_JIRA_API_TOKEN>"
22+
"PYTHONPATH": "/app-packages",
23+
"JIRA_BASE_URL": "<YOUR_JIRA_BASE_URL>",
24+
"JIRA_TOKEN": "<YOUR_JIRA_TOKEN>",
25+
"JIRA_ALLOWED_PROJECTS": "<YOUR_JIRA_ALLOWED_PROJECTS>"
3026
},
3127
"transport": "stdio"
3228
}
3329
}
34-
}
30+
}

prompts.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"OPENSHIFT_PROMPT": {
3-
"system": "You are an expert in OpenShift, Kubernetes, and cloud infrastructure. Your task is to analyze logs and summaries related to OpenShift environments. Given a log summary, identify the root cause, potential fixes, and affected components. Be as consise as possible (under 5000 characters), but precise and avoid generic troubleshooting steps. Prioritize OpenShift-specific debugging techniques. Keep in mind that the cluster is ephemeral and is destroyed after the build is complete, but all relevant logs and metrics are available. Use markdown formatting for the output with only one level of bullet points, do not use bold text except for the headers.",
4-
"user": "Here is the log summary from an OpenShift environment:\n\n{summary}\n\nBased on this summary, provide a structured breakdown of:\n- The OpenShift component likely affected (e.g., etcd, kube-apiserver, ingress, SDN, Machine API)\n- The probable root cause\n- Steps to verify the issue further\n- Suggested resolution, including OpenShift-specific commands or configurations.",
5-
"assistant": "**Affected Component:** <Identified component>\n\n**Probable Root Cause:** <Describe why this issue might be occurring>\n\n**Verification Steps:**\n- <Step 1>\n- <Step 2>\n- <Step 3>\n\n**Suggested Resolution:**\n- <OpenShift CLI commands>\n- <Relevant OpenShift configurations>"
3+
"system": "You are an expert in OpenShift, Kubernetes, and cloud infrastructure. Your task is to analyze logs and summaries related to OpenShift environments. Given a log summary, identify the root cause, potential fixes, and affected components. Be as consise as possible (under 5000 characters), but precise and avoid generic troubleshooting steps. Prioritize OpenShift-specific debugging techniques. Keep in mind that the cluster is ephemeral and is destroyed after the build is complete, but all relevant logs and metrics are available. Use markdown formatting for the output with only one level of bullet points, do not use bold text except for the headers.\n\nIMPORTANT: You have access to JIRA search tools. After analyzing the error, ALWAYS search for related issues in JIRA using the search_jira_issues tool with the OCPBUGS project. Extract key error terms, component names, or operators from the log summary to search for similar issues. Include the top 3 most relevant JIRA issues in your final response under a 'Related JIRA Issues' section.",
4+
"user": "Here is the log summary from an OpenShift environment:\n\n{summary}\n\nBased on this summary, provide a structured breakdown of:\n- The OpenShift component likely affected (e.g., etcd, kube-apiserver, ingress, SDN, Machine API)\n- The probable root cause\n- Steps to verify the issue further\n- Suggested resolution, including OpenShift-specific commands or configurations\n- Related JIRA issues (search using search_jira_issues tool with OCPBUGS project and include the top 3 most relevant issues)",
5+
"assistant": "**Affected Component:** <Identified component>\n\n**Probable Root Cause:** <Describe why this issue might be occurring>\n\n**Verification Steps:**\n- <Step 1>\n- <Step 2>\n- <Step 3>\n\n**Suggested Resolution:**\n- <OpenShift CLI commands>\n- <Relevant OpenShift configurations>\n\n**Related JIRA Issues:**\n- <Top 3 relevant issues from JIRA search>"
66
},
77
"ANSIBLE_PROMPT": {
88
"system": "You are an expert in Ansible automation, playbook debugging, and infrastructure as code (IaC). Your task is to analyze log summaries related to Ansible execution, playbook failures, and task errors. Given a log summary, identify the root cause, affected tasks, and potential fixes. Prioritize Ansible-specific debugging techniques over generic troubleshooting.",

requirements.txt

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ annotated-types==0.7.0
77
anyio==4.5.0
88
astroid==3.3.10
99
attrs==25.3.0
10+
Authlib==1.6.5
1011
backports.tarfile==1.2.0
1112
banks==2.2.0
13+
beartype==0.22.5
1214
beautifulsoup4==4.14.2
1315
blinker==1.8.2
1416
build==1.2.2.post1
1517
CacheControl==0.14.1
18+
cachetools==6.2.1
1619
certifi==2024.8.30
1720
cffi==1.17.1
1821
cfgv==3.4.0
@@ -22,17 +25,25 @@ click==8.2.1
2225
colorama==0.4.6
2326
crashtest==0.4.1
2427
cryptography==44.0.0
28+
cyclopts==4.2.2
2529
dataclasses-json==0.6.7
2630
defusedxml==0.7.1
2731
dep-logic==0.4.6
2832
Deprecated==1.2.18
2933
dill==0.4.0
3034
dirtyjson==1.0.8
35+
diskcache==5.6.3
3136
distlib==0.3.8
3237
distro==1.9.0
38+
dnspython==2.8.0
39+
docstring_parser==0.17.0
40+
docutils==0.22.3
3341
dulwich==0.22.7
42+
email-validator==2.3.0
43+
exceptiongroup==1.3.0
3444
faiss-cpu==1.12.0
3545
fastjsonschema==2.21.1
46+
fastmcp==2.13.0.2
3647
filelock==3.16.0
3748
filetype==1.2.0
3849
findpython==0.6.1
@@ -44,7 +55,7 @@ h11==0.14.0
4455
hf-xet==1.1.10
4556
hishel==0.0.30
4657
httpcore==1.0.5
47-
httpx==0.27.2
58+
httpx==0.28.1
4859
httpx-sse==0.4.0
4960
huggingface-hub==0.36.0
5061
identify==2.6.0
@@ -62,6 +73,7 @@ joblib==1.5.2
6273
jsonpatch==1.33
6374
jsonpointer==3.0.0
6475
jsonschema==4.25.1
76+
jsonschema-path==0.3.4
6577
jsonschema-specifications==2025.9.1
6678
keyring==25.6.0
6779
langchain==0.3.26
@@ -95,7 +107,7 @@ markdown-it-py==3.0.0
95107
MarkupSafe==3.0.3
96108
marshmallow==3.26.1
97109
mccabe==0.7.0
98-
mcp==1.12.4
110+
mcp==1.21.0
99111
mdurl==0.1.2
100112
more-itertools==10.5.0
101113
mpmath==1.3.0
@@ -109,9 +121,12 @@ nodeenv==1.9.1
109121
numpy==2.2.4
110122
ollama==0.6.0
111123
openai==1.109.1
124+
openapi-pydantic==0.5.1
112125
orjson==3.10.15
113126
packaging==24.1
114127
pandas==2.2.3
128+
pathable==0.4.4
129+
pathvalidate==3.3.1
115130
pbs-installer==2024.9.9
116131
pdm==2.18.2
117132
pillow==12.0.0
@@ -122,32 +137,38 @@ poetry==2.0.0
122137
poetry-core==2.0.0
123138
pre-commit==3.8.0
124139
propcache==0.3.0
140+
py-key-value-aio==0.2.8
141+
py-key-value-shared==0.2.8
125142
pycparser==2.22
126143
pydantic==2.12.3
127144
pydantic-settings==2.8.1
128145
pydantic_core==2.41.4
129146
Pygments==2.18.0
147+
PyJWT==2.10.1
130148
pylint==3.3.7
131149
pypdf==5.9.0
150+
pyperclip==1.11.0
132151
pyproject_hooks==1.1.0
133152
python-dateutil==2.9.0.post0
134-
python-dotenv==1.0.1
153+
python-dotenv==1.2.1
135154
python-multipart==0.0.20
136155
pytz==2025.2
137156
PyYAML==6.0.2
138157
RapidFuzz==3.11.0
139-
referencing==0.37.0
158+
referencing==0.36.2
140159
regex==2025.10.23
141160
requests==2.32.3
142161
requests-toolbelt==1.0.0
143162
resolvelib==1.0.1
144-
rich==13.8.1
163+
rich==14.2.0
164+
rich-rst==1.3.2
145165
rpds-py==0.28.0
146166
safetensors==0.6.2
147167
scikit-learn==1.7.2
148168
scipy==1.16.2
149169
SecretStorage==3.3.3
150170
sentence-transformers==5.1.2
171+
setuptools==80.9.0
151172
shellingham==1.5.4
152173
six==1.17.0
153174
slack_bolt==1.23.0
@@ -178,6 +199,8 @@ unearth==0.17.2
178199
urllib3==2.3.0
179200
uvicorn==0.38.0
180201
virtualenv==20.28.1
202+
websockets==15.0.1
203+
wheel==0.45.1
181204
wrapt==1.17.3
182205
xmltodict==0.14.2
183206
yarl==1.18.3

0 commit comments

Comments
 (0)