Loading...

Agent workflow

Give your AI agent deploy access — not your panel password

The agent that wrote your code can also ship it — if you give it a credential scoped to exactly that job. This is how deploy-only tokens and the built-in MCP server work, including what the token can and cannot do, verified request by request.

7 min read Intermediate Updated

Give your AI agent deploy access — not your panel password

The wrong way: pasting your panel password into an agent

Local AI agents are good at exactly the repetitive part of shipping software: run the checks, fix what they flag, deploy, read the logs, repeat. The tempting shortcut is to hand the agent your panel login so it can "do everything". Your panel account can change payment methods, delete applications and touch every CDN account you own — none of which the agent needs to ship code. The right tool is a credential that can deploy and do nothing else.

The deploy token: shown once, scoped hard

One command creates it. The plain-text token appears exactly once — cdn.com.tr stores only a hash, so nobody (including support) can read it back later. It is bound to a single CDN account and to the deploy surface only: upload source, build, create and update apps, deploy, read status and logs.

Real output (token masked; labels translated from the CLI):
$ cdnctl deploy-token create --name "claude-code"
Deploy token (shown ONCE — save it now):
  cdnctl_T1bz••••••••••••••••••••••••

To hand it to an agent: cdnctl configure --token cdnctl_T1bz••••…
Scope: deploy only (source upload/build + app lifecycle).

What the token can and cannot do — we tested every edge

These are not design intentions; each row is a real request we ran against the live API with a freshly minted token:

- Deploy surface on its own account — works (200). - The same endpoints for another account's UUID — 404. The API does not even confirm that the other account exists. - Endpoints outside the deploy surface (billing, DNS, user profile) — 401. - DELETE on an application — 405. The route simply is not registered on the token surface, so the agent cannot destroy what it deployed. - Any request after revocation — 401, immediately.

Wiring it into Claude Code or Cursor over MCP

cdnctl ships an MCP server: `cdnctl mcp` speaks JSON-RPC over stdio and exposes six tools — project_info, check, entitlement, deploy, apps_list and app_show. Registering it means your agent calls deploy the way it calls any other tool, with structured results instead of scraped terminal text.

Claude Code (one line) and Cursor (.cursor/mcp.json):
$ claude mcp add cdntr -- cdnctl mcp

# .cursor/mcp.json
{
  "mcpServers": {
    "cdntr": {
      "command": "cdnctl",
      "args": ["mcp"],
      "env": { "CDN_ACCESS_TOKEN": "cdnctl_T1bz••••…" }
    }
  }
}

The self-repair loop in practice

With the token in place the agent runs the same loop a careful human would: `check` the project, fix what it flags, `deploy`, read the result. In our live test the agent hit a real failure — a Dockerfile that copied the host node_modules into the image and crashed the container — fixed the .dockerignore itself, redeployed, and verified the app healthy. No panel, no human in the loop, and nothing outside the deploy surface touched.

Rotating and revoking

Tokens are listed with their prefix, last-used time and IP — enough to audit without exposing the secret. Revocation is one command and takes effect on the next request. If a token ever lands in a log or a transcript, revoke it first and investigate second; minting a replacement takes seconds.

Audit and revoke:
$ cdnctl deploy-token list
  name: claude-code   prefix: cdnctl_T1bz   last_used: 2026-08-25 15:46 (185.70.97.9)

$ cdnctl deploy-token revoke --id 11
  status: success

Frequently asked questions

Can the agent delete my application?

No. DELETE routes are not registered on the token surface — the request answers 405 regardless of what the agent sends. Destructive actions stay in the panel, behind your login.

Can the agent spend money with the token?

No. Package purchase, payment and billing live in the panel only. The token cannot reach them (401), and cdnctl deliberately sends humans to the browser for payment.

What if the token leaks?

Revoke it — one command, effective immediately. The blast radius is one account's deploy surface: no billing, no deletion, no other accounts. Then mint a new one.

Does MCP require a deploy token?

No — on your own machine cdnctl mcp can use your normal cdnctl login. The token matters when the agent runs somewhere you would not put your login: CI, a shared box, a long-lived agent session.