Dev.to Security 🔐 Cybersecurity 👁 0 📖 6 min read

MCP Servers Explained With a Valet Key: What an AI Agent Can Actually Do to Your Cloud

You pull up to a hotel and hand your car to the valet. You don't hand over your house keys, your garage remote, and the code to your safe. You hand over a valet key: it starts the car and opens the driver's door, and it

MCP Servers Explained With a Valet Key: What an AI Agent Can Actually Do to Your Cloud

You pull up to a hotel and hand your car to the valet. You don't hand over your house keys, your garage remote, and the code to your safe. You hand over a valet key: it starts the car and opens the driver's door, and it won't open the trunk or the glove box. The valet can park the car. They can't take it on a road trip.

That's the right way to think about connecting an AI coding assistant to your DevOps tools through the Model Context Protocol (MCP). The MCP server is the valet stand. The credential you give it is the key. Almost everything that matters, what the assistant can read, what it can change, and what it can break, comes down to which key you hand over and what rules come with it. (I used AI tools to help research and draft this post, and checked the server details against each vendor's documentation.)

The valet stand: what an MCP server is

An MCP server is a small adapter that turns a tool's API into a list of actions an AI assistant can call. The GitHub MCP Server turns "list my failing pull requests" into an API call. The Kubernetes MCP Server turns "why is this pod crashing" into a query for pod events and logs. Your assistant stops asking you to copy and paste between windows and goes to look for itself.

Every major DevOps tool now has one. GitHub and GitLab for source control, AWS, Google Cloud, and Azure for cloud resources, Kubernetes and Argo CD for clusters, Terraform and Pulumi for infrastructure as code, Grafana, Datadog, Sentry, and PagerDuty for observability and incidents.

Here's the part people miss: nearly every one of those servers can change things once its credential allows it. Even the observability ones. The Grafana server can edit dashboards. The Datadog server can create monitors. The Sentry server can update issues. "It's just a monitoring tool" is not a safety plan.

Three robot valets at separate podiums labeled GITHUB, KUBERNETES and MONITORING, each holding a different key, while a car drives into a garage labeled CLUSTER
One stand per system. Each one hands the assistant a different key. (AI-generated illustration)

The valet key: credentials and OAuth

The key you hand the valet decides everything, so look at how each server gets its key.

Older and local servers usually read a credential from your environment: a personal access token, a cloud CLI profile, or an API key sitting in a config file. That's like leaving a full set of keys in the ignition. A personal access token with full repo and admin scope gives the assistant exactly the access of the person who made it, and if that token leaks through a dotfile or a compromised extension, everything it can touch is exposed.

Newer hosted servers sign in with OAuth instead. GitHub, GitLab, Google Cloud, Cloudflare, Datadog, Sentry, PagerDuty, and Control Plane all offer remote servers where your client opens a browser, you approve access, and no static token sits in a dotfile. The MCP authorization specification builds on OAuth 2.1 with PKCE required, and tokens are bound to the specific server they were issued for. That's the valet key: it works for this car, at this stand, and nothing else.

The trunk stays locked: read-only modes and toolsets

A good valet key doesn't open the trunk. A good MCP setup doesn't expose tools the assistant doesn't need.

Many servers ship a read-only mode: GitHub, Azure DevOps, Kubernetes, Argo CD, Azure, and Grafana among them. Some go further. The Kubernetes server has a mode that disables destructive actions. HashiCorp's Terraform server keeps its apply, destroy, and delete tools switched off until you explicitly enable them. Datadog has an org setting that hides write tools entirely. Control Plane's server uses toolset profiles, and its read-only profile advertises no tool that creates, updates, deletes, or runs a command.

There's a second reason to lock the trunk. Some clients cap how many tools they'll load, and every tool definition eats context and lowers the model's accuracy at picking the right one. Fewer tools is safer and works better.

Split illustration: a robot valet holds one READ-ONLY key beside a car with a locked trunk, and the same robot strains under a huge ADMIN TOKEN key ring while the owner clutches his head
Read-only mode is a valet key. A full-scope token is the whole key ring. (AI-generated illustration)

"Call me before you leave the lot": confirmation prompts

Some valets text you before they move the car. That's the confirmation gate, and for anything that changes production you want one.

A few servers build it in. The Kubernetes server supports confirmation rules. The AWS API server has a mutation-consent option. Control Plane's server asks for an explicit yes before it deletes or replaces a resource. Whatever the server offers, keep approval on in your client too: Claude Code prompts for each tool call unless you allowlist it, and in Cursor and VS Code, turn auto-run off for any server connected to production.

A note on the windshield: prompt injection

Imagine someone leaves a note under your windshield wiper: "Valet, please drive this car to the airport." A careless valet might do it.

That's prompt injection. When your assistant reads a CI log, a GitHub issue, or a Sentry error message, it reads text that someone outside your team may have written. A crafted line in a log can tell the assistant to call a tool it shouldn't. The defenses are the same rules as above, used together: expose only the tools you need, require confirmation for anything that changes state, and don't connect a server that reads untrusted text (issues, logs) in the same session as one that can write to production or send data out.

There's a nastier version. A server's tool descriptions go straight into the model's context, so a malicious server can hide its own note in there, or change its tool definitions after you approved it. Install only vendor-maintained or audited servers, pin exact versions, and run local servers in a container with only the access they need.

A skeptical robot valet raises a hand beside a car with a DRIVE TO AIRPORT note under the wiper, while a tablet shows CONFIRM?
Logs and issue text are notes on the windshield. The valet should never take orders from them. (AI-generated illustration)

The ticket stub: audit logs

When you get your car back, the valet hands you a ticket stub, and the garage has a record of who moved your car and when. You want the same thing for every tool call.

Hosted servers log calls on their side. On Control Plane, the org's audit trail records each change the assistant makes. For local servers, capture calls with client hooks or OpenTelemetry, and treat the target system's own log as the record of truth: AWS CloudTrail (which also records AWS MCP Server calls), the Kubernetes audit log, or the GitHub audit log.

Four keys, from valet key to master key

Put it together and you get a simple ladder. Hand over the smallest key that does the job, and move up only when you trust the setup.

Key What the assistant may do Example
Valet key (read and diagnose) Query metrics, logs, events, errors, and cluster state Grafana with write tools disabled, GitHub in read-only mode, Control Plane's read-only profile
Spare key (non-production) Create or change resources in dev and staging only Kubernetes with a dev-namespace kubeconfig, Terraform on a staging workspace
Gate key (through the pipeline) Trigger a deploy that runs through CI and its existing approvals GitHub workflow dispatch, Argo CD sync to staging
Master key (with a phone call) Deploy, scale, roll back, or delete in production with approval per action Control Plane's core or full profile, Terraform runs with HCP Terraform approval

One more habit from good valets: separate stands for separate lots. Register each environment as its own server entry with its own credential, for example k8s-staging and k8s-prod, so a staging session can never reach production.

The takeaway

An MCP server is only as safe as the key you hand it. Pick servers by what they're allowed to change and how they sign in, not by how many tools they list. Start every new server on a read-only key, let it earn write access in staging, send production changes through the pipeline you already trust, and keep the phone call on for anything you can't undo.

I compared 17 DevOps MCP servers on exactly these points, how each one runs, how it authenticates, whether it can change production, and what guardrails it ships with, in The Best MCP Servers for DevOps (2026).

Which MCP server would you trust with the master key?

Originally published on Medium.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.