Using Kol with coding agents
The kol CLI was built to be driven by agents as well as people:
- every command takes
--jsonand prints one JSON object withok, and on failureerrorandhint; - exit codes say what happened:
0ok,1error,2not signed in; - nothing asks questions; sign-in can be split in two steps an agent can handle;
kol mcp(orkol-mcp) is an MCP server with the same operations as tools.
Every project made by kol init contains:
| File | For |
|---|---|
AGENTS.md | The workflow and the rules, for any agent (Codex and others read it) |
CLAUDE.md | Points Claude Code to AGENTS.md |
.claude/skills/kol/SKILL.md | A Claude Code skill: "build, test and publish this Kol AI" |
.mcp.json | Starts the kol MCP server for agents that read it (Claude Code, Cursor) |
Claude Code
Inside a project, the MCP server and skill are picked up automatically (Claude Code asks once to allow the project's MCP server). Then just ask:
sh
claude "Make this a language tutor for beginner Italian. Add a phrase list and tests. Publish it when the tests pass."Outside a project (for example to start one), add the server for yourself:
sh
claude mcp add kol -- kol mcpCodex
Add the server to ~/.codex/config.toml:
toml
[mcp_servers.kol]
command = "kol"
args = ["mcp"]Codex reads AGENTS.md in the project. Without MCP it can use the CLI directly; AGENTS.md tells it to use --json.
Cursor
Cursor reads .mcp.json-style config from .cursor/mcp.json. Copy it there:
sh
mkdir -p .cursor && cp .mcp.json .cursor/mcp.jsonSigning in from an agent
The agent can't approve the code for you; you do it on your phone:
- The agent calls
kol_login_start(orkol login --no-wait --json) and shows you a 6-character code. - You open Kol → Companions → Creator portal and enter it.
- The agent calls
kol_login_finish(orkol login --code … --device … --json), which waits until you approve.
The sign-in is saved on your computer for 90 days, for you and every agent you use.
What a good agent session looks like
kol_whoami: signed in? Has an AI key?kol_init(or edit the existing project).- Write
persona.md,knowledge/,tests/. kol_validateuntilok.kol_promptto read what the AI will be told.kol_trya few times;kol_testuntil everything passes.kol_push, and ask you to try it by voice.kol_publishonly when you asked for it.
All tools: MCP reference.
Keep agents safe
- Projects never contain secrets, so agents never need your token or AI key.
- Ask agents to publish only on your say-so; the templates'
AGENTS.mdalready says this. - Try-outs and tests use your AI key. An agent looping on
kol_testspends a little each time; Kol limits try-outs to 120 an hour.