MCP tools

The kanman MCP server: endpoint, authentication and every tool with its inputs, results and errors.

kanman exposes a small MCP server (Model Context Protocol) that coding agents use to work on a story under your team’s rules. Inside a run, kanman attaches it to the coding agent automatically. You can also add it to Claude Code or Codex on your own machine and work on a kanman story from the terminal; the change still goes through the outcome gate and gets an evidence pack. The setup is described in Use kanman from Claude Code or Codex.

Endpoint and authentication

Property Value
URL for local use https://api.kanman.ai/functions/v1/executor-mcp/stories/<story-key>, for example .../stories/SBX-12
Transport Streamable HTTP, JSON responses, no session and no event stream
Authentication Authorization: Bearer <token>
Token inside a run A per-run token, created by kanman and valid only while that run attempt is live. You never see it.
Token for local use A km_ API token from Settings, API, created in the workspace of the story. The story key in the URL decides which story the session works on.
Optional header x-kanman-executor: codex labels the local run as a Codex run. Without it, the run is labelled Claude Code.

Claude Code:

claude mcp add --transport http kanman \
  https://api.kanman.ai/functions/v1/executor-mcp/stories/SBX-12 \
  --header "Authorization: Bearer $KANMAN_API_KEY"

Codex (~/.codex/config.toml, with the token in the environment variable KANMAN_API_KEY):

[mcp_servers.kanman]
url = "https://api.kanman.ai/functions/v1/executor-mcp/stories/SBX-12"
bearer_token_env_var = "KANMAN_API_KEY"

Tools at a glance

Tool Purpose
get_story Read the story, its acceptance criteria and the policy that applies. Call it first.
start_work Move the story to In Progress and open the run.
report_progress Post a progress line on the run page.
request_human_input Ask a question in the decision inbox; the run pauses.
check_policy Ask whether an action is allowed before trying it.
submit_for_review Hand the pushed change to the outcome gate.
complete_work Move the story on; only possible after verification passed.

The coding agent never declares a story done. kanman runs the gates and performs every gated move. See The outcome gate and evidence.

get_story

Returns the story, its acceptance criteria and Demonstrate block, the test plan, the current run and a summary of the team policy. No inputs.

Example result:

{
  "story": {
    "key": "SBX-12",
    "title": "Export invoices as CSV, filtered by date range",
    "description": "Customers need to export their invoices for their accountant.",
    "acceptanceCriteria": [
      {
        "id": "ac-1",
        "text": "Given a customer with 3 invoices in March, When they export March as CSV, Then the file has 3 rows and the columns date,number,amount"
      }
    ],
    "demonstrate": {
      "kind": "ui",
      "steps": ["open /invoices", "pick 2026-03-01..2026-03-31", "click Download CSV"],
      "expected": "a CSV downloads with columns date,number,amount"
    },
    "testPlan": ["unit: CSV serializer", "e2e: download flow"],
    "affectedAreas": ["src/invoices/**"]
  },
  "run": {
    "runKey": "run-7f3k",
    "attempt": 1,
    "phase": "implement",
    "stage": "implementing",
    "branch": "kanman/sbx-12-export-invoices-as-csv-filtered-by-date-range",
    "status": "running"
  },
  "policy": {
    "preset": "balanced",
    "deniedPaths": ["infra/**", "**/*.tf", ".github/workflows/**", ".kanman/acceptance/**"],
    "maxChangedFiles": 30,
    "maxChangedLines": 800,
    "runBudgetCents": 200,
    "planApproval": "always",
    "requireAcceptanceSpec": true,
    "repositories": ["kanman-ai/pilot-sandbox"]
  }
}

run is null until a run exists. phase is plan while a run waits for plan approval and implement afterwards.

start_work

Moves the story from Backlog, Refining or Ready to the In Progress column and returns the run. Locally, the first call opens a run for the story, so progress, verification and the evidence pack work as for kanman’s own runs. No inputs.

Result field Description
runKey The run, for example run-7f3k.
branch The run’s branch inside a kanman run; null for a local run, which uses your own branch.
movedToInProgress true when the story was moved.
next What to do next.

