Commit Graph

37 Commits

Author SHA1 Message Date
Marc Nuri
ca0aa4648d feat(mcp): log tool call (function name + arguments)
Signed-off-by: Marc Nuri <marc@marcnuri.com>
2025-07-22 14:35:19 +02:00
Marc Nuri
3fbfd8d7cb fix(lint): add golangci-lint make target + lint
Signed-off-by: Marc Nuri <marc@marcnuri.com>
2025-07-22 14:22:19 +02:00
Marc Nuri
cb9f296566 test(mcp): speed up tests by not setting the fake kubeconfig master to example.com
Signed-off-by: Marc Nuri <marc@marcnuri.com>
2025-07-18 10:46:32 +02:00
Arda Güçlü
186f445ca2 feat(config): introduce enabled/disabled tool list in configuration file (155)
Introduce allow/deny tool functionality in toml config
---
Remove duplicate fields that already defined in staticConfig
---
Add unit tests to verify tool valid check
---
Wire staticConfig to fix unit tests
---
Rename to enabled/disabled instead of allowed/denied
2025-07-01 16:02:36 +02:00
Marc Nuri
1968652aca test(config): extensive test suite for denied lists 2025-06-23 13:09:02 +02:00
Arda Güçlü
754da19d81 feat(config): introduce toml configuration file with a set of deny list 2025-06-19 13:41:47 +02:00
Marc Nuri
7e10e82a3a feat(output): table output to minimize resource list verbosity
A new configuration options is available: `--list-output`

There are two modes available:
 - `yaml`: current default (will be changed in subsequent PR), which returns a multi-document YAML
 - `table`: returns a plain-text table as created by the kube-api server when requested with
   `Accept: application/json;as=Table;v=v1;g=meta.k8s.io`

Additional logic has been added to the table format to include the apiVersion and kind.
This is not returned by the server, kubectl doesn't include this either.
However, this is extremely handy for the LLM when using the generic resource tools.
2025-06-12 13:26:40 +02:00
Marc Nuri
155fe6847f feat(output): configurable output architecture 2025-06-11 12:13:23 +02:00
Marc Nuri
f80d8df3c4 feat(auth): authorize user from custom SSE header (96)
feat(auth): Authorize user from custom SSE header

PoC to show how we can propagate an Authorization Bearer token
from the MCP client up to the Kubernetes API by passing a custom
header (Kubernetes-Authorization-Bearer-Token).

A new Derived client is necessary for each request due to the incompleteness
of some of the client-go clients.
This might add some overhead for each prompt.
Ideally, the issue with the discoveryclient and others should be fixed to
allow reading the authorization header from the request context.

To use the feature, the MCP Server still needs to be started with a basic
configuration (either provided InCluster by a service account or locally by
 a .kube/config file) so that it's able to infer the server settings.
---
test(auth): added tests to verify header propagation
---
refactor(auth): minor improvements for derived client
2025-05-29 17:07:28 +02:00
Marc Nuri
e6f20fc777 feat(config): --disable-destructive exposes tools not annotated with destructiveHint=true 2025-05-26 18:36:45 +02:00
Marc Nuri
5f279a81d8 feat(config): --read-only mode flag exposes only read-only annotated tools 2025-05-26 16:13:36 +02:00
Eran Cohen
2994699504 feat: add label selectors to listing tools
This PR introduces the ability to filter Kubernetes resources by label using a labelSelector parameter for the following tools:

 * pods_list
 * pods_list_in_namespace
 * resources_list

This enhancement allows users to retrieve a more specific set of resources based on their labels, improving the flexibility and utility of these tools.

The labelSelector parameter accepts standard Kubernetes label selector syntax, such as app=myapp,env=prod or app in (myapp,yourapp).

Signed-off-by: Eran Cohen <eranco@redhat.com>
2025-05-20 16:34:53 +02:00
Marc Nuri
e0fe25af3c test: add concurrency to OpenShift env setup 2025-05-16 13:14:22 +02:00
Marc Nuri
20cb33130a test: openshift environment using hooks 2025-05-16 11:49:55 +02:00
Marc Nuri
1f00601f43 test(profiles): bootstrap initial testing support for profiles 2025-05-16 11:30:14 +02:00
Marc Nuri
1f22f5b23f feat(profiles): bootstrap initial support for profiles 2025-05-15 16:55:08 +02:00
Marc Nuri
fa5bb81fe5 feat(kubernetes): added --kubeconfig flag option 2025-04-19 10:01:41 +02:00
Marc Nuri
79b0f2805c build(deps): bump github.com/mark3labs/mcp-go from 0.20.1 to 0.21.0 2025-04-17 07:21:25 +02:00
Marc Nuri
72ede2ea10 test: wait for CRD deletion 2025-03-27 19:03:54 +01:00
Marc Nuri
d74398f85b feat: support for listing namespaces and OpenShift projects 2025-03-27 16:50:13 +01:00
Marc Nuri
50277ce954 feat: configuration minification is optional 2025-03-27 06:50:14 +01:00
Marc Nuri
a98e69102c feat: watch for configuration changes
Watch kube config files for changes.
Automatically reload kubernetes client and list of tools.

Useful for logins or context changes after an MCP session has started.
2025-03-21 18:05:41 +01:00
Marc Nuri
39d21d77b0 test:fix: delete CRDs immediately 2025-03-07 13:14:19 +01:00
Marc Nuri
d7075f2c78 feat: improved prompt efficiency for OpenShift resources 2025-03-07 11:56:57 +01:00
Marc Nuri
7b129281f4 deps: bump github.com/mark3labs/mcp-go from v0.8.5 to v0.11.2 2025-03-07 09:44:02 +01:00
Marc Nuri
3522e4fb44 feat(kubernetes): fallback to configured namespace when listing from all namespaces
Fixes #4

If user is not authorized to list from all namespaces try to list from the configured namespace only.
2025-02-20 16:52:16 +01:00
Marc Nuri
90c2802429 fix(test): reset kube config location for each test 2025-02-20 07:06:00 +01:00
Marc Nuri
d3754585ec feat(kubernetes): reusable Kubernetes clients
Improve cache performance
2025-02-20 06:33:42 +01:00
Marc Nuri
40ff50e04d feat(kubernetes): pods_delete deletes managed resources 2025-02-19 16:20:50 +01:00
Marc Nuri
e6ab757915 feat(kubernetes): pods_run creates OpenShift routes 2025-02-18 05:34:27 +01:00
Marc Nuri
a8bb7c01a7 feat(kubernetes): resources_delete can get any resource in the cluster 2025-02-17 13:17:48 +01:00
Marc Nuri
6ae9247bae feat(kubernetes): resources_create_or_update can create or update any kind of resource 2025-02-17 12:05:59 +01:00
Marc Nuri
f591e2b06b feat(kubernetes): pods_get for explicit or nil namespace 2025-02-17 08:52:22 +01:00
Marc Nuri
0f12797365 test(pods): pods_list_in_namespace test suite 2025-02-17 06:38:44 +01:00
Marc Nuri
9ad87d362d feat(kubernetes): marshal all resources to yaml omitting managed fields 2025-02-15 04:59:00 +01:00
Marc Nuri
80488ef6ee feat(resources): initial support for resource listing 2025-02-13 16:06:06 +01:00
Marc Nuri
590f47c779 feat(configuration): initial configuration_view view implementation 2025-02-13 05:59:14 +01:00