Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
406279c
build(deps): bump github.com/spf13/cobra from 1.9.1 to 1.10.1 (#299)
dependabot[bot] Sep 3, 2025
a8b3f54
build(deps): bump github.com/mark3labs/mcp-go from 0.38.0 to 0.39.1 (…
dependabot[bot] Sep 4, 2025
f2a6b90
build(deps): bump github.com/spf13/pflag from 1.0.7 to 1.0.10 (#301)
dependabot[bot] Sep 5, 2025
18005a3
build(deps): bump golang.org/x/sync from 0.16.0 to 0.17.0 (#303)
dependabot[bot] Sep 8, 2025
6bfa127
build(deps): bump golang.org/x/oauth2 from 0.30.0 to 0.31.0 (#302)
dependabot[bot] Sep 8, 2025
a690499
build(deps): bump sigs.k8s.io/controller-runtime from 0.22.0 to 0.22.…
dependabot[bot] Sep 10, 2025
36bb0b9
build(deps): bump github.com/spf13/afero from 1.14.0 to 1.15.0 (#307)
dependabot[bot] Sep 10, 2025
2503353
build(deps): bump k8s.io/api from 0.34.0 to 0.34.1 (#311)
dependabot[bot] Sep 11, 2025
193ac1f
build(deps): bump k8s.io/metrics from 0.34.0 to 0.34.1 (#312)
dependabot[bot] Sep 11, 2025
a8b6041
build(deps): bump k8s.io/cli-runtime from 0.34.0 to 0.34.1 (#314)
dependabot[bot] Sep 11, 2025
467e7e6
build(deps): bump k8s.io/apiextensions-apiserver from 0.34.0 to 0.34.…
dependabot[bot] Sep 11, 2025
10c82f7
refactor(toolsets): renamed Profile to Toolset (#309)
manusa Sep 11, 2025
6c573f3
feat(kubernetes): add support for previousPod container logs (#256)
samuelmasuy Sep 11, 2025
ea641e6
test(mcp): toolset metadata assertion (#318)
manusa Sep 11, 2025
4361a9e
build(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1 (…
dependabot[bot] Sep 12, 2025
2b6c886
refactor(mcp): toolset Tools definition is agnostic of MCP impl (#319)
manusa Sep 12, 2025
209e843
feat(mcp): toolset definitions completely agnostic from underlying MC…
manusa Sep 12, 2025
3fc4fa4
build(deps): bump github.com/google/jsonschema-go from 0.2.2 to 0.2.3…
dependabot[bot] Sep 15, 2025
48cf204
feat(toolsets): add support for multiple toolsets in configuration (#…
manusa Sep 17, 2025
d9d35b9
test(toolsets): toolset specific metadata tests (#326)
manusa Sep 17, 2025
f496c64
test(mcp): refactor configuration toolset tests (#327)
manusa Sep 17, 2025
d6936f4
test(mcp): refactor events toolset tests (#328)
manusa Sep 17, 2025
2bf6c54
test(mcp): remove side-effects from toolsets tests (#329)
manusa Sep 17, 2025
e16114d
test(mcp): refactor core toolset tests (namespaces) (#330)
manusa Sep 17, 2025
94baad6
fix(cmd): disable klog in STDIO mode (#331)
manusa Sep 17, 2025
97236a7
build(deps): bump golang.org/x/net from 0.42.0 to 0.44.0 (#332)
dependabot[bot] Sep 18, 2025
22de31d
build(deps): bump k8s.io/kubectl from 0.33.4 to 0.34.1
dependabot[bot] Sep 11, 2025
6e29a2a
feat(pods): update metrics to comply with new API
manusa Sep 18, 2025
76e2232
build(deps): bump helm.sh/helm/v3 from 3.18.6 to 3.19.0 (#321)
dependabot[bot] Sep 18, 2025
8af889b
test(mcp): refactor helm toolset tests (#333)
manusa Sep 18, 2025
5b33e1a
chore(doc): fix cursor link (#334)
manusa Sep 18, 2025
2b72f5f
build(deps): bump github.com/mark3labs/mcp-go from 0.39.1 to 0.40.0 (…
dependabot[bot] Sep 22, 2025
4c5bce1
feat(container): added non-privileged image user (#336)
sabre1041 Sep 22, 2025
8e666d4
build(deps): bump github.com/google/jsonschema-go from 0.2.3 to 0.3.0…
dependabot[bot] Sep 23, 2025
053fb2e
feat(pods): add optional tail parameter to pod logs retrieval (#335)
iamsudip Sep 25, 2025
c69e90c
fix(mcp): InputSchema schema with empty properties for no-arg tools (…
manusa Sep 25, 2025
da152bc
Merge remote-tracking branch 'downstream/main' into sync-downstream
ardaguclu Sep 25, 2025
4596773
Upstream<carry>: Add OCP specific configurations
ardaguclu Sep 25, 2025
a9608d2
Upstream<drop>: Run go mod vendor
ardaguclu Sep 25, 2025
45fac4f
Upstream<carry>: Update Dockerfile.ocp
ardaguclu Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN make build
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
WORKDIR /app
COPY --from=builder /app/kubernetes-mcp-server /app/kubernetes-mcp-server
USER 65532:65532
ENTRYPOINT ["/app/kubernetes-mcp-server", "--port", "8080"]

EXPOSE 8080
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,7 @@ golangci-lint: ## Download and install golangci-lint if not already installed
.PHONY: lint
lint: golangci-lint ## Lint the code
$(GOLANGCI_LINT) run --verbose --print-resources-usage

.PHONY: update-readme-tools
update-readme-tools: ## Update the README.md file with the latest toolsets
go run ./internal/tools/update-readme/main.go README.md
162 changes: 81 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ OpenShift MCP Server is currently under development.
A powerful and flexible Kubernetes [Model Context Protocol (MCP)](https://blog.marcnuri.com/model-context-protocol-mcp-introduction) server implementation with support for **Kubernetes** and **OpenShift**.

- **✅ Configuration**:
- Automatically detect changes in the Kubernetes configuration and update the MCP server.
- **View** and manage the current [Kubernetes `.kube/config`](https://blog.marcnuri.com/where-is-my-default-kubeconfig-file) or in-cluster configuration.
- Automatically detect changes in the Kubernetes configuration and update the MCP server.
- **View** and manage the current [Kubernetes `.kube/config`](https://blog.marcnuri.com/where-is-my-default-kubeconfig-file) or in-cluster configuration.
- **✅ Generic Kubernetes Resources**: Perform operations on **any** Kubernetes or OpenShift resource.
- Any CRUD operation (Create or Update, Get, List, Delete).
- Any CRUD operation (Create or Update, Get, List, Delete).
- **✅ Pods**: Perform Pod-specific operations.
- **List** pods in all namespaces or in a specific namespace.
- **Get** a pod by name from the specified namespace.
- **Delete** a pod by name from the specified namespace.
- **Show logs** for a pod by name from the specified namespace.
- **Top** gets resource usage metrics for all pods or a specific pod in the specified namespace.
- **Exec** into a pod and run a command.
- **Run** a container image in a pod and optionally expose it.
- **List** pods in all namespaces or in a specific namespace.
- **Get** a pod by name from the specified namespace.
- **Delete** a pod by name from the specified namespace.
- **Show logs** for a pod by name from the specified namespace.
- **Top** gets resource usage metrics for all pods or a specific pod in the specified namespace.
- **Exec** into a pod and run a command.
- **Run** a container image in a pod and optionally expose it.
- **✅ Namespaces**: List Kubernetes Namespaces.
- **✅ Events**: View Kubernetes events in all namespaces or in a specific namespace.
- **✅ Projects**: List OpenShift Projects.
- **☸️ Helm**:
- **Install** a Helm chart in the current or provided namespace.
- **List** Helm releases in all namespaces or in a specific namespace.
- **Uninstall** a Helm release in the current or provided namespace.
- **Install** a Helm chart in the current or provided namespace.
- **List** Helm releases in all namespaces or in a specific namespace.
- **Uninstall** a Helm release in the current or provided namespace.

Unlike other Kubernetes MCP server implementations, this **IS NOT** just a wrapper around `kubectl` or `helm` command-line tools.
It is a **Go-based native implementation** that interacts directly with the Kubernetes API server.
Expand Down Expand Up @@ -160,59 +160,59 @@ Get the current Kubernetes configuration content as a kubeconfig YAML

**Parameters:**
- `minified` (`boolean`, optional, default: `true`)
- Return a minified version of the configuration
- If `true`, keeps only the current-context and relevant configuration pieces
- If `false`, returns all contexts, clusters, auth-infos, and users
- Return a minified version of the configuration
- If `true`, keeps only the current-context and relevant configuration pieces
- If `false`, returns all contexts, clusters, auth-infos, and users

### `events_list`

List all the Kubernetes events in the current cluster from all namespaces

**Parameters:**
- `namespace` (`string`, optional)
- Namespace to retrieve the events from. If not provided, will list events from all namespaces
- Namespace to retrieve the events from. If not provided, will list events from all namespaces

### `helm_install`

Install a Helm chart in the current or provided namespace with the provided name and chart

**Parameters:**
- `chart` (`string`, required)
- Name of the Helm chart to install
- Can be a local path or a remote URL
- Example: `./my-chart.tgz` or `https://example.com/my-chart.tgz`
- Name of the Helm chart to install
- Can be a local path or a remote URL
- Example: `./my-chart.tgz` or `https://example.com/my-chart.tgz`
- `values` (`object`, optional)
- Values to pass to the Helm chart
- Example: `{"key": "value"}`
- Values to pass to the Helm chart
- Example: `{"key": "value"}`
- `name` (`string`, optional)
- Name of the Helm release
- Random name if not provided
- Name of the Helm release
- Random name if not provided
- `namespace` (`string`, optional)
- Namespace to install the Helm chart in
- If not provided, will use the configured namespace
- Namespace to install the Helm chart in
- If not provided, will use the configured namespace

### `helm_list`

List all the Helm releases in the current or provided namespace (or in all namespaces if specified)

**Parameters:**
- `namespace` (`string`, optional)
- Namespace to list the Helm releases from
- If not provided, will use the configured namespace
- Namespace to list the Helm releases from
- If not provided, will use the configured namespace
- `all_namespaces` (`boolean`, optional)
- If `true`, will list Helm releases from all namespaces
- If `false`, will list Helm releases from the specified namespace
- If `true`, will list Helm releases from all namespaces
- If `false`, will list Helm releases from the specified namespace

### `helm_uninstall`

Uninstall a Helm release in the current or provided namespace with the provided name

**Parameters:**
- `name` (`string`, required)
- Name of the Helm release to uninstall
- Name of the Helm release to uninstall
- `namespace` (`string`, optional)
- Namespace to uninstall the Helm release from
- If not provided, will use the configured namespace
- Namespace to uninstall the Helm release from
- If not provided, will use the configured namespace

### `namespaces_list`

Expand All @@ -226,97 +226,97 @@ Delete a Kubernetes Pod in the current or provided namespace with the provided n

**Parameters:**
- `name` (`string`, required)
- Name of the Pod to delete
- Name of the Pod to delete
- `namespace` (`string`, required)
- Namespace to delete the Pod from
- Namespace to delete the Pod from

### `pods_exec`

Execute a command in a Kubernetes Pod in the current or provided namespace with the provided name and command

**Parameters:**
- `command` (`string[]`, required)
- Command to execute in the Pod container
- First item is the command, rest are arguments
- Example: `["ls", "-l", "/tmp"]`
- Command to execute in the Pod container
- First item is the command, rest are arguments
- Example: `["ls", "-l", "/tmp"]`
- `name` (string, required)
- Name of the Pod
- Name of the Pod
- `namespace` (string, required)
- Namespace of the Pod
- Namespace of the Pod
- `container` (`string`, optional)
- Name of the Pod container to get logs from
- Name of the Pod container to get logs from

### `pods_get`

Get a Kubernetes Pod in the current or provided namespace with the provided name

**Parameters:**
- `name` (`string`, required)
- Name of the Pod
- Name of the Pod
- `namespace` (`string`, required)
- Namespace to get the Pod from
- Namespace to get the Pod from

### `pods_list`

List all the Kubernetes pods in the current cluster from all namespaces

**Parameters:**
- `labelSelector` (`string`, optional)
- Kubernetes label selector (e.g., 'app=myapp,env=prod' or 'app in (myapp,yourapp)'). Use this option to filter the pods by label
- Kubernetes label selector (e.g., 'app=myapp,env=prod' or 'app in (myapp,yourapp)'). Use this option to filter the pods by label

### `pods_list_in_namespace`

List all the Kubernetes pods in the specified namespace in the current cluster

**Parameters:**
- `namespace` (`string`, required)
- Namespace to list pods from
- Namespace to list pods from
- `labelSelector` (`string`, optional)
- Kubernetes label selector (e.g., 'app=myapp,env=prod' or 'app in (myapp,yourapp)'). Use this option to filter the pods by label
- Kubernetes label selector (e.g., 'app=myapp,env=prod' or 'app in (myapp,yourapp)'). Use this option to filter the pods by label

### `pods_log`

Get the logs of a Kubernetes Pod in the current or provided namespace with the provided name

**Parameters:**
- `name` (`string`, required)
- Name of the Pod to get logs from
- Name of the Pod to get logs from
- `namespace` (`string`, required)
- Namespace to get the Pod logs from
- Namespace to get the Pod logs from
- `container` (`string`, optional)
- Name of the Pod container to get logs from
- Name of the Pod container to get logs from

### `pods_run`

Run a Kubernetes Pod in the current or provided namespace with the provided container image and optional name

**Parameters:**
- `image` (`string`, required)
- Container Image to run in the Pod
- Container Image to run in the Pod
- `namespace` (`string`, required)
- Namespace to run the Pod in
- Namespace to run the Pod in
- `name` (`string`, optional)
- Name of the Pod (random name if not provided)
- Name of the Pod (random name if not provided)
- `port` (`number`, optional)
- TCP/IP port to expose from the Pod container
- No port exposed if not provided
- TCP/IP port to expose from the Pod container
- No port exposed if not provided

### `pods_top`

Lists the resource consumption (CPU and memory) as recorded by the Kubernetes Metrics Server for the specified Kubernetes Pods in the all namespaces, the provided namespace, or the current namespace

**Parameters:**
- `all_namespaces` (`boolean`, optional, default: `true`)
- If `true`, lists resource consumption for Pods in all namespaces
- If `false`, lists resource consumption for Pods in the configured or provided namespace
- If `true`, lists resource consumption for Pods in all namespaces
- If `false`, lists resource consumption for Pods in the configured or provided namespace
- `namespace` (`string`, optional)
- Namespace to list the Pod resources from
- If not provided, will list Pods from the configured namespace (in case all_namespaces is false)
- Namespace to list the Pod resources from
- If not provided, will list Pods from the configured namespace (in case all_namespaces is false)
- `name` (`string`, optional)
- Name of the Pod to get resource consumption from
- If not provided, will list resource consumption for all Pods in the applicable namespace(s)
- Name of the Pod to get resource consumption from
- If not provided, will list resource consumption for all Pods in the applicable namespace(s)
- `label_selector` (`string`, optional)
- Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the pods by label (Optional, only applicable when name is not provided)
- Kubernetes label selector (e.g. 'app=myapp,env=prod' or 'app in (myapp,yourapp)'), use this option when you want to filter the pods by label (Optional, only applicable when name is not provided)

### `projects_list`

Expand All @@ -328,8 +328,8 @@ Create or update a Kubernetes resource in the current cluster by providing a YAM

**Parameters:**
- `resource` (`string`, required)
- A JSON or YAML containing a representation of the Kubernetes resource
- Should include top-level fields such as apiVersion, kind, metadata, and spec
- A JSON or YAML containing a representation of the Kubernetes resource
- Should include top-level fields such as apiVersion, kind, metadata, and spec

**Common apiVersion and kind include:**
- v1 Pod
Expand All @@ -344,47 +344,47 @@ Delete a Kubernetes resource in the current cluster

**Parameters:**
- `apiVersion` (`string`, required)
- apiVersion of the resource (e.g., `v1`, `apps/v1`, `networking.k8s.io/v1`)
- apiVersion of the resource (e.g., `v1`, `apps/v1`, `networking.k8s.io/v1`)
- `kind` (`string`, required)
- kind of the resource (e.g., `Pod`, `Service`, `Deployment`, `Ingress`)
- kind of the resource (e.g., `Pod`, `Service`, `Deployment`, `Ingress`)
- `name` (`string`, required)
- Name of the resource
- Name of the resource
- `namespace` (`string`, optional)
- Namespace to delete the namespaced resource from
- Ignored for cluster-scoped resources
- Uses configured namespace if not provided
- Namespace to delete the namespaced resource from
- Ignored for cluster-scoped resources
- Uses configured namespace if not provided

### `resources_get`

Get a Kubernetes resource in the current cluster

**Parameters:**
- `apiVersion` (`string`, required)
- apiVersion of the resource (e.g., `v1`, `apps/v1`, `networking.k8s.io/v1`)
- apiVersion of the resource (e.g., `v1`, `apps/v1`, `networking.k8s.io/v1`)
- `kind` (`string`, required)
- kind of the resource (e.g., `Pod`, `Service`, `Deployment`, `Ingress`)
- kind of the resource (e.g., `Pod`, `Service`, `Deployment`, `Ingress`)
- `name` (`string`, required)
- Name of the resource
- Name of the resource
- `namespace` (`string`, optional)
- Namespace to retrieve the namespaced resource from
- Ignored for cluster-scoped resources
- Uses configured namespace if not provided
- Namespace to retrieve the namespaced resource from
- Ignored for cluster-scoped resources
- Uses configured namespace if not provided

### `resources_list`

List Kubernetes resources and objects in the current cluster

**Parameters:**
- `apiVersion` (`string`, required)
- apiVersion of the resources (e.g., `v1`, `apps/v1`, `networking.k8s.io/v1`)
- apiVersion of the resources (e.g., `v1`, `apps/v1`, `networking.k8s.io/v1`)
- `kind` (`string`, required)
- kind of the resources (e.g., `Pod`, `Service`, `Deployment`, `Ingress`)
- kind of the resources (e.g., `Pod`, `Service`, `Deployment`, `Ingress`)
- `namespace` (`string`, optional)
- Namespace to retrieve the namespaced resources from
- Ignored for cluster-scoped resources
- Lists resources from all namespaces if not provided
- Namespace to retrieve the namespaced resources from
- Ignored for cluster-scoped resources
- Lists resources from all namespaces if not provided
- `labelSelector` (`string`, optional)
- Kubernetes label selector (e.g., 'app=myapp,env=prod' or 'app in (myapp,yourapp)'). Use this option to filter the pods by label.
- Kubernetes label selector (e.g., 'app=myapp,env=prod' or 'app in (myapp,yourapp)'). Use this option to filter the pods by label.

## 🧑‍💻 Development <a id="development"></a>

Expand Down
Loading