Skip to content

Commit 39442fb

Browse files
authored
feat(tekton): add Tekton toolset with pipeline and task management (#892)
* feat: add tekton into go dependencies the new tekton tool set will require its packages. This commit add the tekton pipelines package Code was assisted by Cursor AI. Signed-off-by: Karel Simon <ksimon@redhat.com> * feat(tekton): add Tekton toolset with pipeline and task management Introduces a new `tekton` toolset exposing 5 domain-specific tools: - tekton_pipeline_start: start a Pipeline (with optional typed params) - tekton_pipelinerun_restart: restart an existing PipelineRun - tekton_task_start: start a Task (with optional typed params) - tekton_taskrun_restart: restart an existing TaskRun - tekton_taskrun_logs: fetch logs from a TaskRun's underlying pod Generic CRUD operations for Tekton resources remain available via the core toolset's resources_* tools. The params argument on start tools supports string, array, and object Tekton parameter types. Includes unit tests, snapshot tests, and README documentation. Code was assisted by Cursor AI. Signed-off-by: Karel Simon <ksimon@redhat.com> --------- Signed-off-by: Karel Simon <ksimon@redhat.com>
1 parent 9756ab9 commit 39442fb

16 files changed

Lines changed: 1037 additions & 26 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ A powerful and flexible Kubernetes [Model Context Protocol (MCP)](https://blog.m
3434
- **Install** a Helm chart in the current or provided namespace.
3535
- **List** Helm releases in all namespaces or in a specific namespace.
3636
- **Uninstall** a Helm release in the current or provided namespace.
37+
- **🔧 Tekton**: Tekton-specific operations that complement generic Kubernetes resource management.
38+
- **Pipeline**: Start a Tekton Pipeline by creating a PipelineRun.
39+
- **PipelineRun**: Restart a PipelineRun with the same spec.
40+
- **Task**: Start a Tekton Task by creating a TaskRun.
41+
- **TaskRun**: Restart a TaskRun with the same spec, and retrieve TaskRun logs via pod resolution.
3742
- **🔭 Observability**: Optional OpenTelemetry distributed tracing and metrics with custom sampling rates. Includes `/stats` endpoint for real-time statistics. See [OTEL.md](docs/OTEL.md).
3843

3944
Unlike other Kubernetes MCP server implementations, this **IS NOT** just a wrapper around `kubectl` or `helm` command-line tools.
@@ -268,6 +273,7 @@ The following sets of tools are available (toolsets marked with ✓ in the Defau
268273
| kcp | Manage kcp workspaces and multi-tenancy features | |
269274
| kiali | Most common tools for managing Kiali, check the [Kiali documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/KIALI.md) for more details. | |
270275
| kubevirt | KubeVirt virtual machine management tools, check the [KubeVirt documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/kubevirt.md) for more details. | |
276+
| tekton | Tekton pipeline management tools for Pipelines, PipelineRuns, Tasks, and TaskRuns. | |
271277

272278
<!-- AVAILABLE-TOOLSETS-END -->
273279

@@ -515,6 +521,35 @@ In case multi-cluster support is enabled (default) and you have access to multip
515521

516522
</details>
517523

524+
<details>
525+
526+
<summary>tekton</summary>
527+
528+
- **tekton_pipeline_start** - Start a Tekton Pipeline by creating a PipelineRun that references it
529+
- `name` (`string`) **(required)** - Name of the Pipeline to start
530+
- `namespace` (`string`) - Namespace of the Pipeline
531+
- `params` (`object`) - Parameter values to pass to the Pipeline. Keys are parameter names; values can be a string, an array of strings, or an object (map of string to string) depending on the parameter type defined in the Pipeline spec
532+
533+
- **tekton_pipelinerun_restart** - Restart a Tekton PipelineRun by creating a new PipelineRun with the same spec
534+
- `name` (`string`) **(required)** - Name of the PipelineRun to restart
535+
- `namespace` (`string`) - Namespace of the PipelineRun
536+
537+
- **tekton_task_start** - Start a Tekton Task by creating a TaskRun that references it
538+
- `name` (`string`) **(required)** - Name of the Task to start
539+
- `namespace` (`string`) - Namespace of the Task
540+
- `params` (`object`) - Parameter values to pass to the Task. Keys are parameter names; values can be a string, an array of strings, or an object (map of string to string) depending on the parameter type defined in the Task spec
541+
542+
- **tekton_taskrun_restart** - Restart a Tekton TaskRun by creating a new TaskRun with the same spec
543+
- `name` (`string`) **(required)** - Name of the TaskRun to restart
544+
- `namespace` (`string`) - Namespace of the TaskRun
545+
546+
- **tekton_taskrun_logs** - Get the logs from a Tekton TaskRun by resolving its underlying pod
547+
- `name` (`string`) **(required)** - Name of the TaskRun to get logs from
548+
- `namespace` (`string`) - Namespace of the TaskRun
549+
- `tail` (`integer`) - Number of lines to retrieve from the end of the logs (Optional, default: 100)
550+
551+
</details>
552+
518553

519554
<!-- AVAILABLE-TOOLSETS-TOOLS-END -->
520555

docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ Toolsets group related tools together. Enable only the toolsets you need to redu
296296
| kcp | Manage kcp workspaces and multi-tenancy features | |
297297
| kiali | Most common tools for managing Kiali, check the [Kiali documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/KIALI.md) for more details. | |
298298
| kubevirt | KubeVirt virtual machine management tools, check the [KubeVirt documentation](https://github.com/containers/kubernetes-mcp-server/blob/main/docs/kubevirt.md) for more details. | |
299+
| tekton | Tekton pipeline management tools for Pipelines, PipelineRuns, Tasks, and TaskRuns. | |
299300

300301
<!-- AVAILABLE-TOOLSETS-END -->
301302

go.mod

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/containers/kubernetes-mcp-server
22

3-
go 1.25.6
3+
go 1.25.7
44

55
require (
66
github.com/BurntSushi/toml v1.6.0
@@ -16,6 +16,7 @@ require (
1616
github.com/spf13/cobra v1.10.2
1717
github.com/spf13/pflag v1.0.10
1818
github.com/stretchr/testify v1.11.1
19+
github.com/tektoncd/pipeline v1.11.0
1920
go.opentelemetry.io/otel v1.43.0
2021
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.43.0
2122
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.43.0
@@ -47,13 +48,15 @@ require (
4748
)
4849

4950
require (
51+
cel.dev/expr v0.25.1 // indirect
5052
dario.cat/mergo v1.0.2 // indirect
5153
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
5254
github.com/MakeNowJust/heredoc v1.0.0 // indirect
5355
github.com/Masterminds/goutils v1.1.1 // indirect
5456
github.com/Masterminds/semver/v3 v3.4.0 // indirect
5557
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
5658
github.com/Masterminds/squirrel v1.5.4 // indirect
59+
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
5760
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
5861
github.com/beorn7/perks v1.0.1 // indirect
5962
github.com/blang/semver/v4 v4.0.0 // indirect
@@ -80,6 +83,7 @@ require (
8083
github.com/go-openapi/swag v0.23.1 // indirect
8184
github.com/gobwas/glob v0.2.3 // indirect
8285
github.com/google/btree v1.1.3 // indirect
86+
github.com/google/cel-go v0.27.0 // indirect
8387
github.com/google/go-cmp v0.7.0 // indirect
8488
github.com/google/uuid v1.6.0 // indirect
8589
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
@@ -93,7 +97,7 @@ require (
9397
github.com/jmoiron/sqlx v1.4.0 // indirect
9498
github.com/josharian/intern v1.0.0 // indirect
9599
github.com/json-iterator/go v1.1.12 // indirect
96-
github.com/klauspost/compress v1.18.0 // indirect
100+
github.com/klauspost/compress v1.18.4 // indirect
97101
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
98102
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
99103
github.com/lib/pq v1.10.9 // indirect
@@ -128,22 +132,24 @@ require (
128132
github.com/segmentio/asm v1.1.3 // indirect
129133
github.com/segmentio/encoding v0.5.4 // indirect
130134
github.com/shopspring/decimal v1.4.0 // indirect
131-
github.com/sirupsen/logrus v1.9.3 // indirect
135+
github.com/sirupsen/logrus v1.9.4 // indirect
132136
github.com/spf13/cast v1.7.1 // indirect
133137
github.com/x448/float16 v0.8.4 // indirect
134138
github.com/xlab/treeprint v1.2.0 // indirect
135139
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
136140
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
137-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
141+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0 // indirect
138142
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
139143
go.yaml.in/yaml/v2 v2.4.4 // indirect
140144
go.yaml.in/yaml/v3 v3.0.4 // indirect
141145
golang.org/x/crypto v0.49.0 // indirect
146+
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect
142147
golang.org/x/net v0.52.0 // indirect
143148
golang.org/x/sys v0.42.0 // indirect
144149
golang.org/x/term v0.41.0 // indirect
145150
golang.org/x/text v0.35.0 // indirect
146-
golang.org/x/time v0.12.0 // indirect
151+
golang.org/x/time v0.14.0 // indirect
152+
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
147153
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
148154
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
149155
google.golang.org/grpc v1.80.0 // indirect
@@ -152,6 +158,7 @@ require (
152158
gopkg.in/yaml.v3 v3.0.1 // indirect
153159
k8s.io/apiserver v0.35.3 // indirect
154160
k8s.io/component-base v0.35.3 // indirect
161+
knative.dev/pkg v0.0.0-20260318013857-98d5a706d4fd // indirect
155162
oras.land/oras-go/v2 v2.6.0 // indirect
156163
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
157164
sigs.k8s.io/kustomize/api v0.20.1 // indirect

0 commit comments

Comments
 (0)