How to Configure Devin Kubernetes MCP Server
You set up a devin kubernetes mcp server by linking the agent to a cluster role. The server reads cluster state and runs pod commands through the Kubernetes API. Teams often attach a broad admin role during initial testing to move fast. That wide role lets an autonomous agent delete workloads or read secrets across all namespaces. Scoping permissions before the agent runs tasks prevents bad cluster changes. How a devin kubernetes mcp server works with native RBAC The Model Context Protocol se
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 devin kubernetes mcp server by linking the agent to a cluster role. The server reads cluster state and runs pod commands through the Kubernetes API. Teams often attach a broad admin role during initial testing to move fast. That wide role lets an autonomous agent delete workloads or read secrets across all namespaces. Scoping permissions before the agent runs tasks prevents bad cluster changes.
How a devin kubernetes mcp server works with native RBAC
The Model Context Protocol server acts as a bridge between Devin and your cluster. Devin sends tool calls to the server when it needs to check pods or logs. The server translates those tool calls into standard Kubernetes API requests. The Kubernetes API server then checks the request against Role-Based Access Control rules.
In Kubernetes RBAC, a Role sets permissions within one single namespace. A ClusterRole sets permissions across the whole cluster or for cluster-scoped items like nodes. You link the MCP server identity to these rules with a RoleBinding or ClusterRoleBinding. A RoleBinding grants permissions inside one namespace, while a ClusterRoleBinding grants access cluster-wide.
Kubernetes RBAC permissions are purely additive, which means there are no deny rules. You start with zero access and add specific verbs like get, list, or watch. Some API calls target subresources, such as reading pod logs or running exec commands. You must grant explicit access to subresources like pod logs in your role rules. This setup keeps the agent inside its assigned namespace during routine debugging work.
What native RBAC solves and what it leaves open
Native RBAC controls which API endpoints and namespaces the MCP server can reach. It stops an agent in a staging namespace from touching production workloads. You can also block write verbs so the agent only reads pod status. For basic status checks, a read-only Role in one namespace works well.
Still, RBAC only checks who logs in and which API resource they hit. It does not inspect what happens inside an allowed request while it runs. If you grant pod exec access for debugging, the agent can run any shell command. RBAC cannot block a destructive shell command inside that open exec stream.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Pod logs and cluster configs also hold sensitive user data like emails or phone numbers. Once RBAC allows a log read, the API sends the full text back. Native roles cannot rewrite matched fields like card numbers or national IDs in flight. Teams also struggle to link shared service account logs back to one specific agent task.
Scoping subresources and namespace boundaries
To reduce risk, avoid ClusterRoleBindings for coding agents whenever possible. Create a dedicated namespace for the agent and bind a local Role instead. Separate read roles from roles that allow pod exec or resource deletion. Keep secrets out of the role rules unless the task requires secret inspection.
Review subresource rules with extra care during your setup. Granting pod read access does not grant pod log access by default. Add log access on its own, and leave exec access off for standard runs. When an agent needs exec access to fix a bug, scope it tightly.
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
Should I use a Role or a ClusterRole for a coding agent?
Use a Role with a RoleBinding so the agent stays inside one namespace. You can reference a shared ClusterRole inside a RoleBinding to keep permissions in one namespace. Avoid ClusterRoleBindings unless the agent must check cluster-wide nodes.
Can Kubernetes RBAC block specific shell commands inside pod exec?
No, Kubernetes RBAC only checks if the user can call the pod exec subresource. Once the API server allows the exec call, RBAC does not filter shell commands. You need runtime command controls to stop risky commands inside the pod.
How do I stop the MCP server from reading cluster secrets?
Do not include the secrets resource in your Role or ClusterRole rules. Since Kubernetes RBAC rules are purely additive, leaving secrets out blocks direct secret reads. Also avoid granting pod exec, since a shell inside a pod can read mounted secrets.
Related guides
In this post