kilo-mcp
Provides tools for creating and managing Git worktrees to enable parallel feature development, as well as checking Git workspace status.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kilo-mcp Delegate the bug fix in the payment service to Kilo and review the diff."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Kilo MCP Server
Kilo MCP Server is a Model Context Protocol (MCP) implementation designed to bridge any orchestrating AI assistant (such as Claude Code / Desktop, Kilo Code, Roo Code, or any MCP client) with KiloCode (Kilo CLI).
It empowers the orchestrating AI to act as a System Architect and Manager, while delegating the heavy lifting of code implementation, repository exploration, and refactoring to Kilo, which acts as the Executor.
🌟 Why this exists?
The Architect / Orchestrator Role: An orchestrating assistant (like Claude) excels at high-level reasoning, system design, architectural planning, orchestrating tasks, managing prompts, writing comprehensive specifications, and reviewing generated code. However, executing massive refactors across an entire codebase can be token-heavy and slow.
KiloCode's Role (The Executor): KiloCode is an incredibly fast, highly capable CLI agent built for execution (default model: Gemini 3.5 Flash - configurable, 500+ models supported). It is equipped with powerful tools for code generation, semantic search (RAG), Agent Manager, worktrees, and native workspace awareness.
By connecting them via MCP, the orchestrator can dynamically spin up Kilo instances in the background, assign them coding tasks or codebase exploration, and review the results-all while focusing purely on orchestration and architecture.
This is the Kilo-specific binding of a protocol-agnostic pattern -
the abstract phases (discovery, isolation, delegation, monitoring,
verification, closure) and the headless-worker behavioral contract this
server implements are documented tool-agnostically in
ai-orchestration;
this repo is what makes that pattern concrete for Kilo Code over MCP.
General Claude Code/Kilo Code plugin & marketplace concepts (skills, agents,
.claude-plugin/marketplace.json, Kilo's Skill URLs) are covered in
agentic-coding-kit's docs
rather than repeated here.
Related MCP server: cc-agent
✨ Features
🧠 Specialized Roles: The orchestrator writes the specs, manages execution flow, and verifies results. Kilo generates the actual code and explores the workspace.
🔍 Native RAG & Semantic Search: The orchestrator can delegate semantic search over Kilo's codebase index to quickly find relevant code snippets without downloading the whole repository into context. The index is a standing resource for the assistant's own work - useful for exploration and Q&A even when nothing is delegated to
kilo_implement- and the server's MCPinstructionsstate this to every connected client, so the directive ships with the install.🚀 Native Parallelism: The orchestrator can emit parallel tool calls to spawn multiple Kilo subprocesses simultaneously across different branches or directories. Subprocesses are launched via
asyncio, so concurrent tool calls run truly in parallel without blocking the event loop.⏱️ Timeout Protection: Every Kilo subprocess is bounded by a timeout (default 1800s, configurable via the
KILO_MCP_TIMEOUTenvironment variable) so a stuck instance can never hang a tool call indefinitely.📏 Context Size Preflight: Estimates prompt and
focus_filestoken counts before launching Kilo. Warns when estimated initial context exceeds 40,000 tokens (configurable viaKILO_MCP_MAX_CONTEXT_TOKENS_WARN/max_context_tokens_warn), and refuses to launch when exceeding 120,000 tokens (KILO_MCP_MAX_CONTEXT_TOKENS_REFUSE/max_context_tokens_refuse,0to disable) with actionable advice to split the task or narrowfocus_filesbefore risking connection resets.💸 Configurable Cost Model & Delegation Policy: Whether Kilo execution is free depends on the operator - some have provider API keys supplied at no charge, others pay per token. Set
[kilo] input_cost_per_mtok/output_cost_per_mtok(default0.0= free) to your real Kilo rates: the built-in delegation policy automatically switches between a free-Kilo model (only orchestrator tokens matter) and a paid-Kilo model (Kilo's own agentic loop joins the comparison), and cost estimates include Kilo's execution cost. Thedelegation_policysetting still overrides the injected policy text entirely, so the orchestrator self-selects when delegating (short spec + review) beats doing the work inline; tune it without touching code.📊 Metrics & Feedback Loop: Every run is recorded to
metrics.jsonl(duration, outcome parsed from Kilo's Final Report, generated-code volume, real delegation cost vs estimated inline cost). Defects found during review are logged viakilo_log_issuetoissues.jsonl, andkilo_metricsaggregates everything - surfacing the exact cost breakdown (orchestrator spec+review vs. Kilo execution) so you can see whether delegation pays off and which defect categories the prompts must start guarding against.🤖 Agent & Skill Discovery: Exposes tools for the orchestrator to dynamically discover available Kilo agents (e.g.,
code,explore) and custom skills configured in your local or global.kilo/directories.🛡️ Advanced Orchestration: Support for git worktrees (
kilo_create_worktree) to allow parallel feature implementations, advanced workspace checks (kilo_workspace_status), structured verification gates (kilo_verify_worktree), provider status checks (kilo_auth_status), and custom command execution (kilo_run_command). Included are skills (kilo-mcp-executor-contract,kilo-mcp-conflict-resolver, andkilo-mcp-rag-explorer) to improve parallel agent work, headless task completion, and fast semantic search.🎯 Precise Context Injection: The orchestrator can pass specific files as
focus_files, ensuring Kilo reads the exact context needed before making changes.⚙️ Dynamic Configuration: Claude can inject environment variables into the Kilo subprocess at runtime (e.g. debugging flags) to shape Kilo's execution environment; the server itself is configured via a layered env-var/TOML/default scheme.
🛡️ Non-Interactive by Default: Safely runs Kilo in background subprocesses without hanging on interactive CLI prompts.
📡 Non-Blocking Delegation with Live Monitoring & Intervention:
kilo_implementruns in the background by default - it returns immediately with atask_id, never blocking the conversation.kilo_task_progresspolls Kilo's own live plan/todo list, commentary, and cost straight from its session database;kilo_task_cancelstops a task that's drifted off-spec; andcontinue_session_idlets you send corrective instructions into the same session instead of starting blind. How closely to watch a task scales with its complexity/risk - small tasks need only a final check, large ones are worth polling periodically.🧟 Detached, Self-Healing Background Execution: background tasks run as fully detached OS processes (
setsid) - they survive a server restart or crash instead of dying with it. Any status-reading tool reconciles a stale"running"record against real PID liveness and the task's log file, so the outcome is always recoverable, even from a brand-new server instance. See Reliability.🗂️ Agent Manager Integration: worktrees and sessions created via
kilo_create_worktree/kilo_implement(isolation='worktree')are also registered (best-effort) in.kilo/agent-manager.json, so they can appear in the Kilo VS Code extension's Agent Manager UI without any manual JSON editing. See Agent Manager Integration for the caveats.
📦 Installation & Setup
Requirements
Python 3.10+ (3.11+ recommended - the optional TOML config file needs stdlib
tomllib)Kilo CLI installed and accessible in your system's PATH. On macOS the recommended install is Homebrew:
brew install Kilo-Org/tap/kilo(other channels:
npm,pnpm,bun, or thecurlinstaller - see https://kilo.ai). Verify withkilo --version, and make sure you are logged in to at least one provider:kilo auth list(log in withkilo auth login).An MCP client: Claude Code, Claude Desktop, or any MCP-compatible client.
uv (Recommended): A fast Python package installer and resolver. Install it via
curl -LsSf https://astral.sh/uv/install.sh | sh
Server Configuration
Settings resolve as environment variable > config file > built-in default - env vars keep the standard MCP pattern (the client's env block) working, while the TOML file is the comfortable place for everything else.
Config file search order:
$KILO_MCP_CONFIG(explicit path)kilo-mcp.tomlnext toserver.py(per-checkout, gitignored)~/.config/kilo-mcp/config.toml(per-user)
Copy kilo-mcp.example.toml to one of those locations and edit - it documents every key ([kilo] timeout, context size preflight thresholds max_context_tokens_warn/max_context_tokens_refuse, model tiers, Kilo token pricing, delegation policy; [metrics] data dir, Claude pricing, inline-cost heuristics) and the matching env var names. Config files parse with tomllib on Python ≥ 3.11, and with a small built-in fallback reader (covering the flat key/section shapes this server's own keys use) on 3.10 - either way, the file is actually read; only a genuinely unsupported TOML shape (arrays, inline tables) would need a 3.11+ interpreter.
Model tiers: default_model (simple/routine tasks) and complex_model (subtle bugs, security-sensitive edits, multi-step reasoning) are surfaced directly in kilo_implement's tool description, so the connected assistant picks the right one for the task's risk instead of guessing a model id (e.g. one from its own provider) and discovering it doesn't exist on Kilo. kilo-mcp itself is provider-agnostic - it never hardcodes which providers/models exist. Set both interactively, from whatever kilo models actually reports for your own kilo auth login:
uv run --no-project --with "mcp<2" python server.py --configure-modelsKilo Configuration & Credentials (shared with the IDE extensions)
The Kilo CLI reads the same configuration and credentials as the Kilo VS Code / JetBrains extensions - there is nothing to set up twice:
~/.config/kilo/-kilo.jsonc(settings, indexing/RAG, permissions)~/.kilo/(and legacy~/.kilocode/) - customagent/,skills/,command/(this is where Kilo discovers global customizations)~/.local/share/kilo/auth.json- provider credentials (created bykilo auth login)
If you already use the Kilo extension, the CLI (and therefore this MCP server) will work with your existing login. Check with kilo auth list.
Register the MCP Server
⚠️ In every variant below, the
--no-projectflag matters: without ituvtries to build/install this folder as a Python project before running, which fails and prevents the server from starting.
Option A - Claude Code (recommended)
One command, from anywhere. --scope user makes the server available in all your projects (drop it for a per-project registration):
claude mcp add kilo-mcp --scope user -- \
uv run --no-project --with "mcp>=2" python /absolute/path/to/kilo-mcp/server.pyOption B - Claude Desktop
Find your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add the following to the mcpServers section, replacing /absolute/path/to/... with the real path to this folder, then fully quit and reopen Claude Desktop:
{
"mcpServers": {
"kilo-mcp": {
"command": "uv",
"args": [
"run",
"--no-project",
"--with",
"mcp>=2",
"python",
"/absolute/path/to/kilo-mcp-server/server.py"
]
}
}
}Server settings can be passed here too via an "env" block (e.g. {"KILO_MCP_TIMEOUT": "3600"}) - see Server Configuration above.
Option C - Any other MCP client
The server speaks standard MCP over stdio. Point your client at:
uv run --no-project --with "mcp>=2" python /absolute/path/to/kilo-mcp/server.py(or plain python server.py in any environment where pip install "mcp>=2.0.0" has been run).
Verify the installation
# Claude Code: the server should report "✔ Connected"
claude mcp get kilo-mcpInstall Companion Skills
Two plugins, the concrete Kilo binding of the generic Architect/Executor pattern - install the side(s) you need:
architect-side:kilo-mcp-orchestrator,kilo-mcp-metrics-analyst,kilo-mcp-conflict-resolver, plus thekilo-mcp-orchestrator-agentsubagent. For the orchestrating AI delegating to Kilo via MCP.executor-side:kilo-mcp-executor-contract,kilo-mcp-rag-explorer. For the Kilo side.
This repo is itself a Claude Code / Kilo Code plugin marketplace
(.claude-plugin/marketplace.json), same mechanics as the sibling repos in
this family - see agentic-coding-kit's docs
for the full concepts/authoring/distribution reference if any of this is
unfamiliar.
One real dependency worth knowing about: kilo-mcp-orchestrator and
kilo-mcp-orchestrator-agent (both architect-side) assume the tasks/ tree
convention (CONTEXT.md, 00-INDEX.md, specs/, NN-<slug>/plan.md)
owned by ai-orchestration's
task-pipeline skill (architect-side plugin) - install that
alongside this one if you delegate multi-step/multi-session work through
task pipelines. See plugins/architect-side/dependencies.json and
plugins/executor-side/dependencies.json for the machine-readable record
(informational only - neither tool's installer enforces it today).
Claude Code:
claude plugin marketplace add https://github.com/primax79/kilo-mcp.git
/plugin install architect-side # or executor-side, or bothKilo Code: install with the AI Swissknife VS Code extension (or its CLI) (covers the agent too),
or Kilo's native Skill URLs (skills only, no extra tooling - paste into
Settings UI Local Config or .kilo/kilo.jsonc's skills.urls, one URL
per plugin):
https://raw.githubusercontent.com/primax79/kilo-mcp/main/plugins/architect-side/skills/
https://raw.githubusercontent.com/primax79/kilo-mcp/main/plugins/executor-side/skills/A legacy path also still works, copying the skills straight from this
checkout without any marketplace registration (--with "mcp>=2" is needed
because server.py imports the MCP SDK at module load):
uv run --no-project --with "mcp>=2" python server.py --install-skillsThen, in a conversation, ask Claude to "list the available Kilo models" - a correct setup answers through the kilo_list_models tool. If the tools are missing, restart the client (stdio servers are spawned per session) and check that kilo --version and uv --version work in a fresh terminal.
Skills over MCP
kilo-mcp implements the MCP Skills extension (io.modelcontextprotocol/skills, SEP-2640) and serves the five skills bundled under plugins/*/skills/ directly over the MCP protocol:
skill://kilo-mcp/kilo-mcp-orchestrator/SKILL.mdskill://kilo-mcp/kilo-mcp-conflict-resolver/SKILL.mdskill://kilo-mcp/kilo-mcp-metrics-analyst/SKILL.mdskill://kilo-mcp/kilo-mcp-executor-contract/SKILL.mdskill://kilo-mcp/kilo-mcp-rag-explorer/SKILL.md
Every file in each skill directory (SKILL.md, references/*, scripts/*, index.json) is exposed as a standard MCP resource under skill://kilo-mcp/<name>/<relative-path>, listed in resources/list, and readable via resources/read. The server advertises capabilities.extensions["io.modelcontextprotocol/skills"] = {} (directoryRead is excluded) and serves skills/list and skills/get with verbatim YAML frontmatter and a complete resources manifest carrying raw-byte sha256:<hex> digests and byte size values.
Compatible hosts — such as VS Code with "chat.agentHost.mcpSkills.enabled": true — automatically discover and load these skills from the connected kilo-mcp server without requiring a separate local plugin or filesystem skill installation. Clients that do not implement the extension remain unaffected and see ordinary MCP tools, prompts, instructions, and resources. Skills are served from the bundled plugins/ directory next to server.py, which is present both when running directly from a repository clone (uv run server.py) and in packaged wheel distributions (tool.hatch.build.targets.wheel.only-include), ensuring skill discovery functions across install modes.
🛠️ Exposed MCP Tools
When Claude connects to this server, it gains access to the following tools:
kilo_list_agents
Scans the workspace (.kilo/agent/, .kilocode/agent/) and global (~/.kilo/agent/, ~/.kilocode/agent/) configurations to return a list of all available Kilo agents. Claude uses this to choose the right agent for the job.
kilo_list_skills
Scans for available Kilo skills (SKILL.md files). Claude can discover these to force Kilo to adopt specific workflows or design patterns.
kilo_list_models
Runs kilo models and returns the valid provider/model ids Claude can pass to kilo_implement. Claude uses this to validate the model before delegating, avoiding failed runs from stale/unknown ids (e.g. google/gemini-3.8-flash for routine work, google/gemini-4-argon for complex work).
Parameters:
filter(string, optional): Case-insensitive substring to narrow the (often large) list, e.g.gemini,claude.
kilo_rag_search
Delegates codebase semantic search and exploration to Kilo. Claude can use this to quickly find where something is implemented across a large workspace without needing to pull the entire codebase into its own context. This tool is a standing resource for the assistant's own work: use it directly for exploration, Q&A, or your own implementation tasks, not just as a scoping step before delegating to kilo_implement.
Parameters:
query(string, required): Natural language description of what to search for.working_directory(string, optional): Where Kilo should run. Defaults to the current directory.path(string, optional): Specific subdirectory to limit the search.
kilo_implement
The core execution tool. Claude uses this to delegate work.
Parameters:
task_instructions(string, required unlessbrief_fileorresume_task_idis provided): The detailed markdown-formatted specifications. The server routes this through a temporary file bridge (avoids OS argument-size limits and gives Kilo a re-readable spec) and appends a mandatory Final Report contract - Outcome / Files changed / Verification / Issues - so Claude can review the run systematically. When the instructions enumerate items (a numbered or bulleted list of deliverables), the report includes one line per item ("done" or "not done: why"), in the same order.brief_file(string, optional): Path (absolute, or relative toworking_directory) of a Markdown file used as the task specification. When given, its content is the spec (iftask_instructionsis also non-empty, it is appended after the file content under a## Additional instructionsheading); runtime contract sections are appended to the temporary prompt file without modifyingbrief_fileon disk. Withisolation='worktree', relative paths resolve against the originalworking_directory(the main checkout), not the new worktree.log_dir(string, optional): Directory (absolute, or relative toworking_directory; created if missing) where a copy of the run log is also written as<task_id>.logwhen the task reaches a terminal state (including reconciled orphan runs), alongside the canonical log underKILO_MCP_DATA_DIR/tasks/. Withisolation='worktree', relative paths resolve against the originalworking_directory(the main checkout). Bothbrief_fileandlog_dirpaths are reported in the immediate background response and final result (- Brief: <abs path>,- Log copy: <abs path>).working_directory(string, optional): Where Kilo should run. Defaults to the current directory. Unattended runs cannot read outside the working directory unless the Kilo config allowsexternal_directory; do real-world checks on such paths on the orchestrator side.agent(string, optional): The Kilo agent to use (e.g.,code). Note: subagents likeexplorecannot be used as primary agents withkilo_implement(usekilo_rag_searchfor read-only exploration).model(string, optional): Model override inprovider/modelform, as listed bykilo models. Defaults to the workspace's configured Kilo model when there is one (from the nearestorchestration.tomlwalking up fromworking_directory), or the configured serverdefault_modeltier (see Server Configuration -default_model/complex_model, out of the boxgoogle/gemini-3.8-flash). Allowed models by policy:google/gemini-3.8-flash(routine work) andgoogle/gemini-4-argon(complex/high-risk work). Banned models (such asgoogle/gemini-3.1-pro*andgoogle/gemini-flash-latest) are refused.focus_files(list[str], optional): Files Kilo must read before starting. Preflight estimates the combined token size of prompt and focus files: warns abovemax_context_tokens_warn(default 40,000) and refuses to launch abovemax_context_tokens_refuse(default 120,000; 0 disables) to prevent connection resets and timeouts.execution_hints(string, optional): Strategic hints, constraints, or configurations for Kilo's execution style.skills_to_load(list[str], optional): Specific skills Kilo must utilize.env_vars(dict, optional): Custom environment variables to inject (e.g.,{"DEBUG": "1"}).background(bool, optional, defaulttrue): Non-blocking by default - the tool returns immediately with atask_id. Kilo runs as a fully detached OS process (setsid, output to a log file) - it survives a server restart or crash, not tied to this server call's own lifetime. Monitor it withkilo_task_progress(fine-grained: Kilo's own live plan/commentary/cost) orkilo_task_status(coarse OS-level heuristic), and collect the outcome withkilo_task_result- both self-heal a task's status by checking real PID liveness, so even a task that outlived a server restart resolves correctly instead of staying stuck at"running"forever (see Reliability below). Setbackground=falseonly when you deliberately want to block for the report in the same call (short tasks).include_trace(bool, optional, defaultfalse): Whenbackground=false, iftrue, returns the full execution trace (STDOUT/STDERR). Defaults tofalse(returns trimmed summary: status, exit code, session_id, worktree/branch, parsed Final Report, and log file path).continue_session_id(string, optional): Resume an existing Kilo session (its id is surfaced bykilo_task_progress/ a prior run's result) instead of starting fresh - the steering/intervention lever: after reviewing orkilo_task_cancel-ing a delegation that drifted off-spec, send correctivetask_instructionsinto the same session so Kilo keeps the context of what it already built. If a task is still actively running on that session, kilo_implement refuses to spawn a second process (wait for it withkilo_task_waitor stop it withkilo_task_cancelfirst).resume_task_id(string, optional): Resume a previous task whose run ended non-terminally or failed/cancelled (failed,failed_with_uncommitted_work,cancelled,error, or an orphanedrunningtask whose process exited) in the same worktree and branch. Refuses with a clear error if the worktree is gone or another run is active on it. Reuses its Kilo session when the session id is known (otherwise starts a fresh session) and prepends a generated preamble (git status --short,git diff --stat, commits on the branch since base, and fixed resume instructions) to the original spec stored in the task record (original_spec). Optionaltask_instructionsare appended as corrections, and the new task record linksresumed_from: <old id>.refresh_base("no"|"merge"|"rebase", optional, default"no"): When continuing a session or resuming a task in a worktree (continue_session_idorresume_task_id), optionally update the worktree from the current tip of the base branch before resuming ("merge"or"rebase"). Conflict behavior is controlled byrefresh_base_on_conflict.refresh_base_on_conflict("abort"|"resolve", optional, default"abort"): How to handle conflicts whenrefresh_basehits conflicts. With"abort"(default), aborts the merge/rebase leaving the worktree untouched and returns an error listing the conflicting files. With"resolve"(supported forrefresh_base="merge"only;"rebase"+"resolve"is refused with a clear error), leaves the conflicted merge in place and adds to the prompt the list of conflicted files and an instruction to resolve them preserving both sides' intent, run the tests, and complete the merge commit before continuing.isolation("worktree", optional): Auto-creates a git worktree + new branch underworking_directory(.kilo/worktrees/<branch>) and runs Kilo there instead of directly inworking_directory- the one-call equivalent of callingkilo_create_worktreeyourself first. When to skip: a worktree adds nothing for a brand new repository or a directory nobody else writes to; it is still recommended whenever another writer (a session, the user, another task) may touch the same tree.kilo_implementhas no isolation and no locking by default (see Concurrency & Isolation below) - pass this for anything beyond a single trivial edit, and always for parallel calls against the same repo. The worktree (and later the session, once resolved) are also registered in.kilo/agent-manager.jsonbest-effort - see Agent Manager Integration.worktree_branch/worktree_base_branch(string, optional): Branch name (defaultkilo/<task_id>) and base branch/commit for the worktree created byisolation='worktree'. Ignored unlessisolationis set.proposed_files("untracked"|"commit", optional, default"untracked"): How to handle*.proposedfiles written when Kilo needs to modify protected config files (AGENTS.md, kilo.json(c), opencode.json(c), or files under .kilo/ / .kilocode/). With"untracked"(default), tells Kilo to leave*.proposedfiles uncommitted (nevergit addthem, committing everything else); after the run, kilo-mcp lists any*.proposedfiles present in the working tree in the result (Proposed files to apply: …) and explicitly flags if any was committed anyway. With"commit", allows Kilo to commit*.proposedfiles alongside other changes.queue(string, optional) andqueue_concurrency(int, optional): Enqueue a background run (background=truerequired) into a named FIFO queue (e.g."audit-batch", or"default") instead of spawning immediately. A queue's concurrency cap is set viaqueue_concurrency(persisted in<data_dir>/queues/<name>.json; last value wins) and is also bounded by the globalmax_concurrent_runscap ([kilo] max_concurrent_runsinkilo-mcp.tomlorKILO_MCP_MAX_CONCURRENT_RUNS, default3). Enqueueing spawns a single-instance detached queue runner (python server.py --queue-runner, locked via<data_dir>/queue-runner.lockand logging to<data_dir>/queue-runner.log) that reconciles active runs and starts queued tasks in FIFO order every ~5s until the queue is empty, so the queue keeps draining even after the calling session and MCP server process exit.
kilo_task_wait
Await a background kilo_implement task until it reaches a terminal state (completed, failed, cancelled, error), or until timeout_seconds elapses, polling cheaply and reconciling orphaned processes from their log files every 2 seconds. Accepts timeout_seconds up to at least 3600 seconds (or more) for long runs and returns as soon as the task ends. When the task finishes, returns the kilo_task_result report (trimmed summary by default, or full trace with include_trace=true); on timeout, returns a clear status summary with live progress and elapsed seconds without raising.
Parameters: task_id (required), timeout_seconds (optional, int), include_trace (optional, bool, default false).
kilo_task_result
Fetch the outcome of a background delegation by task_id: by default, returns a trimmed result (status, exit code, session_id, worktree/branch when present, the parsed Final Report, and the path of the full log file) preventing tool-result size limit errors. Pass include_trace=true to retrieve the full execution trace. While still running it returns a "still running" pointer to kilo_task_progress/kilo_task_status, or the cancellation note if it was stopped. If the task's process has already exited but nobody reconciled its record yet (e.g. the server that launched it restarted mid-run), the record is self-healed from its log file on this call with neutral status reporting ("Result read from the run log (the Kilo process has exited)"). Task records persist under KILO_MCP_DATA_DIR/tasks/.
Parameters: task_id (required), include_trace (optional, bool, default false).
kilo_task_progress
Fine-grained live progress for a running background task, read straight from Kilo's own session database (kilo.db) - not a process heuristic: Kilo's own plan/todo list (each step's status), a tail of its most recent commentary, and running cost/tokens. Use this to judge what Kilo is actually doing (not just whether the process is alive), to decide whether to keep waiting, kilo_task_cancel, or prepare a corrective follow-up with continue_session_id. Scale how often you poll to the task's complexity/risk - small tasks rarely need it; large or high-stakes ones are worth checking periodically.
Parameters: task_id (required).
kilo_task_cancel
Intervention: stops a running background task by sending SIGTERM (escalating to SIGKILL after a short grace period) to its tracked process. A hard stop, not a graceful in-session abort - Kilo does not get to write its Final Report, and any partial file changes are left as-is (review with kilo_workspace_status). Race-safe against the background runner's own completion write, so the task record correctly ends up cancelled rather than being clobbered back to completed/failed.
Parameters: task_id (required), reason (optional, recorded on the task).
kilo_log_issue
Records a defect found while reviewing Kilo-generated code (linked to the run_id printed by kilo_implement). This is the feedback loop for prompt tuning: recurring categories surface in kilo_metrics and indicate what the spec template must start guarding against.
Parameters: run_id (required), category (kebab-case defect class, e.g. missing-edge-case, ignored-instruction), description (required), severity (minor|major|critical), file (optional).
kilo_log_decision
Records an orchestration branch decision (delegate | inline | escalate | discarded) to decisions.jsonl under KILO_MCP_DATA_DIR, so kilo_metrics and kilo-mcp-metrics-analyst can evaluate actual delegation decisions, inline follow-up rates, and discarded runs.
Parameters: branch (required: delegate|inline|escalate|discarded), reason (required), task_ref (optional), followup_needed (optional bool, default false), run_id (optional).
kilo_metrics
Aggregates usage over a look-back window: runs and outcomes, generated code volume, real cost of delegating (surfacing the breakdown: "cost of delegating: $X (Claude spec+review $Y + Kilo execution $Z)", or noting if Kilo execution was at no cost) vs estimated cost of generating inline, recorded orchestration decisions (delegate, inline, escalate, discarded, and inline_followup_needed), and logged defects by category. Raw JSONL data stays in KILO_MCP_DATA_DIR for ad-hoc analysis (jq, pandas, …).
Parameters: days (optional, default 30).
kilo_create_worktree
Creates a new isolated git worktree (with its own new branch) under .kilo/worktrees/<branch_name> - it runs git worktree directly, serialized by an in-process lock against other worktree creations in the same repo (no .git/index.lock races). This allows parallel kilo_implement runs without file collisions. Fails if the branch already exists. Prefer kilo_implement's own isolation='worktree' parameter for the common case (one call instead of two); use this standalone tool when you need the worktree to exist before deciding what to delegate into it. Also registers the new worktree in .kilo/agent-manager.json best-effort - see Agent Manager Integration.
Parameters: branch_name (required), base_branch (optional), working_directory (optional).
kilo_auth_status
Check the authentication status of Kilo providers (runs kilo auth list).
kilo_session_revert
Revert a Kilo session back to a previous checkpoint or message (message_id), allowing the orchestrator to undo unintended edits or steps during task execution.
Parameters: session_id (required), message_id (optional).
kilo_session_fork
Fork an existing Kilo session at a specific checkpoint (message_id) to explore an alternative implementation path in parallel.
Parameters: session_id (required), message_id (optional).
kilo_respond_question
Respond to an interactive question/prompt request asked by Kilo during task execution, unblocking paused sessions.
Parameters: request_id (required), answers (list of strings, required).
kilo_get_session_todo
Read the live plan and checklist (todo list) maintained by Kilo for a specific session.
Parameters: session_id (required).
kilo_update_session_todo
Create or update the checklist/todo list for a Kilo session. Allows an orchestrator architect to inject a structured plan or adjust steps mid-task.
Parameters: session_id (required), todos (list of objects, required).
kilo_run_command
Execute a deterministic, pre-programmed Kilo custom command (e.g., db-migrate) via kilo run --command <name>; args is passed to the command as its message.
Parameters: command_name (required), args (optional), working_directory (optional).
kilo_workspace_status
Report the git status (git status -s) of a working directory or worktree - useful to review what a delegated run actually touched. A clean tree and git failures are reported explicitly.
Parameters: working_directory (optional).
kilo_verify_worktree
Run a structured verification gate on a working directory or worktree. Executes a sequence of verification commands (lint, test, build) sequentially via the shell and returns a compact JSON verdict with overall status (ok), git commit hash (head), dirty flag (dirty), and output tails only for failed checks to avoid context window waste.
Security Caveat: Executes arbitrary shell commands provided by the caller or read from the project configuration.
Commands: Checks are taken from the explicit commands list, or, when omitted, from the [verify] table in a project-local kilo-mcp.toml or .kilo-mcp.toml at the working directory root (e.g. commands = ["pytest", "ruff check ."]). If neither exists, returns an error explaining both options (does not guess commands). Each command runs with cwd=working_directory sequentially under timeout_seconds; on timeout, the command's entire process group is killed. Execution continues across checks so all failures are reported.
Parameters: working_directory (required), commands (list of strings, optional), timeout_seconds (int, default 600, range 1..3600), tail_lines (int, default 40, range 1..500).
kilo_task_status
Coarse, OS-level diagnosis of running kilo run tasks - including delegations with no known task_id (e.g. launched from other sessions, or before this server tracked tasks). For each process it reports elapsed vs CPU time, network activity, the matching Kilo session's last update from ~/.local/share/kilo/kilo.db (read-only), and a verdict: WORKING (recent session writes, or a long model call in flight), STARTING (younger than 2 minutes), or LIKELY STUCK (minutes old, no CPU, no network, no session - kill the PID and the calling session receives the exit). For a task_id you launched yourself, prefer kilo_task_progress - it reads Kilo's actual plan and commentary, not just a heuristic. The same diagnostic (plus a standalone kill script) is also available outside the MCP tool call as scripts/diagnose-kilo-tasks.sh / scripts/kill-kilo-task.sh in the kilo-mcp-orchestrator skill.
Parameters: working_directory (optional - filter to one workspace).
📖 Example Workflow
You ask Claude: "I need to implement a new caching layer for the database module. Please find where the database connections are currently handled, design the new architecture, and have Kilo implement it."
Claude explores via RAG: Claude calls
kilo_rag_search(query="database connection pool and handlers")to let Kilo quickly find the relevant files in the workspace.Claude designs the architecture (acting as the Architect, using its superior reasoning and the search results).
Claude delegates to Kilo (Generator): Claude calls
kilo_implementwith:task_instructions: The detailed caching architecture it just designed.focus_files: The files identified in the RAG search (e.g.,["src/db/connection.py", "src/db/queries.py"]).agent:"code"model:"google/gemini-3.8-flash"
Execution: The MCP server writes the full specification to a temporary file - context files first, then instructions, hints, skills, and a mandatory Final Report contract - and spawns
kilo runas a subprocess. Sincebackgrounddefaults totrue,kilo_implementreturns immediately with atask_id, and Claude's conversation is never blocked while Kilo works.Monitoring (proportional to risk): for this multi-file caching change, Claude polls
kilo_task_progress(task_id)a few times - seeing Kilo's live plan/todo list, commentary, and running cost pulled straight from its session database. If it looked stuck or off-spec, Claude couldkilo_task_cancelit and re-delegate corrective instructions viacontinue_session_idinto the same session; for a small one-file fix, Claude would just skip straight to the result instead.Result: once done, Kilo has ended with the structured Final Report (Outcome / Files changed / Verification / Issues). Claude fetches it with
kilo_task_result(task_id); the server has already parsed it, recorded the run tometrics.jsonl(including cost estimates and the resolvedsession_id), and returns it together with arun_id.Claude reviews: Claude (acting as Reviewer) checks the Final Report and the resulting diff. If the review finds defects, Claude logs them with
kilo_log_issue(run_id, ...)- feeding the metrics that show which defect categories the prompts should start guarding against (kilo_metrics).
🔀 Concurrency & Isolation
kilo_implement has no isolation and no locking by default: it runs kilo run directly in working_directory (which defaults to the server's own current directory), and nothing - no lock file, no mutual exclusion - stops a second writer from touching the exact same working tree at the same time. That second writer can be another concurrent kilo_implement call, or the orchestrating assistant's own git commands run directly against that directory. This is a real, observed failure mode, not a theoretical one: a git branch got reset and an in-progress file edit was nearly lost when an orchestrator ran its own git history surgery in a checkout a background kilo_implement task was still committing to.
Two independent safeguards, layered rather than exclusive:
Isolate proactively. Pass
isolation='worktree'onkilo_implement(or callkilo_create_worktreeyourself first) to run Kilo in a dedicated git worktree + branch instead of the shared tree. Do this for anything beyond a single trivial edit, and always when dispatching multiplekilo_implementcalls in parallel against the same repository - parallel Kilo subprocesses are a deliberate feature of this server (see Design & Internals), and isolation is what makes that safe rather than a race. When done, review withkilo_workspace_statusand merge or remove the worktree (git worktree remove);kilo-mcp-conflict-resolvercovers resolving conflicts if two isolated features touched overlapping files at merge time.Get warned when you don't isolate. If
working_directoryisn't isolated and another task is alreadyrunningagainst that exact directory (matched by real path, not raw string),kilo_implement's response is prefixed with a⚠️ COLLISION WARNINGnaming the othertask_id. This is a warning, not a refusal - it does not block the call - but it should always be treated as a stop sign: wait for the other task, isolate, or use a different directory. The same reasoning applies symmetrically to the orchestrator's own git operations: checkkilo_task_status(working_directory=...)before running anything hard-to-reverse (rebase,reset --hard, history rewrites) against a directory that might still have a background Kilo task attached to it.
Neither mechanism replaces normal git discipline (commit or stash before risky operations) - they exist to make an easily-forgotten hazard hard to miss instead of silent.
🧟 Reliability: background task execution
Background kilo_implement tasks are launched as fully detached OS processes (subprocess.Popen(..., start_new_session=True), stdin explicitly redirected to /dev/null, output captured to a log file under KILO_MCP_DATA_DIR/tasks/<task_id>.log) - not an asyncio task awaited inside the server's own event loop. This matters because it fixes three real, previously-observed failure modes where a background task got stuck reporting "running" forever:
Server-lifetime coupling. An
asyncio.create_taskawaiting an in-memory-captured subprocess dies with the server process (restart, crash, client disconnect). Asetsid-detached process does not - it keeps running, and any later call tokilo_task_status/kilo_task_progress/kilo_task_result(even from a different server instance) reconciles the record by checking real PID liveness and reading the log file, finalizingstatusto"completed"/"failed"instead of leaving it stuck.Inherited stdin. A subprocess launched without an explicit
stdininherits the MCP server's own stdin - which is the client's JSON-RPC pipe, not a terminal or/dev/null. If Kilo (or anything downstream) ever probes or reads stdin, it hangs indefinitely waiting on a pipe that will never produce EOF or terminal-like behavior. Fixed by always passingstdin=DEVNULLexplicitly.Unreaped zombies reported as "alive".
os.kill(pid, 0)returns successfully for a zombie (exited but not yet reaped) process - a naive liveness check would report a genuinely-finished task as still running indefinitely. The liveness check reaps viaos.waitpid(pid, os.WNOHANG)first; only if that finds no exited child does it fall back toos.kill(pid, 0).Lingering
kilo runprocesses after completion. Ifkilo runemits its Final Report (or JSON event stream idle event) but the process hangs without exiting (e.g. unclosed background child processes or pipes), kilo-mcp detects that output has ceased for a grace period (default 60s, configurable viaKILO_MCP_LINGER_GRACE_SECONDS/linger_grace_seconds), reaps the process group (SIGTERM, escalating to SIGKILL after 5s), and marks the task status ascompletedwith notereaped lingering process after completion.
The first three were found and fixed by live end-to-end testing through the actual MCP protocol (unit tests mocking at the subprocess-spawn seam did not, and cannot, catch process-lifetime or stdin-inheritance bugs - they're only observable running the real binary through the real transport). The fourth was observed in real use (four tasks lingering for hours on 2026-10-17) and is covered by a stub-based test; it takes effect after the MCP server restarts.
🗂️ Agent Manager Integration
The Kilo VS Code extension's own "Agent Manager" UI reads its worktree/session registry from <repo_root>/.kilo/agent-manager.json. kilo_create_worktree and kilo_implement(isolation='worktree') write into the same file (same schema, same atomic tmp-file-then-rename scheme the extension itself uses) so worktrees and sessions created through this server can show up there too - no manual JSON editing needed.
Important caveat, confirmed by reading the extension's own WorktreeStateManager.ts: the extension loads this file once at startup into an in-memory map, never watches it for external changes, and every save serializes its entire in-memory state (a full overwrite, not a merge). An entry this server adds is therefore only guaranteed to survive until the extension's own next save - any UI action (renaming a tab, toggling a section) while the extension is open on the same repo will silently overwrite the addition with its own (unaware) in-memory snapshot. This is a structural limitation of the extension's design, not something fixable from this side. The write is still worthwhile: it's correct whenever the extension isn't currently running against that repo, and becomes visible on the extension's next startup load in that case. Confirmed live (2026-07-29): if a worktree/session doesn't show up despite being correct in agent-manager.json, closing and reopening the Agent Manager panel is enough to force a fresh load() - a full VS Code window reload isn't necessary.
Action needed after every worktree/session this server creates: there is no fix for the above on this side. Verified by reading the extension's full message-handling code (AgentManagerProvider.ts) on 2026-08-06 - agentManager.requestState (sent periodically by the webview) re-pushes the extension's already-in-memory state, it never re-reads the file; there is no fs.watch/poller anywhere in the extension, and no VS Code command or socket exposed for an external process to trigger a reload. The only way to see a worktree/session this server just created is to close and reopen the Agent Manager panel (or reload the window) afterward - there is nothing kilo-mcp can do to push the update live.
A second, independent limitation: the idle/busy/offline status shown for a session is never read from agent-manager.json - the extension computes it live by querying its own running Kilo server for that directory. A session entry written by this server is therefore a bookkeeping pointer (it makes the card appear), not a live/interactive session - don't expect a session launched via kilo_implement to become an interactive chat in the Agent Manager UI just because it's registered.
Two session-linking bugs found and fixed live (2026-07-29): a session could fail to show up nested under its worktree card even when everything above worked correctly. Root causes (both now fixed, see ARCHITECTURE.md §9 for the full detail): (1) linking only trusted a launch-time hint that's empty when a task reuses an already-existing worktree's directory - fixed by always matching the task's cwd against registered worktree paths; (2) more fundamentally, Kilo itself records a session's project directory as the main repo root, never the specific worktree subdirectory - so session_id resolution (kilo_task_progress, continue_session_id steering, and this linking) silently never worked at all for isolation='worktree' tasks, in every case, not intermittently. Fixed with a git-common-dir-based fallback match; verified live end-to-end after the fix.
🔐 Security Considerations
This server executes arbitrary code on your machine: kilo_implement runs Kilo in non-interactive (auto-approving) mode, and the env_vars, working_directory, and task_instructions parameters are fully controlled by the calling LLM. Treat it accordingly:
Run it only on a trusted, local machine - never expose it to untrusted clients or networks.
Kilo will edit files and run commands without asking for confirmation. Use version control and review the resulting diffs.
env_varscan override Kilo's runtime configuration; only enable this server for workflows you fully control.
🧭 Design & Internals
The architectural rationale (architect/executor philosophy, temp-file spec bridge, Final Report contract, async parallelism, RAG delegation) is documented in ARCHITECTURE.md, including component and sequence diagrams.
⚖️ License
Available Tools
24 toolskilo_auth_statusA
Check the authentication status of Kilo providers by running 'kilo auth list'.
Inputs: no named parameters. Returns: result
kilo_cleanupA
Safely cleans up stale git worktrees, merged feature branches, and orphan background dev server processes created by delegated Kilo runs.
Features:
By default (delete_collection=True), removes each deleted worktree's Qdrant vector collection (ws-<sha256[:16]>) via the REST API (404 is tolerated; errors never block worktree removal).
Optionally (delete_sessions=True), deletes Kilo sessions run in the removed worktree via the Kilo CLI (
kilo session delete <id>).Prune mode (prune_orphans=True): audits Qdrant collections named
ws-*whose source path no longer exists and deletes only those positively identified as belonging to a removed worktree (.kilo/worktrees/ paths); unknown hashes are reported, never deleted.Dry-run first (returns candidates, kept items, leftover work, and a plan_hash).
Requires plan_hash to apply (preventing race conditions or accidental deletions).
NEVER deletes worktrees with uncommitted changes or unmerged commits (reported as 'leftover_work').
NEVER uses git branch -D or git clean -f: only safe git branch -d.
Writes an audit log to .kilo/cleanup-.json upon execution.
Inputs: keep, scope, dry_run, plan_hash, +5 more. Returns: result
kilo_create_worktreeA
Create an isolated git worktree under .kilo/worktrees/<branch_name> (runs git directly, not Kilo). Each worktree gets its own new branch, so parallel kilo_implement runs on independent components never collide on files.
Prefer passing isolation='worktree' directly to kilo_implement instead of calling this separately — one step instead of two, and harder to forget. Use this standalone tool when you need the worktree before deciding what to delegate into it, or want a worktree kilo_implement doesn't manage.
Fails if the branch already exists — pick a fresh branch name per task.
Also registers the new worktree in .kilo/agent-manager.json (best-effort) so it can appear in the Kilo Agent Manager UI. There is no live sync with a running VS Code extension window — see kilo_implement's isolation parameter description for the caveat.
Inputs: branch_name (required), base_branch, working_directory. Returns: result
kilo_get_session_todoA
Read the live plan and checklist (todo list) maintained by Kilo for a specific session.
Inputs: session_id (required). Returns: result
kilo_implementA
Delegate a concrete code IMPLEMENTATION task to Kilo (the executor) while you stay the architect/orchestrator/reviewer.
⚠️ SIDE EFFECTS: Kilo runs non-interactively and AUTO-APPROVES its actions —
it will create/edit/delete files and run commands in working_directory
without asking. Only delegate work you have specified precisely, in a
version-controlled directory, and review the diff afterwards.
NON-BLOCKING BY DEFAULT: this tool starts the task and returns IMMEDIATELY
with a task_id — it does NOT wait for Kilo to finish, so the calling
conversation is never blocked on a long-running delegation. Use:
kilo_task_progress — live plan/todo list, recent commentary, cost so far.
kilo_task_status — quick OS-level heuristic (any
kilo runprocess).kilo_task_result — the final report, once it is done.
kilo_task_cancel — stop it if it is going wrong. Pass
background=falseonly for short tasks where you deliberately want to block and get the full report back in this same call.
How to use it well:
(Optional) kilo_rag_search to locate the relevant files.
Write a precise spec in
task_instructionsor pass an existing Markdown file viabrief_file(when both are given,task_instructionsis appended under## Additional instructionswithout modifyingbrief_fileon disk); pass the key files asfocus_files; addexecution_hints,skills_to_load, and optionallylog_dir(to also save<task_id>.login the project; relativebrief_file/log_dirpaths resolve against the originalworking_directoryeven withisolation='worktree'). When the task instructions enumerate items (a numbered or bulleted list of deliverables), Kilo is instructed to include one line per item ("done" or "not done: why") in the Final Report, in the same order. Initial context size (prompt + focus_files) is checked by preflight: warns abovemax_context_tokens_warn(default 40,000) and refuses abovemax_context_tokens_refuse(default 120,000; 0 disables) to avoid connection resets.Pick a valid
model(see kilo_list_models) andagent.Scale how closely you watch it to the task's complexity/risk: a small, well-scoped change needs only a final kilo_task_result check; a large, multi-file, or high-risk delegation deserves periodic kilo_task_progress polling so you can catch it drifting off-spec early.
Act as reviewer: check
Exit Codeand review the Final Report and changed files; inspect the resulting changes.
STEERING & RESUMING: if a run (background or foreground) drifts off-spec, don't just
restart from scratch — read its session_id (in the result / progress
report), optionally kilo_task_cancel the current run, then call
kilo_implement again with continue_session_id set to that id and corrective
task_instructions. Kilo resumes the SAME session with full memory of what
it already built, rather than starting blind. If a run died mid-way (network
error, cancel, crash, or failed_with_uncommitted_work), pass resume_task_id
set to the previous task id: kilo_implement reuses its worktree and branch
(refusing if the worktree is gone or another run is active on it), reuses its
Kilo session when known (else starts a fresh session), prepends a generated
preamble with git status --short, git diff --stat, commits since base, and
resume instructions to the original spec stored in the task record (with
optional task_instructions appended as corrections), and links
resumed_from: <old id> on the new task record. If a task is still actively
running on that session or worktree, kilo_implement refuses to spawn a second
process — wait for it to complete with kilo_task_wait or stop it with
kilo_task_cancel before continuing. When continuing or resuming in an isolated
worktree, pass refresh_base='merge' or refresh_base='rebase' to update the
worktree from the current tip of its base branch before resuming; when
conflicts occur, refresh_base_on_conflict='abort' (default) aborts and returns
the conflicting files, while refresh_base_on_conflict='resolve' (with
refresh_base='merge' only; rebase + resolve is refused) leaves the
conflicted merge in place and instructs Kilo in the prompt to resolve the
conflicts preserving both sides' intent, run the tests, and complete the merge
commit before continuing.
Parallelism & Batch Queues: emitting several kilo_implement calls in one turn
runs them concurrently (independent Kilo subprocesses). For large batches, pass
queue='<name>' (with background=true) and optional queue_concurrency=<int>
to enqueue runs in FIFO order instead of spawning all at once. A detached queue
runner (python server.py --queue-runner) starts queued tasks while slots are
free under both the queue's cap and the global max_concurrent_runs cap
(config [kilo].max_concurrent_runs / env KILO_MCP_MAX_CONCURRENT_RUNS,
default 3), so the queue keeps draining even after the calling session and MCP
server process exit.
⚠️ NO ISOLATION, NO LOCKING BY DEFAULT: Kilo runs directly in
working_directory with nothing preventing a concurrent writer — another
kilo_implement call, or your own git commands — from racing it in the same
tree (uncommitted changes lost, branches reset out from under a run,
whichever writer runs last silently wins). Pass isolation='worktree' to
auto-create a dedicated git worktree + branch for this run (equivalent to
calling kilo_create_worktree yourself first) — use it for anything beyond a
single trivial edit, and always when dispatching parallel tasks against the
same repo. If you don't isolate, the response is prefixed with a collision
warning whenever another task is already running against the exact same
working_directory — treat that warning as a stop sign, not a formality.
When to skip a worktree: a worktree adds nothing for a brand new repository or a directory nobody else writes to; it is still recommended whenever another writer (a session, the user, another task) may touch the same tree.
⚠️ PROTECTED CONFIG FILES: Kilo always asks for approval before editing the
project-root AGENTS.md, kilo.json(c), opencode.json(c), or anything
under .kilo/ or .kilocode/ (except .kilo/plans/), whatever the
permissions say. A non-interactive run auto-rejects that ask and ENDS, with
no Final Report and no commit. The delegated prompt therefore tells Kilo to
write the intended content to <path>.proposed instead; apply it yourself.
Don't ask Kilo to edit those files directly.
⚠️ EXTERNAL PATHS: Unattended runs cannot read outside the working directory unless
the Kilo config allows external_directory; do real-world checks on such paths on
the orchestrator side.
Handling of *.proposed files is controlled by proposed_files:
proposed_files='untracked'(default): Kilo is instructed to leave*.proposedfiles uncommitted (nevergit addthem, committing everything else). After the run, kilo-mcp lists any*.proposedfiles present in the working tree in the result ("Proposed files to apply: …"). If one got committed anyway, the result says so explicitly.proposed_files='commit': Kilo is allowed to commit*.proposedfiles alongside other changes as before.
Returns a text report (trimmed by default: status, exit code, session_id,
worktree/branch when present, parsed Final Report, and log file path; pass
include_trace=true for the full run trace).
When to delegate
Kilo runs at no cost to this operator; the only cost is your own (Claude) tokens. DELEGATE to Kilo when doing the task yourself would need a large agentic loop that is specifiable up front — multi-file changes, bulk/mechanical generation (e.g. tests for every endpoint), wide refactors, anything where the resent context of an inline loop would dwarf a written spec. ALSO PREFER DELEGATING when Kilo has a skill or agent matching the task's domain (check kilo_list_skills / kilo_list_agents; pass them via skills_to_load / agent): domain-specific skills and agents encode proven procedures and pitfalls, making Kilo's output better than an unguided inline attempt regardless of size. DO IT YOURSELF when the task is small (one or a few files, short edits), needs tight back-and-forth reasoning that can't be pinned down in a spec, or when writing the spec plus reviewing Kilo's output would cost more tokens than just doing it inline. Either way, always review the returned report.
Inputs: agent, model, queue, log_dir, +18 more. Returns: result
kilo_list_agentsA
Discover which Kilo agents are available for the agent argument of
kilo_rag_search / kilo_implement.
Scans the project (.kilo/agent/, .kilocode/agent/), the global
(~/.kilo/agent/, ~/.kilocode/agent/) directories and the VS Code
extension storage for custom agent definitions. Built-in primary agent
code (implementation) always exists even if nothing is listed here.
Subagents like explore cannot be used as primary agents for kilo_implement
(use kilo_rag_search for exploration).
Call this before delegating if you are unsure which agent to target, so you pick a real one instead of guessing.
Inputs: working_directory. Returns: result
kilo_list_modelsA
List the model ids that Kilo can actually use, in provider/model form.
Use this to validate the model argument of kilo_implement BEFORE
delegating: passing a model id that Kilo does not know makes the run fail.
Allowed models by policy: google/gemini-3.8-flash (routine tasks) and
google/gemini-4-argon (complex/high-risk tasks).
Reflects the providers you are authenticated with; run kilo auth login in
a terminal to add more. This is a read-only discovery call.
Inputs: filter. Returns: result
kilo_list_skillsA
Discover which Kilo skills are available for the skills_to_load
argument of kilo_implement.
Scans project and global directories (plus the VS Code extension storage
for marketplace-installed skills) for SKILL.md files. Skills are named
workflows/knowledge packs that Kilo can adopt for a task. Use the names
returned here verbatim in skills_to_load; passing a name that is not
listed has no effect.
Inputs: working_directory. Returns: result
kilo_log_decisionA
Record an orchestration routing or outcome decision to decisions.jsonl under DATA_DIR so kilo_metrics can summarize delegation vs inline choices, escalations, discarded runs, and inline follow-up rates.
Inputs: branch (required), reason (required), run_id, task_ref, +1 more. Returns: result
kilo_log_issueA
Record a defect found while reviewing code that Kilo generated.
ALWAYS call this when your post-delegation review finds a problem — this is the feedback loop used to tune the instruction prompts over time. Issues are aggregated by kilo_metrics; recurring categories indicate what the generated spec template must start guarding against.
Inputs: run_id (required), category (required), description (required), file, +1 more. Returns: result
kilo_metricsA
Summarize kilo-mcp usage: runs, outcomes, generated code volume, real delegation cost vs estimated inline-Claude cost, recorded orchestration decisions from kilo_log_decision, and defect categories from kilo_log_issue. Use this to judge whether delegation is paying off and which defect classes the spec template should address next.
Raw data lives in JSONL files (metrics.jsonl / issues.jsonl / decisions.jsonl) under KILO_MCP_DATA_DIR (default ~/.local/share/kilo-mcp) for ad-hoc analysis.
Inputs: days. Returns: result
kilo_rag_searchA
Delegate READ-ONLY codebase search/exploration to Kilo, so you (the architect) can locate relevant code without pulling the whole repository into your own context.
This tool is a standing resource for YOUR OWN work: use it whenever you need to understand or navigate an indexed codebase — also (and especially) when you are implementing or answering questions yourself and NOT delegating anything to kilo_implement.
Runs Kilo's explore agent, which uses semantic (vector) search over the
workspace's existing index plus targeted file reads, and returns a summary
with file paths and code snippets. It does NOT modify files.
Note: this reuses the index maintained by the Kilo IDE extension — it does not create or refresh the index. If a workspace was never indexed by the extension, semantic search falls back to plain text/glob search.
Typical flow: call this to find the relevant files, reason about the design yourself, then hand the concrete file list to kilo_implement via focus_files.
Returns a text report: Exit Code, STDOUT (the findings), STDERR (the
run trace). Review STDOUT as the reviewer.
Inputs: query (required), path, working_directory. Returns: result
kilo_respond_questionA
Respond to an interactive question asked by Kilo during task execution, unblocking the session.
Inputs: answers (required), request_id (required). Returns: result
kilo_run_commandA
Execute a deterministic, pre-programmed Kilo custom command (e.g., db-migrate)
via kilo run --command <name>. Discover available names with kilo_list_skills'
sibling directories or the .kilo/command/ folder.
Inputs: command_name (required), args, working_directory. Returns: result
kilo_session_forkB
Fork an existing Kilo session at a specific checkpoint to explore an alternative implementation path in parallel.
Inputs: session_id (required), message_id. Returns: result
kilo_session_revertB
Revert a Kilo session back to a previous message/checkpoint. Allows the orchestrator to undo changes or steps if Kilo took a wrong path.
Inputs: session_id (required), message_id. Returns: result
kilo_task_cancelA
STOP a running background kilo_implement task: this is the direct intervention lever, for when kilo_task_progress (or kilo_workspace_status) shows a delegation going wrong — off-spec changes, a stuck/looping process, burning cost with no progress — and you don't want to wait for the timeout.
Sends SIGTERM to the tracked process (and attempts an HTTP abort if
connected to a running kilo serve instance), escalating to SIGKILL after a
couple seconds if it hasn't exited. This is a hard stop — Kilo does not get
a chance to write its Final Report. Any partial file changes it already
made are left as-is; review with kilo_workspace_status and decide whether to
keep, revert, or continue them with a fresh kilo_implement call using
continue_session_id.
Inputs: task_id (required), reason. Returns: result
kilo_task_progressA
Poll FINE-GRAINED LIVE progress of a running background kilo_implement task: Kilo's own plan/todo list (each step's status), a tail of its most recent commentary, and running cost/tokens — read directly from Kilo's session database (kilo.db), not inferred from OS-level process heuristics.
Use this instead of (or alongside) kilo_task_status when you need to actually judge WHAT Kilo is doing, not just whether the process is alive — e.g. to decide whether to keep waiting, kilo_task_cancel a run that has drifted off-spec, or prepare a corrective kilo_implement call with continue_session_id.
Scale how often you poll to the task's complexity/risk: a small, well-scoped delegation rarely needs this at all (just wait for kilo_task_result); a large, multi-file, or high-stakes one is worth checking periodically so problems surface long before the final report.
If no session is found yet, Kilo has probably just started — try again in a few seconds.
Inputs: task_id (required). Returns: result
kilo_task_resultA
Fetch the outcome of a background kilo_implement task.
Returns the task result once completed: by default, returns a trimmed
summary with status, exit code, session_id, worktree/branch (when isolated),
the parsed Final Report, and the log file path. Pass include_trace=true to
retrieve the full run trace. While still running it says so — use
kilo_task_progress for live plan/commentary or kilo_task_status for a
quick OS-level heuristic. Tasks run as detached OS processes, independent
of this server: results persist on disk and self-heal across server
restarts — even a task that was still running when a previous server
instance died is recovered here (from its log file) the first time
anything asks about it, not lost.
Inputs: task_id (required), include_trace. Returns: result
kilo_task_statusA
Diagnose the state of running kilo run tasks and/or batch queues.
When called with task_id, reports that task's status (for a queued task:
status queued, queue name, and 1-based FIFO position in queue).
When called with queue (or with no task_id), lists queues with
queued/running/finished counts and the queued task IDs in FIFO order, in
addition to the OS-level check of running kilo run processes (elapsed vs
CPU time, network activity, matching Kilo session update, and verdict:
WORKING / STARTING / LIKELY STUCK). Also restarts the detached queue runner
if queued tasks exist and no runner is currently active.
Inputs: queue, task_id, working_directory. Returns: result
kilo_task_waitA
Wait until a background kilo_implement task reaches a terminal state
(completed, failed, failed_with_uncommitted_work, cancelled, error) or timeout_seconds
elapses, polling cheaply every 2 seconds and reconciling orphaned processes from their
log files via _reconcile_task_if_orphaned. Also waits through queued -> running -> terminal
for queued tasks, restarting the detached queue runner if it has died.
Accepts timeout_seconds up to at least 3600s (or more) for long runs and
returns as soon as the task ends. When terminal, returns the kilo_task_result
output (trimmed by default, or full trace with include_trace=True).
On timeout, does not raise: returns a clear status message with current progress
and elapsed seconds.
Inputs: task_id (required), include_trace, timeout_seconds. Returns: result
kilo_update_session_todoB
Create or update the checklist/todo list for a Kilo session. Allows an orchestrator architect to inject a structured plan or adjust steps mid-task.
Inputs: todos (required), session_id (required). Returns: result
kilo_verify_worktreeA
Run a structured verification gate on a working directory or worktree.
Executes a sequence of verification commands (lint, test, build) and returns a compact structured verdict with git head/dirty state and output tails for failed checks only, minimizing context window waste.
SECURITY NOTE: This tool executes arbitrary shell commands provided by the caller or read from project configuration.
Commands are taken from the explicit commands list, or, when omitted,
from the [verify] table in a project-local kilo-mcp.toml or .kilo-mcp.toml
at the root of working_directory (e.g. commands = ["pytest", "ruff check ."]).
If neither is found, returns an error explaining both options.
Each command runs sequentially with cwd=working_directory via the shell.
If a command exceeds timeout_seconds, its entire process group is killed.
All commands are run regardless of individual failures.
Returns a JSON string: { "ok": bool, "working_directory": str, "head": str | null, "dirty": bool, "checks": [ { "command": str, "exit_code": int | null, "passed": bool, "duration_s": float, "timed_out": bool, "output_tail": str } ] }
Inputs: working_directory (required), commands, tail_lines, timeout_seconds. Returns: result
kilo_workspace_statusA
Report the git status (porcelain short format) of a working directory or worktree — use it to review what a delegated run actually touched.
Inputs: working_directory. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools have distinct roles, but the task-monitoring cluster overlaps heavily: kilo_task_result, kilo_task_wait, kilo_task_status, and kilo_task_progress all report on a running/finished task, and kilo_task_progress vs kilo_get_session_todo both surface the todo list. kilo_run_command vs kilo_implement and kilo_workspace_status vs kilo_verify_worktree are also close pairs. The very detailed descriptions help an agent choose correctly, but there is more than one or two confusable boundaries.
Every name is snake_case with a uniform kilo_ prefix, which makes the set predictable and searchable. Most follow verb_noun (list_models, create_worktree, log_issue), but some deviate into noun-only or noun_noun forms (kilo_metrics, kilo_implement, kilo_cleanup, kilo_auth_status, kilo_rag_search). These are minor deviations rather than a breakdown of convention.
24 tools is on the heavy side but the domain (delegation, task lifecycle, sessions, worktrees, discovery, metrics) is genuinely broad and most tools earn their place. A few could be consolidated — task_result/task_wait, status/progress, workspace_status/verify_worktree — which keeps it from being a clean 5. Slightly over-scoped but reasonable for an orchestration server.
Coverage is strong: discovery (models/agents/skills), auth, RAG search, implementation, full task monitoring and cancel/resume, session todo/revert/fork/respond, worktree create/verify/cleanup, and metrics/logging. Minor gaps remain — no explicit list of past tasks or worktrees (only inferred from status/cleanup dry-run) and no direct session-delete or task-record management. Agents can work around these.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Hosted YouTube MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server to dynamically load Claude Code skills into AI agents515MIT
- AlicenseAqualityDmaintenanceMCP server that spawns autonomous Claude Code agents in GitHub repos, enabling task delegation with persistent state, multi-step workflows, and job monitoring.4729 npm2Apache 2.0
- AlicenseAqualityDmaintenanceAn MCP server that bridges Claude Desktop and Claude Code by letting Desktop read and interact with Claude Code Remote Control sessions, enabling cross-agent coordination.64MIT
- AlicenseAqualityDmaintenanceMCP server that bridges OpenAI's Agents SDK with Claude Code, enabling web search, file search, and computer use capabilities directly in your development environment.29 npm1MIT