While a kanman run is still planning (the team requires plan approval and the plan is not approved yet), start_work refuses: the agent writes the plan and ends its turn, and the plan goes to the decision inbox. Local runs have no planning phase.

report_progress

Posts one line to the progress updates on the run page and sets the run’s stage.

Input Type Required Description
stage string yes planning, implementing or verifying.
message string yes One sentence for the team, up to 2,000 characters.

Result: { "recorded": true }.

request_human_input

Asks a question in the decision inbox (decision kind clarification) and pauses the run until someone answers. The answer comes back to the run as input when it continues.

Input Type Required Description
question string yes The question, up to 4,000 characters.
options array of strings no 2 to 4 answer options. Without them, the decision offers “Answer” and “Stop this run”.
recommendedIndex integer no Index (0 to 3) of the option the agent recommends.
{ "decisionKey": "dec-4h2k", "next": "Your question is in the team inbox. End your turn now; the run continues with the answer." }

check_policy

Asks whether an action is allowed before the agent tries it, for example “may I touch infra/?”. The answer uses the same rules kanman applies later to the final diff. Every call is recorded in the audit log as policy_decision.

Input Type Required Description
kind string yes path, repo, diff_size, budget, hours, concurrency, plan_approval or merge.
subject string yes What is checked: a repository path (infra/alarms.tf), a repository (acme/billing or github:acme/billing@main), a diff size as <files>:<lines> (12:340), a story size for plan_approval, or the number of changed lines for merge.
amountCents integer for budget The projected spend of the run in euro cents.
escalate boolean no With true, an action that needs a human opens the matching decision and pauses the run.
Result field Description
allowed true or false.
authority AUTO, NOTIFY or ESCALATE. See the authority table.
reasonKey Reason as a key, for example policy.path.denied.
reasonParams Values for the reason, for example the path, the matching rule and the preset.
decisionKind Set when a human can lift the denial, for example touch_denied_path.
decisionKey The decision that was opened, when escalate was true; otherwise null.
{
  "allowed": false,
  "authority": "ESCALATE",
  "reasonKey": "policy.path.denied",
  "reasonParams": { "path": "infra/alarms.tf", "glob": "infra/**", "preset": "balanced" },
  "decisionKind": "touch_denied_path",
  "decisionKey": null
}

submit_for_review

Tells kanman that the work is committed and pushed. The summary is kept for the evidence pack. Inside a kanman run, verification starts when the agent ends its turn; a local run is finished right away and verification starts. kanman then runs the gates (the acceptance spec against a fresh environment, the diff guard and the diff limits, CI and the review) and moves the story to Review only when they pass. The result appears on the run page.

Input Type Required Description
summary string yes What changed and how it meets each acceptance criterion.
prUrl string no The pull or merge request URL, if you opened one.
prNumber integer no The pull or merge request number, if you opened one.
{ "submitted": true, "next": "Verification has started; the run page shows the evidence." }

If a gate fails, kanman starts an automatic rework attempt with the gate output, as the policy allows.

complete_work

Moves the story to the next column (Review, or Done when the team has no Review column). kanman refuses unless the run has a verification record in which no gate failed and, when the team requires an acceptance spec, the spec proved the outcome. No inputs.

Result: { "completed": true, "movedTo": "<column>" }.

Errors

A tool that cannot do what was asked returns a tool result marked isError: true with a readable message. The agent should read it and act on it. Typical messages:

Message Meaning
No run is active for this story yet. Call start_work first. The tool needs a run; locally, call start_work first.
You are planning this story. Write the plan, end your turn and wait for approval; … start_work during the planning phase of a kanman run.
No verification record yet. Submit for review and wait for verification. complete_work before the gates ran.
Verification failed: … complete_work after a failed gate; the failing gates are named.
Verification has no outcome proof (acceptance spec not green). complete_work while the acceptance spec has not passed.
Invalid arguments: … An input is missing or has the wrong type.

Requests the server cannot accept at all (missing or invalid token, a story outside the token’s workspace) are answered with HTTP 401. See Errors and rate limits.

Last updated: January 1, 0001

Open kanman