Letting an AI assistant run deployments sounds reckless, and in most setups it would be. The usual way to give an agent access to a deployment tool is to hand it an API key with broad rights and hope the model behaves. A misread prompt, a hallucinated environment name or a prompt injection hidden in a log file can then turn into a production deployment, or into a database password sitting in a chat transcript.
When we built the MCP server into Jaws Deploy, we started from a different assumption: the assistant will eventually do something you didn't mean. The server has to make the dangerous things hard to do by accident, and keep the things that must never leak out of the conversation altogether. This post explains how it works, and where its limits are.
The problem with "just give it an API key"
An MCP server turns a product's features into tools an assistant can call. The easy version maps every REST endpoint to a tool and authenticates with whatever key the user pastes in. It works, and it fails in three ways:
- One call deploys. If
deployis a single tool with project, release and environment arguments, the model can call it in the same turn it decided to. There is no point where a person sees what is about to happen. - Secrets become context. If reading variables returns their values, the connection string goes into the model's context, the client's transcript and possibly the provider's logs. You can't take it back.
- The key reaches too far. A personal API key usually carries every permission its owner has, across every project.
We dealt with each of these in the server, not in the prompt, because a prompt is a suggestion and the server is a rule.
Deploying takes two calls, and the second one takes no arguments
In Jaws Deploy, deploying through MCP is split into two tools.
preview_deploy is a dry run. It takes the project, release and environments, checks that the caller may deploy there, and returns the plan: which steps run, on which machines and cloud targets, in what rollout order, and for which tenants. It writes nothing and starts nothing.
Along with the plan, it returns a confirmation token. The token is encrypted and signed by the server, so the assistant can't read it, edit it or make one up. It records exactly what was previewed: the release, the environments, the tenants and any skipped steps.
trigger_deploy accepts that token and nothing else. There is no project argument, no environment argument and no release argument. The only way to say what to deploy is to hand back a token from a preview. So the assistant cannot deploy something it didn't preview, and it cannot preview Staging and then deploy to Production.
The token also has limits of its own:
- It expires after two minutes. That is long enough for the assistant to show you the plan and for you to answer. It is short enough that an old preview can't be replayed later. In our own sessions the assistant regularly runs the preview again to get a fresh token after you say "go", and checks that the new plan still matches what you approved.
- It only works for the account that asked for it. A token issued to one connection can't be used by another, or in another organization.
- Permissions are checked twice. When the token is used, the server checks again that the account may deploy this project to each environment, that the environment's lifecycle phase is still open, and that the tenant can still be deployed. Anything that changed in those two minutes stops the deployment.
One thing to be precise about: the server guarantees that a preview always comes first. It doesn't guarantee that a person read it. Waiting for your go-ahead is an instruction we give the assistant in the tool descriptions, and well-behaved clients follow it. Your client's own approval settings for tool calls are the second layer. If you want a person to approve every production deployment no matter what the assistant does, use the next section to make sure the assistant's account can't deploy to production at all.
Secrets never enter the conversation
Secret variables in Jaws Deploy, such as passwords, connection strings and API keys, are handled in a way that doesn't depend on the model behaving:
- Reading. When the assistant lists variables, secret values come back as
***. The real value never leaves Jaws Deploy. - Writing. The tools that set variables refuse the Secret type. They also refuse to change a variable that is already secret, so a secret can't be turned into plain text and read back.
- Logs. When a deployment logs its parameters, secret values are written as
****. For tenant deployments, the tenant values a deployment used are returned with secrets hidden.
You set secrets by hand in the Jaws Deploy UI. The assistant can still build the step that uses #{DbPassword}. It just never sees the value. That matters beyond the model itself: the transcript on your machine, the client's history and your AI provider's logs don't hold your secret values.
One caveat: this covers what Jaws Deploy returns. If a script you wrote prints a secret to its own output, that line is in the deployment log like any other, and the assistant can read deployment logs. Keep secrets out of script output, as you would anyway.
The assistant gets only what you give it
There are two ways to connect an assistant, and in both the limits are enforced by the server.
Sign in with your own Jaws Deploy account. Add the Jaws Deploy server as a connector in Claude, Claude Code or another client that supports MCP sign-in. The address is under Profile → Connected apps, along with an "Add to Claude" button. You sign in, and a consent screen asks which workspaces the assistant may use and whether it gets read-only or full access.
- It can never do more than you. The connection gets your own roles, limited to the workspaces you picked. If your role can't deploy to Production, neither can the assistant. Organization-wide full control becomes full control of the chosen workspaces only.
- Read-only means read-only. A read-only connection only sees tools that read, such as listing projects, reading logs and previewing a deployment.
trigger_deployand every tool that changes something are hidden, and refused if called anyway. A new tool counts as one that changes things unless it's marked read-only. - The preview token belongs to you. A token from
preview_deployonly works for the person who asked for the preview. - Everything it does is attributed to you, in the same deployment history as your own work. Every tool call goes through the same permission checks as the REST API and the web app.
- Tokens are short-lived. An access token lasts an hour. The refresh token is replaced each time it's used, and if an old one is ever presented again, the whole connection is revoked. That is what you want if a token leaks.
- Disconnecting is quick. Profile → Connected apps lists every assistant connected with your account, and you can disconnect any of them. Admins see everyone's connections and can switch off sign-in for AI assistants across the organization. Existing connections then stop working within a minute.
Or give it a service account with an API key. For automation, or a client that doesn't support MCP sign-in, Settings → AI assistants creates a service account for one workspace and generates the client config with the key filled in. The key is shown once. That account has full control of its workspace, because most people connect an assistant to build projects and steps as well as deploy. If you want it narrower, create a service account yourself and give it a role that can only deploy to the environments you choose, for example Development and Staging but not Production. The assistant can then preview Production all it likes, but trigger_deploy will refuse it. Delete the account or its key and the connection stops working within a minute.
Authentication is cached for at most one minute either way, and the cache doesn't renew itself while the assistant keeps calling, so a busy assistant can't keep a revoked connection alive.
What this looks like in practice
Here is the shape of a real session, recorded on our MCP deployments page:
- You ask the assistant to create a project with a PowerShell step that restarts an IIS app pool on machines tagged
role:web. It creates the project and the step, and tells you nothing has run yet. - You ask for release 1.0.0 and a preview of a Staging deployment. It shows one step on Web-01, the only machine with that tag in Staging, and says nothing has been deployed.
- You say "deploy it". The assistant previews again because the first token has expired, checks that the plan hasn't changed, and then calls
trigger_deploy. The deployment shows up in Jaws Deploy, attributed to the MCP service account, because that session used an API key. An assistant signed in with your account would show your name instead.
At no point could a misunderstanding in step 1 reach Production. No secret appeared anywhere in the transcript either.
A short checklist, whatever tool you use
If you are connecting an AI assistant to any deployment tool, these are the questions we would ask:
- Can it deploy in a single call? If yes, a person never sees what is about to happen.
- Is the preview binding? Can the assistant preview one thing and then deploy another?
- Can it read secret values? If so, assume they will end up in a transcript.
- Whose permissions does it get? Never more than the person who connected it, limited to what the job needs. Read-only should be an option.
- Can you see what it did, and switch it off quickly?
Try it
The MCP server is included in every Jaws Deploy plan, including the free one. You use the AI subscription you already have, and we don't charge per token. The MCP quickstart walks through connecting Claude Code, Claude Desktop, Cursor and Codex, and the MCP server page lists what the assistant can do.