Skip to content

Conversation

@ziadmoubayed
Copy link
Contributor

Summary:

This PR fixes startup failures when the server is pointed at clusters that authenticate with OIDC.
We add a single side-effect import:

import _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"

which registers the OIDC plug-in at init() time so that client-go can recognise the auth-provider: oidc stanza found in many kubeconfigs.

Motivation:

Running npx [email protected] against an OIDC-backed cluster produced:

Failed to initialize MCP server: no Auth Provider found for name "oidc"

@ziadmoubayed
Copy link
Contributor Author

I am not a go expert. Please let me know if the import should be place somewhere else

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! This is awesome (maybe we want to add other plugins too).

I am not a go expert. Please let me know if the import should be place somewhere else

To keep things in the same domain package, maybe it's better if we add the plugin import in between these lines:

https://github.com/manusa/kubernetes-mcp-server/blob/2bd12f8a64f9eecfd7e5d9287f3dc3f2cc209ff0/pkg/kubernetes/kubernetes.go#L14-L15

and remove it from the cmd/root.go

could you please check if this works too?

@manusa manusa self-assigned this May 29, 2025
@manusa manusa added this to the 0.1.0 milestone May 29, 2025 — with automated-tasks
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

@manusa manusa merged commit 714d2ba into containers:main May 29, 2025
5 checks passed
@ziadmoubayed
Copy link
Contributor Author

ziadmoubayed commented Jun 2, 2025

Thx! This is awesome (maybe we want to add other plugins too).

I am not a go expert. Please let me know if the import should be place somewhere else

To keep things in the same domain package, maybe it's better if we add the plugin import in between these lines:

https://github.com/manusa/kubernetes-mcp-server/blob/2bd12f8a64f9eecfd7e5d9287f3dc3f2cc209ff0/pkg/kubernetes/kubernetes.go#L14-L15

and remove it from the cmd/root.go

could you please check if this works too?

Thanks for the review. I did a test today. It works now. Facing #83 unfortunately.

Continued the support in #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants