Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
KILO_MCP_CONFIGNoPath to the configuration file. Overrides default search locations.
KILO_MCP_TIMEOUTNoTimeout in seconds for Kilo subprocesses. Defaults to 1800.1800
KILO_MCP_DATA_DIRNoDirectory for task records and metrics data.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

kilo-mcp exposes the local Kilo Code CLI: kilo_implement delegates development work, kilo_rag_search queries the semantic index of the workspace.

IMPORTANT — the indexing resource is yours to use directly: kilo_rag_search reads the codebase index maintained by the Kilo IDE extension, and it is available for YOUR OWN exploration and development work, not only as a scoping step before delegating to kilo_implement. Whether or not you delegate the implementation, prefer kilo_rag_search over grep-style search for conceptual queries ('where is X handled?') on indexed workspaces — it is cheaper than pulling files into your context and works from intent rather than exact strings.

Orchestration workflow (for the connected assistant)

  • Phase 1 — Discovery & RAG: explore with kilo_rag_search; check capabilities with kilo_list_models and kilo_auth_status.

  • Phase 2 — Isolation: kilo_implement has NO isolation and NO locking by default — it runs directly in working_directory (defaulting to the server's own cwd) with nothing preventing a concurrent writer (another kilo_implement call, or your own git commands) from racing it in the same tree. Pass isolation='worktree' on kilo_implement (or call kilo_create_worktree yourself first) for anything beyond a single trivial edit, and always when dispatching parallel tasks against the same repo. If you skip isolation, kilo_implement still warns you when another task is already running against the exact same working_directory — do not proceed past that warning without a plan (wait, isolate, or pick a different directory).

  • Phase 3 — Delegation: call kilo_implement in parallel across the worktrees. It runs in the BACKGROUND BY DEFAULT and returns a task_id immediately — the conversation is never blocked waiting for Kilo.

  • Phase 4 — Monitoring & intervention: scale how closely you watch a task to its complexity/risk. Small, well-scoped delegations can be awaited deterministically with kilo_task_wait (which polls and reconciles orphaned processes from their log files, returning kilo_task_result when done or live progress on timeout). Large, multi-file, or high-risk ones are worth polling periodically with kilo_task_progress (Kilo's own live plan/todo list, recent commentary, running cost — read from its session database, not a heuristic); kilo_task_status gives a quicker but coarser OS-level signal. If a task drifts off-spec or looks stuck, kilo_task_cancel stops it, and a corrective kilo_implement call with continue_session_id resumes the same session with corrective instructions instead of starting blind.

  • Phase 5 — Verification & review: inspect results with kilo_workspace_status, run verification gates with kilo_verify_worktree, and review every Final Report.

  • Phase 6 — Closure & telemetry: log orchestration decisions with kilo_log_decision and defects found during review with kilo_log_issue.

Metrics analysis (for the connected assistant)

  • Call kilo_metrics to analyze ROI (delegation_cost_usd vs inline_estimate_usd) and decision branches (kilo_log_decision).

  • Review kilo_log_issue defects to improve future specs.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/skills": {}
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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.

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.

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.

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.

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 run process).

  • kilo_task_result — the final report, once it is done.

  • kilo_task_cancel — stop it if it is going wrong. Pass background=false only for short tasks where you deliberately want to block and get the full report back in this same call.

How to use it well:

  1. (Optional) kilo_rag_search to locate the relevant files.

  2. Write a precise spec in task_instructions or pass an existing Markdown file via brief_file (when both are given, task_instructions is appended under ## Additional instructions without modifying brief_file on disk); pass the key files as focus_files; add execution_hints, skills_to_load, and optionally log_dir (to also save <task_id>.log in the project; relative brief_file/log_dir paths resolve against the original working_directory even with isolation='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 above max_context_tokens_warn (default 40,000) and refuses above max_context_tokens_refuse (default 120,000; 0 disables) to avoid connection resets.

  3. Pick a valid model (see kilo_list_models) and agent.

  4. 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.

  5. Act as reviewer: check Exit Code and 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 *.proposed files uncommitted (never git add them, committing everything else). After the run, kilo-mcp lists any *.proposed files 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 *.proposed files 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.

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.

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.

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.

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.

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.

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.

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.

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.

kilo_auth_statusA

Check the authentication status of Kilo providers by running 'kilo auth list'.

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.

kilo_session_forkB

Fork an existing Kilo session at a specific checkpoint to explore an alternative implementation path in parallel.

kilo_respond_questionA

Respond to an interactive question asked by Kilo during task execution, unblocking the session.

kilo_get_session_todoA

Read the live plan and checklist (todo list) maintained by Kilo for a specific session.

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.

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.

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.

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 } ] }

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.

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.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
kilo-mcp-conflict-resolverResolve merge conflicts in files produced by parallel Kilo tasks - find conflict markers, merge both versions preserving the semantics of each parallel feature, verify with linter/build.
index.json
kilo-mcp-executor-contractBehavioral contract for Kilo when executing background tasks delegated by an orchestrating AI (e.g. Claude) through the kilo-mcp server - zero interactivity, focus_files contract, mandatory Final Report, fail fast.
index.json
kilo-mcp-metrics-analystEvaluate kilo-mcp delegation efficiency - ROI analysis via kilo_metrics (delegation_cost_usd vs inline_estimate_usd), decision telemetry via kilo_log_decision, defect-pattern review from kilo_log_issue, and feedback-loop proposals for better task specifications. Use when asked whether delegation to Kilo is paying off.
index.json
kilo-mcp-orchestratorTool-level binding for orchestrating Kilo via the kilo-mcp server - kilo_rag_search, kilo_implement with worktree isolation, deterministic wait (kilo_task_wait), progress monitoring, and defect telemetry (kilo_log_issue). Use specifically when executing tasks through kilo-mcp tools. For generic multi-agent coordination or native worktrees, use orchestration-workflow.
index.json
incidents.md
diagnose-kilo-tasks.sh
kill-kilo-task.sh
kilo-mcp-rag-explorerSpecialized skill for Kilo's explore agent when running codebase semantic searches. Optimizes index lookups, file summaries, and ensures read-only safety.
index.json

TDQS

A3.7/5.0

Scored across 24 tools

Disambiguation3/5

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.

Naming Consistency4/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivityActive
ResponsivenessNo recent community issues