Skip to content

Commit 13879b6

Browse files
committed
chore: move obs-mcp to root repo
Signed-off-by: Jayapriya Pai <janantha@redhat.com>
1 parent b392fba commit 13879b6

33 files changed

+70
-109
lines changed

.ci-operator.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
name: obs-mcp-unit
1+
name: unit
22

33
on:
44
push:
55
pull_request:
66
branches:
77
- main
8-
paths:
9-
- "obs-mcp/**"
10-
- ".github/workflows/obs-mcp-unit.yaml"
8+
119
# To cancel running workflow when new commits pushed in a pull request
1210
concurrency:
1311
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -27,4 +25,4 @@ jobs:
2725
with:
2826
go-version: "${{ env.golang-version }}"
2927
check-latest: true
30-
- run: make obs-mcp-test
28+
- run: make test-unit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ obs-mcp/obs-mcp
1515
.devcontainer/dev.env
1616
integration-tests/videos
1717
integration-tests/screenshots
18+
.vscode/*

.vscode/settings.json

Lines changed: 0 additions & 21 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

Makefile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CONTAINER_CLI ?= docker
44

55
.PHONY: help
66
help: ## Show this help message
7-
@echo "Genie Plugin - Available commands:"
7+
@echo "obs-mcp - Available commands:"
88
@echo ""
99
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
1010

@@ -14,26 +14,26 @@ check-tools: ## Check if required tools are installed
1414
@command -v $(CONTAINER_CLI) >/dev/null 2>&1 || echo "Warning: $(CONTAINER_CLI) is not installed. Container builds will fail."
1515
@echo "✓ All required tools are installed"
1616

17-
.PHONY: obs-mcp-build
18-
obs-mcp-build: ## Build obs-mcp binary
19-
@cd obs-mcp && go build -tags strictfipsruntime -o obs-mcp ./cmd/obs-mcp
17+
.PHONY: build
18+
build: ## Build obs-mcp binary
19+
go build -tags strictfipsruntime -o obs-mcp ./cmd/obs-mcp
2020

21-
.PHONY: obs-mcp-test
22-
obs-mcp-test: ## Run obs-mcp tests
23-
@cd obs-mcp && go test -v -race ./...
21+
.PHONY: test-unit
22+
test: ## Run obs-mcp unit tests
23+
go test -v -race ./...
2424

25-
.PHONY: obs-mcp-clean
26-
obs-mcp-clean: ## Clean obs-mcp build artifacts
27-
@cd obs-mcp && go clean && rm -f obs-mcp/obs-mcp
25+
.PHONY: clean
26+
clean: ## Clean obs-mcp build artifacts
27+
go clean && rm -f obs-mcp
2828

29-
.PHONY: obs-mcp-container
30-
obs-mcp-container: obs-mcp-build ## Build obs-mcp container image
31-
@cd obs-mcp && $(CONTAINER_CLI) build -f Containerfile -t obs-mcp:latest .
29+
.PHONY: container
30+
container: build ## Build obs-mcp container image
31+
$(CONTAINER_CLI) build -f Containerfile -t obs-mcp:latest .
3232

3333
.PHONY: format
3434
format: ## Format all code
35-
@cd obs-mcp && go fmt ./...
35+
go fmt ./...
3636

3737
.PHONY: setup
3838
setup: check-tools ## Install dependencies for all components
39-
@cd obs-mcp && go mod download
39+
go mod download

README.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,51 @@
1-
# obs-mcp
1+
# obs mcp server
22

3-
This is an [MCP](https://modelcontextprotocol.io/introduction) server to allow LLMs to interact with a running [Prometheus](https://prometheus.io/) instance via the API.
3+
This is an [mcp](https://modelcontextprotocol.io/introduction) server to allow LLMs to interact with a running [Prometheus](https://prometheus.io/) instance via the API.
44

55
> [!NOTE]
66
> This project is moved from [jhadvig/genie-plugin](https://github.com/jhadvig/genie-plugin/tree/main/obs-mcp) preserving the history of commits.
77
8-
## Pre-requisites
8+
## Development Quickstart
99

10-
Before starting, ensure you have the following:
10+
The easiest way to get the obs-mcp connected to the cluster is via a kubeconfig:
1111

12-
- A working Lightspeed Core-based server with the capability to integrate the MCP server located in the `obs-mcp` directory of this project.
13-
- Access to a model capable of tool calling. This project was tested with `gpt-4o-mini`.
14-
- An environment where both Node.js (version 20 or higher) and Golang are available. Using `nvm` (Node Version Manager) and `gvm` (Go Version Manager) is recommended for managing multiple versions.
15-
- Access to an OpenShift Container Platform (OCP) cluster with the monitoring plugin installed.
12+
1. Log into your OpenShift cluster
13+
2. Run the server with
1614

17-
## Getting Started
15+
```sh
16+
go run ./cmd/obs-mcp/ --listen 127.0.0.1:9100 --auth-mode kubeconfig --insecure
17+
```
1818

19-
See the [obs-mcp README](./obs-mcp/README.md)
19+
This will connect the obs-mcp to the thanos querier running in the cluster.
20+
21+
This procedure would not work if you're not using token-based auth (`oc whoami -t` to validate).
22+
In that case, consider using serviceaccount + token auth. Alternatively, follow the procedure bellow.
23+
24+
> [!NOTE]
25+
> It is possible to hit the ground running locally as well:
26+
27+
```shell
28+
helm install prometheus-community/prometheus --name-template <prefix> # sets up Prometheus (and exporters) on your local single-node k8s cluster
29+
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=alertmanager,app.kubernetes.io/instance=local" -o jsonpath="{.items[0].metadata.name}") && kubectl --namespace default port-forward $POD_NAME 9090
30+
go run ./cmd/obs-mcp/ --auth-mode header --insecure --listen :9100
31+
```
32+
33+
### Port-forwarding alternative
34+
35+
This scenario opens a local port via port-forward that the obs-mcp will connect to:
36+
37+
1. Log into your OpenShift cluster
38+
39+
1. Port forward the OpenShift Thanos instance to a local port
40+
41+
``` sh
42+
PROM_POD=$(kubectl get pods -n openshift-monitoring -l app.kubernetes.io/instance=thanos-querier -o jsonpath="{.items[0].met
43+
adata.name}")
44+
kubectl port-forward -n openshift-monitoring $PROM_POD 9090:9090
45+
```
46+
47+
1. Run the server with
48+
49+
```sh
50+
PROMETHEUS_URL=http://localhost:9090 go run ./cmd/obs-mcp/ --listen 127.0.0.1:9100 --auth-mode header
51+
```
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99

1010
"github.com/prometheus/common/promslog"
1111

12-
"github.com/inecas/obs-mcp/pkg/k8s"
13-
"github.com/inecas/obs-mcp/pkg/mcp"
14-
"github.com/inecas/obs-mcp/pkg/prometheus"
1512
"github.com/mark3labs/mcp-go/server"
13+
"github.com/rhobs/obs-mcp/pkg/k8s"
14+
"github.com/rhobs/obs-mcp/pkg/mcp"
15+
"github.com/rhobs/obs-mcp/pkg/prometheus"
1616
)
1717

1818
const (

0 commit comments

Comments
 (0)