How to Configure JetBrains AI Kubernetes MCP Server

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a jetbrains ai kubernetes mcp server by linking your local cluster profile to the plugin. Next, you bind a tight Kubernetes role to the user account that the server uses. Many teams start by handing the assistant their own local admin credentials. That fast setup works at first, but broad rights create big risks. One bad prompt can change live workloads or read private keys across every namespace. A safe setup needs strict role rules before the assistant runs its first task. How a j

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up a jetbrains ai kubernetes mcp server by linking your local cluster profile to the plugin. Next, you bind a tight Kubernetes role to the user account that the server uses. Many teams start by handing the assistant their own local admin credentials. That fast setup works at first, but broad rights create big risks. One bad prompt can change live workloads or read private keys across every namespace. A safe setup needs strict role rules before the assistant runs its first task.

How a jetbrains ai kubernetes mcp server works with cluster roles

The assistant runs a local server process on the developer machine. This server reads your local cluster file to find the target API endpoint. It then sends API calls to the cluster on behalf of the developer. Kubernetes checks every request from the server against its built-in RBAC system. In Kubernetes RBAC, a Role sets permissions inside one single namespace. A ClusterRole sets permissions across the whole cluster and covers nodes or all namespaces.

Permissions in Kubernetes RBAC are additive, which means there are no deny rules. You start with zero access and add rules for each resource and verb. A RoleBinding connects a Role or ClusterRole to a user within one namespace. A ClusterRoleBinding grants those permissions across the entire cluster at once. To keep the assistant safe, teams create a dedicated service account for it. They bind that account to a single namespace Role with read verbs only. Kubernetes also treats pod logs and pod exec calls as distinct subresources. If you grant access to the pods log subresource, the assistant can read output. If you leave out the pods exec subresource, it cannot run shell commands inside containers.

How to scope permissions for daily developer tasks

Start by listing the exact questions developers ask the assistant in their editor. Most developers want to check pod status, read deployment specs, or view recent events. These tasks only need get, list, and watch verbs on basic workload resources. They do not need access to secret objects or cluster node settings. Build a dedicated Role in a dev or staging namespace for these read tasks. Leave secret resources out of the rule list so keys stay safe.

Next, create a RoleBinding that links your new Role to the assistant account. Test the setup by asking the assistant to list pods in that namespace. Then ask it to read pods in another namespace to confirm the block works. If developers need the assistant to change resources, keep those rights in local clusters. Never bind a ClusterRole with write verbs to an assistant in shared clusters.

Kubernetes API Server Access + AI Agent Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native RBAC solves and what it leaves open

Native Kubernetes RBAC controls which API endpoints a user or assistant can call. It stops an assistant with read roles from deleting deployments or reading secret objects. It also walls off namespaces so a dev tool cannot touch other teams. This setup solves the initial login and broad resource access problem well.

Still, RBAC only checks the resource type and verb at the API door. It does not inspect what happens inside an allowed request during flight. For example, pod logs often contain plain text emails, phone numbers, or card numbers. Once RBAC allows access to the pod log subresource, all that text flows back. In the same way, an allowed exec subresource call can run any command inside the pod. RBAC cannot pause a single risky command or rewrite sensitive fields in log output.

Govern kubectl and API calls in flight

Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.

First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.

Frequently asked questions

Can the assistant use my default local cluster credentials?

Yes, the server uses whatever cluster user is active in your local setup. Using a separate account with a scoped RoleBinding is much safer for shared clusters.

How do I stop the assistant from running commands inside pods?

Leave the pods exec subresource out of your Role rules. Because Kubernetes RBAC has no deny rules, leaving a rule out blocks that action.

Does a Role in one namespace protect pod logs from leaking data?

No, a Role only decides if the assistant can read the log subresource. If allowed, the full log text returns, including any emails or card numbers inside it.

The query runs. The emails stay hidden.