# KiCI CLI: driving a deployed orchestrator This bundle covers: Auth, org and orchestrator selection, runs, approvals, notifications, diagnostics, and the MCP server a coding agent connects to. ## Drive KiCI from your coding agent Source: https://docs.kici.dev/user/ai-agents/ KiCI ships a hosted **MCP server** so a coding agent (Claude Code, or any MCP client) can drive your CI directly: trigger runs, read a structured result, fetch the failing step's logs, cancel, and re-run — all under an agent identity you control, org-scoped, and audited. There are no per-tool tokens to configure: point the agent at one URL with one credential and it's done. The MCP exposes only what you can already do yourself through the `kici` CLI and the dashboard. It is not a new privileged surface — every tool maps to an existing user-facing operation and is gated by the same permissions your role grants. ## 1. Mint an agent credential The MCP accepts an **agent-kind credential** — and only an agent-kind one. It can be either of two kinds: - An **agent personal access token (PAT)** that you own — it acts as you, with your provenance. The token is `kici_pat_…`. - An **agent org API key** that belongs to your organization — a provenance-carrying service account, independent of any one person. The key is `kici_sk_…`. Both drive the MCP identically. A non-agent token of either kind (a plain user PAT, a plain org API key) is refused at the door. **Option A — an agent PAT.** Mint one with the `kici` CLI (log in first with `kici login`): ```bash kici pat create --agent --name "claude-code" ``` The `--name` value is the **agent label**. It is recorded on every action the agent takes, so your audit log shows exactly which agent did what (and on whose behalf). The token is printed once — save it now; it cannot be retrieved later. **Option B — an agent org API key.** Create one from the dashboard's **Settings → API keys** tab: set the key's kind to **Agent** and give it an agent name (the agent label). The same key can also be minted with `kici-platform-admin user api-key create --org --agent --agent-label