kibi-mcp
v3.29.0Kibi requirements, traceability, and proof MCP.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
kb_query
Read entities from the KB with exact filters, or ask typed fact questions. Use for lookup by id, type, tags or sourceFile, and for precise questions about modeled facts: predicate facts by name with named arguments (predicate + where), property facts of a subject (subjectKey + propertyKey), the domain view of a subject (factKind 'subject' + subjectKey: its definition, broader and narrower subjects, every current requirement about it and the claims and scenarios on it), or the catalog of facts of one kind (factKind; 'predicate_schema' lists the predicates you can ask about with their argument n…
| Parameter | Type | Description |
|---|---|---|
args | array | Positional argument values for a predicate with no schema; null matches any. Prefer where. |
distinct | string | Optional argument name whose distinct values to count across the matching predicate facts. |
factKind | string | Typed fact filter: list facts of one kind; 'predicate_schema' returns the catalog of askable predicates. |
id | string | Optional exact entity ID. Example: 'REQ-cli-gc'. If omitted, returns matching entities by other filters. |
includeBody | boolean | With id only: also return the entity's authored Markdown body. Default: false. |
kb | string | Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB. |
limit | number | Optional max rows to return after filtering. Default: 100 when omitted. Example: 25. |
namespace | string | Optional predicate namespace when the same name exists in several. Default: any namespace. |
offset | number | Optional zero-based pagination offset. Default: 0. Example: 50 to skip first 50 rows. |
polarity | string | Optional polarity filter for predicate facts. Default: both. |
predicate | string | Typed fact filter: predicate name to ask about; returns its stored facts with arguments, polarity and effect. |
propertyKey | string | Optional property key under subjectKey, e.g. 'max_roles'. Returns operator, value and unit of each fact. |
scope | string | Optional: 'current_requirements' keeps only facts a current (not superseded or retired) requirement requires. |
sourceFile | string | Optional source-file substring filter. Example: 'src/auth/login.ts'. Uses KB source linkage, not file-system scanning. |
subjectKey | string | Typed fact filter: dotted subject key whose property facts to list; combine with propertyKey or factKind 'subject'. |
tags | array | Optional tag filter. Matches entities that contain any provided tag. Example: ['security','billing']. |
type | string | Optional entity type filter. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'. |
where | object | Named argument values for predicate, using the names from its schema. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_search
Ask the KB a question or search it. Default intent-v1 ranking accepts questions, host-agent semantic facets and changed-code source locations, returns evidence, abstains below its confidence threshold and adds an answer layer: the current requirements that govern the topic with their statement and recorded reason (why), what must stay true (linked facts), the deciding ADRs and what verifies it (scenarios, tests). A weak answer may add queryAnalysis.hints from a search-hints plugin: requirements the question may mean, to re-ask with. Use before changing behavior, then kb_query for exact follow-…
| Parameter | Type | Description |
|---|---|---|
query * | string | Free-text query for metadata and markdown body discovery. Example: 'OAuth login flow'. |
answer | boolean | Intent-v1, first page: when true (default), include the answer layer of governing requirements and their evidence. |
fields | string | Optional result detail: 'summary' (metadata, snippet) or 'full' (also bodies, graph paths, fact kb_query calls). |
hints | boolean | Intent-v1, first page: when true (default), a weak answer adds hints from a kibi.search-hints.v1 plugin. |
kb | string | Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB. |
limit | integer | Optional max rows after ranking. Default: 10; raise it or page with offset when the answer layer is not enough. |
minScore | number | Intent-v1 acceptance threshold between 0 and 1. Low-confidence queries abstain instead of returning misleading matches. |
offset | integer | Optional zero-based pagination offset. Default: 0. |
rankingMode | string | Optional ranking mode: intent-v1 (default, question-aware) or legacy (older lexical ranking). |
semanticFacets | object | Optional host-agent interpretations Kibi uses as deterministic aliases and facets; ranking never calls a model. |
sourceLocations | array | Optional changed-code locations. Results are matched to source-linked symbols/entities and include source evidence. |
type | string | Optional entity type filter to narrow discovery. Example: 'req'. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_status
Report current branch, KB snapshot, freshness metadata, schema status, and a typed kibi.migration-plan.v2 action graph. Call it first to orient on a branch or after a failed call; use kb_check for validation findings and kb_coverage for proof status. Read-only status inspection with no mutation side effects; damaged stores are diagnosed without starting the engine.
| Parameter | Type | Description |
|---|---|---|
kb | string | Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_skills
Read bundled Kibi agent skills (workflow guidance). action:list returns the catalog; action:load returns a skill's metadata, Markdown body, declared resources and content hash (start with id 'kibi-usage'); action:read returns one manifest-declared resource. Read-only; does not require Prolog.
| Parameter | Type | Description |
|---|---|---|
action * | string | list, load (needs id) or read (needs id and resource). |
id | string | Bundled skill ID. Example: 'kibi-usage'. |
resource | string | Manifest-declared resource path to read. Example: 'resources/workflows.md'. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_find_gaps
List KB entities by the relationships they lack or have. Use for questions like which requirements lack scenarios or tests; all filters must match, and a relationship counts in either direction. Use kb_coverage instead for proof status and repair plans, and kb_check for rule violations. No mutation side effects.
| Parameter | Type | Description |
|---|---|---|
kb | string | Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB. |
limit | integer | Maximum rows to return; count reports the full total. |
missingRelationships | array | Relationship types the entity must have none of, e.g. specified_by or verified_by. |
offset | integer | Zero-based row offset for pagination. |
presentRelationships | array | Relationship types the entity must have at least one of each, in either direction. |
sourceFile | string | Keep entities whose source path contains this substring. |
tags | array | Keep entities carrying any of these metadata tags. |
type | string | Only report entities of this type. Omit for all types. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_coverage
Generate curated structural coverage and conservative end-to-end requirement proof reports for requirements, symbols, or grouped types. Use it to ask which requirements are tested end to end, how strong each requirement's evidence is (evidenceLevel: proved, tested, asserted or unverified), and what blocks the rest; use kb_find_gaps for a plain list of missing links and kb_check for rule violations. Reports include the compatible repair plan plus typed kibi.migration-plan.v2 actions; semantic and E2E actions remain review/execution work. Paginated plans identify incomplete scope and no mutation…
| Parameter | Type | Description |
|---|---|---|
by | string | Report shape: req (proof status and repair plan), symbol (ownership coverage) or type (counts per type). |
includeMigrationPreview | boolean | Opt in to a deterministic, read-only kibi.legacy-migration-plan.v1 preview for ready semantic-inventory repair batches. |
includePassing | boolean | Also return rows that are already tested or not applicable. By default only rows that still need repair are returned. |
includeTransitive | boolean | Count symbol coverage reached transitively through linked entities, not only direct links. |
kb | string | Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB. |
limit | integer | Maximum rows to return. When the repair plan reports scope.complete false, rerun with offset 0 and a larger limit. |
migrationLimit | integer | Maximum requirement migration batches to preview. Defaults to one review batch. |
migrationOffset | integer | Zero-based offset into ready semantic-inventory batches. |
migrationPredicateLimit | integer | Maximum exact predicate-schema candidates retained per assertive proposition. |
migrationPredicateMinScore | number | Minimum deterministic predicate-schema rank score retained in migration previews. |
offset | integer | Zero-based row offset for pagination. |
statuses | array | req mode: include only rows whose proofStatus is listed. The summary always covers the whole KB. |
tags | array | Keep rows for entities carrying any of these metadata tags. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_graph
Run bounded graph traversal from one or more seed IDs across curated relationship types and return the nodes and edges reached. Use it to follow links from IDs you already have, such as a requirement to its scenarios and tests or a symbol to the requirements it implements; use kb_query to find entities by filter and kb_search to ask a question. Traversal stops at depth, maxNodes or maxEdges and then sets truncated. No mutation side effects.
| Parameter | Type | Description |
|---|---|---|
seedIds * | array | Entity IDs to start from, for example REQ-... or SCEN-.... Seeds are always returned as nodes. |
depth | integer | Number of hops from the seeds. |
direction | string | outgoing follows links from each node, incoming follows links pointing at it, both does either. |
entityTypes | array | Keep only nodes of these types and the edges between them; traversal still passes through other types. |
kb | string | Optional KB dependency name from .kb/dependencies.json to read, at its pinned commit, instead of this project's KB. |
maxEdges | integer | Stop and set truncated once this many edges are reached. |
maxNodes | integer | Stop and set truncated once this many nodes are reached. |
relationships | array | Relationship types to follow, e.g. specified_by, verified_by or implements. Omit to follow every type. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_model
Turn requirement prose into checkable structure without writing the KB. Use it for one requirement's prose; to plan a whole change request use kb_compile_intent. mode:analyze returns the semantic advisor receipt: the clause ledger, what is grounded, what is ambiguous and suggested modeling (pass clauses for compound prose and optional typed kibi.logic.v1 interpretations). mode:requirement converts one claim (subjectKey, propertyKey, operator, value, or typed logic) into a strict-lane write set and applyPlan. mode:predicates ranks ontology predicate schemas and returns an applicable predicate-f…
| Parameter | Type | Description |
|---|---|---|
mode * | string | analyze (advisor receipt), requirement (strict claim write set) or predicates (ontology predicate plan). |
text * | string | Required prose requirement text to model. Example: 'Customer data must be retained for 7 years.' |
argumentBindings | object | Optional exact predicate argument values keyed by argument name; required when binding_status is incomplete. |
claimKey | string | Optional advisor-issued claim key for the exact proposition represented by logic. |
claimText | string | Optional exact proposition text represented by logic; defaults to text. |
clauses | array | Optional complete list of atomic clauses; each must be a verbatim fragment of text. |
confidence | number | Confidence of the extracted claim: >= 0.70 yields strict-lane output, lower yields observation-only output. |
existingLogicClaims | array | Existing requirement logic_claims values; the update merges the new claim key into them. |
id | string | Optional requirement ID used for deterministic draft relationship guidance. |
includeExistingSchemas | boolean | Whether to include the KB's predicate_schema facts beside the built-in predicate catalog. Default: true. |
interpretations | array | Optional typed kibi.logic.v1 interpretations from the host model; raw Prolog is not accepted. |
logic | object | Optional typed kibi.logic.v1 IR. Kibi validates and canonicalizes it into a rule fact; raw Prolog is rejected. |
maxCandidates | integer | Maximum ranked predicate candidates to return. Default: 5. |
minScore | number | Minimum candidate score. Higher values make ontology-gap fallback more likely. Default: 0.35. |
operator | string | Optional claim operator, e.g. eq, gt, lt; sets take eq, includes, subset_of or excludes; matches takes a regex. |
polarityHint | string | Optional reviewed polarity override when surface negation does not mean predicate denial. |
propertyKey | string | Optional extracted semantic claim propertyKey. Example: 'Retention Years'. |
provenance | string | Optional extracted text reference; falls back to source. Example: '.kb/requirements/customer-retention.md#L1'. |
requirementId | string | Optional requirement ID the strict write set updates instead of minting a REQ-AUTO id. |
schemaId | string | Optional exact reviewed predicate schema ID to use instead of rank order; fails closed if unavailable. |
source | string | Optional primary source path used for stable IDs and text refs. |
sourceFiles | array | Optional related source files. The first value is used as the source fallback when source is omitted. |
status | string | Optional requirement status for draft suggestions. |
subjectHint | string | Optional canonical subject key to use as the first predicate argument. Example: 'editor.annotation'. |
subjectKey | string | Optional extracted semantic claim subjectKey. Example: 'Customer.Data'. |
title | string | Optional requirement title for draft apply plans. |
type | string | Entity type context for analysis; only requirements receive deterministic modeling suggestions. |
value | Optional claim value: string, number, boolean, or a list of strings for a set claim. | |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_upsert
Create or update one entity and its relationships. Use it for modeling, updates and every write kb_record does not take (a newly stated rule is one kb_record call). dryRun:true validates without writing. Model prose with kb_model before hand-writing strict property or predicate facts. An update keeps what it leaves out: send the changed fields (with title and status) and only the links to add. Relationship endpoints must already exist. A requirement that contradicts a current one on the same subject is rejected; to replace it, add a `supersedes` link from the new requirement and upsert the old…
| Parameter | Type | Description |
|---|---|---|
id * | string | Unique entity ID named by the behavior it governs (<TYPE>-<area>-<behavior>); an existing ID updates the entity. |
properties * | object | Entity fields; must include title and status. Fact, symbol, test and proof fields: kibi-usage resource operation-fields. |
type * | string | Entity type to create/update. Allowed: req, scenario, test, adr, flag, event, symbol, fact. Example: 'req'. |
document | object | Optional source document write; omit body on update to keep it. New requirements take statement, Context, Source. |
dryRun | boolean | Validate and preview without writing the KB or workspace; use it as the preflight before the real write. |
implementedBy | array | req only: declarations that implement it, each {sourceFile, symbol, coveredBy?}; linked by implements (and covered_by). |
plannedFacts | array | dryRun only: fact payloads (e.g. kb_model applyPlan entries) staged before this one, so their links resolve. |
relationships | array | Optional relationship rows to create in the same call; asserts edges in the KB. |
why | string | req only: why it exists, in the asker's words. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_record
Record a rule as it is stated: statement, why, saidBy, quote, code and an optional test. Kibi writes it as one kb_upsert payload and returns the commit gate's verdict (commitAllowed, findings with blocks) and the steps left as nextActions. dryRun:true returns the payload and writes nothing. Facts, links, updates and other modeling: kb_upsert.
| Parameter | Type | Description |
|---|---|---|
code * | array | Declarations that implement it, each {file, symbol}. |
saidBy * | string | user or maintainer (firm), or agent (default). |
statement * | string | The rule as one testable must sentence. |
why * | string | Why it exists, in their words; 'Reason not stated' if none given. |
dryRun | boolean | Return the kb_upsert payload; write nothing. |
quote | string | Their words, recorded as origin.ref; a firm rule needs one. |
test | string | An existing TEST id that checks it. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_delete
Delete entities by ID, or exact relationship triples. Use only for intentional removals after dependency checks. Do not use as a bulk cleanup shortcut. An entity authored in a Markdown or YAML source is not deleted directly: the call writes nothing and returns outcome plan_returned with a hash-bound deletionPlan and a nextActions entry holding the exact kb_apply_plan input ({plan, approvedPlanHash}); apply that unmodified, or repeat this call with approvedPlanHash = deletionPlan.planHash to apply the freshly computed plan in one step (a stale or different hash fails with DELETE_PLAN_HASH_MISMA…
| Parameter | Type | Description |
|---|---|---|
approvedPlanHash | string | With ids only: the deletionPlan.planHash a prior call returned; applied only while the hash still matches. |
dryRun | boolean | Preview without writing: returns what a commit would delete and write. |
ids | array | Entity IDs to delete after dependency checks. |
relationships | array | Exact relationship triples to retract, including legacy shard records. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_check
Run KB validation rules and return violations, quality diagnostics, and typed kibi.migration-plan.v2 actions. Use before or after mutations and after source edits; checks remain read-only and never infer or apply actions from prose suggestions.
| Parameter | Type | Description |
|---|---|---|
async | boolean | When true, run as a background job and return a kibi.job.v1 receipt to poll with kb_job_status. |
changed | boolean | When true, give the commit gate's verdict on every current change (commitAllowed, findings with blocks). |
includeImpactDiagnostics | boolean | When true, include changed-file impact diagnostics (granularity, ownership, statements to verify) in the output. |
includeMigrationPlan | boolean | Return the full migrationPlan (for kb_apply_plan) even when the result would show only its summary. |
includeSymbolDebt | boolean | Without rules or sourceFiles: list unrecorded declarations per file (symbolDebt has counts only by default). |
includeWorkingTreeDiff | boolean | When true, inspect unstaged working-tree diffs for impact diagnostics; pair with sourceFiles to scope. |
maxDiagnostics | integer | Optional maximum number of impact diagnostics to return. Graph validation violations are not capped by this value. |
rules | array | Optional rule names (an unknown one is refused with the list). Omit to run every rule plus the full-KB audit. |
sourceFiles | array | Optional repo-relative source files to inspect for impact diagnostics; scopes violations to what they touch. |
staged | boolean | When true, inspect staged source changes for impact diagnostics, as kibi check --staged does. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_review_firm_edit
Record your verdict on a change to code that implements a current firm requirement: keeps (the code still does what it says) or changes. kibi check --staged blocks such a change until each edited symbol has a current keeps receipt. A receipt is your judgment, not the person's approval. staged:true reviews the code and requirement in the Git index, as the commit gate reads them. Side effects: writes .kb/firm-edit-reviews/ files; dryRun:true writes nothing.
| Parameter | Type | Description |
|---|---|---|
reviews * | array | |
dryRun | boolean | |
staged | boolean | |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_prepare_impact_review
Prepare complete content-bound impact-review authoring inputs from the current staged snapshot or explicitly selected immutable Git commits. Use it when kb_check reports that changed files need an impact review; it does not plan KB changes. Returns strict reviewer schemas and an unauthored template; it does not decide, approve, sign, stage, or prove the review.
| Parameter | Type | Description |
|---|---|---|
scope * | {"kind":"staged"} for the staged snapshot, or {"kind":"diff","baseCommit","headCommit"} with full hashes. | |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_plan_bootstrap
Generate a deterministic, snapshot-bound kibi.bootstrap-plan.v1 for repository onboarding. Use it only to onboard a repository whose KB is empty or incomplete (the kibi-bootstrap skill drives it); for a change in an onboarded project use kb_compile_intent. Read-only analysis of the repository plus any declared knowledge sources and cited intent claims returns evidence, bounded context questions, exact dependency-ordered actions, a canonical plan hash, and no mutation side effects.
| Parameter | Type | Description |
|---|---|---|
bootstrapContext | object | Optional declared bootstrap context supplied by the agent to ground the read-only synthesis output. |
entityTypes | array | Optional filter to limit candidate generation to specific entity types. |
includeGenericMarkdown | boolean | Whether to include generic markdown content as candidate facts. Default: true, or false with declared intentClaims. |
maxCandidates | integer | Budget for candidates Kibi discovers itself; declared intentClaims are never capped. Clamped to [1, 200]. Default: 50. |
minConfidence | number | Minimum confidence threshold for candidates. Clamped to [0.60, 0.95]. Default: 0.80. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_compile_intent
Compile complete change intent into a deterministic, snapshot-bound read-only plan. Use it before editing code for a change request that may touch several requirements; use kb_model for one requirement's prose and kb_plan_bootstrap for first-time onboarding. Reuses intent-aware discovery and semantic modeling, accounts for every proposition, reports contradiction witnesses, proposes traceability links, and emits dependency-ordered kb_upsert-style steps only for resolved typed claims. contradictionAnalysis.outcome is no_conflict only when the check could decide: an unmodeled proposition or a re…
| Parameter | Type | Description |
|---|---|---|
intent * | string | Complete post-change normative intent. Send the desired behavior, not a patch fragment. |
mode * | string | Create a new requirement or update an existing one. |
clauses | array | Optional atomic clause decomposition; each clause must be a verbatim fragment of intent. |
conflictReviews | array | Your verdict on each reviewCandidates entry of a previous compile; a conflict verdict blocks the plan. |
context | string | Why the requirement exists and who asked; required for create. Write 'Reason not stated' rather than invent one. |
interpretations | array | Optional host-supplied typed kibi.logic.v1 interpretations; Kibi validates them before including rule steps. |
proposalDecisions | array | Explicit decisions for deterministic traceability proposals. Pending proposals never enter steps. |
requirementId | string | Optional exact requirement ID. Required for an update when automatic selection is below the confidence and margin gates. |
scenarioDrafts | array | Optional scenario drafts. Each is linked requirement -> scenario with specified_by. |
semanticFacets | object | Host-agent facets forwarded to deterministic intent-v1 discovery. |
sourceExcerpt | string | Optional verbatim text the intent came from, quoted in the Source section; requires context. |
sourceLocations | array | Workspace-relative source coordinates used for discovery and before-hash binding. |
sourceReference | string | Optional locator of the source text (ticket id, URL, path) for the Source section; requires context. |
testDrafts | array | Optional test drafts. Tests are attached to scenarios with verified_by; direct req -> test proof links are not emitted. |
title | string | Optional requirement title; existing title is preserved for updates when omitted. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_apply_plan
Apply an explicitly approved kibi.bootstrap-plan.v1, kibi.compile-plan.v1, kibi.migration-plan.v2, or entity-deletion plan after revalidating its canonical hash and live snapshots. Compile plans apply all-or-nothing: a durable journal records every source write and store mutation before the first write, all steps commit in one store transaction, and an interrupted application is completed or rolled back by the next mutating call. Bootstrap actions are dependency-ordered, sequential, source-first, and recoverable from a typed journal.
| Parameter | Type | Description |
|---|---|---|
approvedActionIds | array | Required for migration-plan.v2: the exact action IDs approved for this application. |
approvedPlanHash | string | Exact SHA-256 planHash returned by kb_plan_bootstrap, kb_compile_intent, or another approved plan after human review. |
async | boolean | MCP only: when true, run as a background job and return a kibi.job.v1 receipt to poll with kb_job_status. |
plan | object | The complete bootstrap, compile, migration or hash-bound entity-deletion plan object to apply. |
recoveryJournalId | string | Recovery journal id from a committed_with_repairs result or PLAN_APPLY_RECOVERY_REQUIRED error, to resume. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |
kb_ingest_proof
Ingest a producer-emitted kibi.proof-run.v1 artifact and evaluate it against each selected test's kibi.proof-contract.v1 proof obligations. Revalidates the live workspace snapshot, integration command binding, run-level outcome, attempt history, success policy, and append-only proof-receipt history before deriving and appending idempotent kibi.proof-receipt.v1 receipts. Producers report what happened; Kibi evaluates proof. Prefer `kibi prove` so the configured producer runs automatically; direct ingestion is an integration path for custom producers and agents.
| Parameter | Type | Description |
|---|---|---|
artifact * | object | Producer-emitted kibi.proof-run.v1 artifact, from kibi prove or a direct call; Kibi evaluates the obligations. |
snapshot * | string | Workspace snapshot captured immediately before the run. |
testIds | array | Existing test entities with proof_contract.v1. Omit to evaluate every test contracted to the artifact's integration. |
workspaceRoot | string | Optional absolute path of the workspace this call is about, such as your git worktree, when it is not the server's. |