Kibi Mcp

io.github.Looted由 GitHub 账号 Looted 发布v3.26.0更新于 Nov 5, 2026

Kibi requirements, traceability, and proof MCP. Install as a project dev dependency.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

Kibi 是项目本地的 MCP 服务器,让助手维护需求、场景、测试与代码链接,并对照代码检索、校验和证明产品意图。

可以做什么
  • 检索知识库中某项行为背后的需求、测试与决策
  • 对照代码所实现的需求审查改动文件,并标出无需求覆盖的新代码
  • 预览并写入需求、场景、测试、事实与符号链接
  • 对已存事实与规则做一致性和矛盾检查
  • 报告需求的覆盖率、证据等级与缺口
适用场景
适用于希望编码助手在写代码的同时维护可追溯需求与端到端证据的仓库,并在实现偏离既定意图时得到提醒。适合已把产品意图放在工单或规格文档中、并希望在代码库中强制执行它的团队。
运行要求
需要 Node.js 22+,并在项目中以开发依赖安装 Kibi 包(kibi-core、kibi-cli、kibi-mcp);服务器通过 npx 启动,工作目录为仓库。Linux x64/arm64 与 macOS 自带 SWI-Prolog,其他平台需自行安装 SWI-Prolog 9.0+ 并加入 PATH。初始化会创建 .kb/ 目录并安装 Git 钩子。
安装前请注意
安装会写入仓库:.kb/ 目录、Git 钩子、AGENTS.md 中的一节以及 prepare 步骤,且不会自行推断产品知识。对知识库的写入应先预览再批准。除非通过 kibi telemetry disable、KIBI_TELEMETRY=0 或 DO_NOT_TRACK=1 关闭,否则会发送匿名使用统计。处于 beta 阶段,接口可能变化,重视可复现性时应锁定版本。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Kibi Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Kibi Wordmark]

[Status: Beta] [CI] [Coverage] [Kibi requirement health] [License: AGPL-3.0-or-later] [Glama MCP server] [X @kibi_dev]

Prompt the intent. Kibi makes the agent remember it—and prove the implementation.

[Animated terminal: Kibi refuses a contradicting requirement, flags an impossible scenario, an unproven requirement and untraced code, answers a knowledge-base search, and reminds the agent of a requirement before an edit]

Simplified from what Kibi reports in each case.

Kibi is an agent-native requirements compiler and enforcement layer. You describe product intent in natural language; the agent creates and maintains the structured requirements, scenarios, tests, semantic facts, and code links. Kibi then checks that the implementation remains coherent with that intent.

Unlike passive memory or retrieval systems, Kibi is designed to place itself in the agent's workflow. The agent does not have to remember to consult a ticket, board, or requirements folder: Kibi's hooks, tools, and validation gates continuously bring the relevant product context back into the work.

Documentation · Quick start · Kibi's own health report

Why Kibi

Most project knowledge is scattered across prompts, tickets, code, and conversations—and most AI agents eventually forget part of it. Kibi turns that knowledge into an enforceable, branch-local model:

  • Humans maintain intent, not artifacts — The prompt is the primary authoring interface. Agents own the routine work of creating and evolving requirements, scenarios, tests, facts, and symbol links; humans resolve genuine ambiguity and product decisions.
  • Memory is enforceable — Symbols need requirement ownership, requirements need complete semantics and scenarios, scenarios need tests, and proof-bearing tests need fresh execution evidence.
  • Prolog guards against drift — Typed properties, predicates, and safe rules let deterministic checks expose contradictions, unsupported invention, and incomplete semantics before they become accepted project knowledge.
  • E2E behavior is traceable — Kibi records what an end-to-end test proves, not merely which lines it happened to execute. You can navigate from a symbol to its requirement or from a test to the scenario and intent it verifies.
  • Intent survives branch changes — Each Git branch has its own KB snapshot, so feature context stays isolated and is there when you return.
  • Works across languages — TypeScript and JavaScript symbols are built in. The optional kibi-plugin-treesitter adds offline symbol extraction for Python, Go, Rust, Java, C#, PHP, C, C++, Bash, Ruby, SWI-Prolog, and Terraform/HCL using pinned WASM grammars. Each language installs as a small kibi-lang-* grammar pack (kibi-lang-python, kibi-lang-go, kibi-lang-prolog, ...), and kibi doctor names the ones a repository needs: generated files count only when the KB uses them, and any pack can be declined in kibi.declinedLanguagePacks. Generated code (linguist-generated, a generator header, or kibi.generatedPaths globs) also needs no requirement links in the commit gate unless the KB tracks it. Code and source proofs read TypeScript, JavaScript, Python and SWI-Prolog, so a Prolog project can prove its claims against its own predicates, imports, calls and pack.pl. With the plugin active for proofs, source proofs also read what Go, Java, C#, Rust, PHP, C and Bash files import, call and read from the environment, and the property values of PHP, C and Terraform/HCL files, without compiling or running them.
  • Optional UI design guard (experimental) — kibi-plugin-ui keeps React and Angular components on their agreed design patterns. Pixels, colours and spacing stay with your linter.
  • Questions in your own words (optional) — kibi-plugin-search-hints suggests which requirements a weakly answered kb_search question probably means, by meaning rather than shared words, with a small offline model.
  • Keep knowledge local — KB state lives in your repository's .kb/ directory and is never sent anywhere. The Kibi packages send anonymous usage statistics, which you can turn off (see Usage telemetry); the documentation website counts visits with cookieless Umami analytics.

Quick start

Kibi is meant to be set up and driven by your coding agent, so the recommended install is a prompt rather than a list of commands. Kibi requires Node.js 22+. SWI-Prolog is bundled: on Linux (x64 or arm64, glibc 2.28+) and macOS (Apple silicon or Intel) there is nothing else to install. On other platforms, such as Alpine/musl or native Windows (use WSL), install SWI-Prolog 9.0+ and put swipl on your PATH (details).

Recommended: let your agent set it up. Paste this into Claude Code, Cursor, Codex, OpenCode, or any coding agent that can run commands in your repository:

prompt
Set up Kibi (https://github.com/Looted/kibi) in this repository, then bootstrap its knowledge base.
1. Install: confirm Node.js 22+ is available. With the package manager this repository already uses, add kibi-core, kibi-cli and kibi-mcp as dev dependencies. Do not skip optional dependencies; the bundled SWI-Prolog runtime is one.2. Initialize: run every `kibi` command through the package manager's local runner (npm: `npm exec -- kibi <command>`). Run `kibi init`; if it reports a problem, run `kibi doctor` and fix what it names. If this platform has no bundled SWI-Prolog, tell me what to install and stop.3. Connect: register the project-local `kibi-mcp` server for the agent host you are running in, following https://looted.github.io/kibi/guide/connect-an-agent.html. Prefer project-scoped configuration, and ask me before installing a plugin or changing global settings. Until the kb_* tools are visible to you, use Kibi's CLI JSON routes instead.4. Bootstrap: run `kibi skills load kibi-bootstrap --format markdown` and follow that skill exactly. It starts by asking me where product intent lives outside the code (issue trackers, wikis, specs) and which sources to trust; read them through the connectors you have and cite them. Show me the complete plan and its hash, and write nothing until I approve it.5. Verify: run `kibi check` and `kibi status`, fix anything they report, and summarize what was added. Do not commit; I will review the changes.

What happens next:

  1. Setup. The agent installs the packages, runs kibi init, and connects itself to Kibi.
  2. Interview. It asks where your product intent already lives (issue trackers such as Jira or YouTrack, wikis, specs) and which of those sources to trust.
  3. Plan. It reads those sources through the connectors it has and drafts a bootstrap plan. Every requirement in the plan cites the ticket or page it came from. Open questions and conflicts it finds between sources are flagged for you rather than turned into requirements.
  4. Your approval. It shows you the plan and its hash. Nothing is written until you approve.
  5. Apply and check. It applies the plan, validates the result, then fills in what the plan could not write, such as scenarios from acceptance criteria and machine-checkable facts for the new requirements. It tells you what it added.

After that, work normally: prompt for features, fixes, and refactors, and the agent keeps requirements, scenarios, tests, and code links in step with the code.

Manual installation

In your repository:

bash
npm install --save-dev kibi-core kibi-cli kibi-mcpnpm exec -- kibi init

kibi init creates the .kb/ layout and installs the Git hooks that keep it in sync. It never overwrites a hook it did not write; with lefthook, husky or the pre-commit framework it installs none and prints the configuration to add instead. It does not infer product knowledge. So that a fresh clone (a teammate's, a cloud agent's) uses Kibi too, it also writes a Kibi section into AGENTS.md (imported from CLAUDE.md) that tells any agent the knowledge base exists, and adds a prepare step that installs the hooks when dependencies are installed; the first Kibi query in a clone compiles the branch's store from the committed knowledge. Each of these can be turned off (setup choices). Connect your coding agent, then ask it:

Bootstrap Kibi for this repository.

pnpm, Yarn, and Bun work the same way through their local runners. The installation guide has their equivalents, how Kibi finds SWI-Prolog, and package-manager caveats. npm exec -- kibi doctor tells you whether everything is in place.

Upgrading. After updating the Kibi packages, run kibi migrate (or ask your agent to). It shows what would change and applies nothing until you approve; the CLI reference covers each schema version.

Versions. Each release has one Kibi release version, such as 2026.11.0, that names its exact package set and declares the KB schema it uses. kibi --version and kibi doctor show it, and doctor warns when installed packages come from different releases. When a newer kibi-cli is out, the CLI says so in one stderr line at a terminal (checked at most daily in the background, silent in CI, JSON output and agent runs, off with KIBI_UPDATE_CHECK=0), and kibi doctor reports it for every host. See Kibi release versions.

Connect your coding agent

The setup prompt above does this step for you. To do it by hand: every client starts the same project-local kibi-mcp server (npx --no-install kibi-mcp, stdio, working directory = your repository). Optional plugins add bundled skills and hooks on top.

Claude Code

Install the optional kibi-claude plugin from this repository's marketplace. It brings the MCP server, the bundled skills, and hooks that show the agent the linked requirements, what they must keep true, and the decision behind them before it reads or edits code, including through shell commands. The agent connection guide has the details:

bash
claude plugin marketplace add Looted/kibi
bash
claude plugin install kibi-claude@kibi

Without the plugin, register the server for the project:

bash
claude mcp add --scope project kibi -- npx --no-install kibi-mcp
Cursor

Add Kibi to .cursor/mcp.json:

json
{  "mcpServers": {    "kibi": {      "command": "npx",      "args": ["--no-install", "kibi-mcp"]    }  }}

The optional kibi-cursor plugin adds rules, bundled skills, commands, and advisory hooks that show the same requirement context as the Claude Code plugin before reads and edits of linked code. See the Cursor plugin guide.

Codex
bash
codex mcp add kibi -- npx --no-install kibi-mcp

The optional kibi-codex plugin bundles Kibi skills, MCP configuration, and warning-only hooks that bring the linked requirement into the agent's context before it changes code. Add the Kibi repository marketplace, open Codex, then run /plugins, choose Kibi Plugins, and install kibi-codex:

bash
codex plugin marketplace add Looted/kibi

The repository marketplace is not the official OpenAI Plugin Directory; self-serve plugin publishing is not available there yet. Manual MCP configuration remains fully supported.

OpenCode

Add Kibi to opencode.json. The optional kibi-opencode plugin adds prompt guidance (including what a requirement linked to the file being edited must keep true) and background maintenance:

json
{  "mcp": {    "kibi": {      "type": "local",      "enabled": true,      "command": ["npx", "--no-install", "kibi-mcp"]    }  },  "plugin": ["kibi-opencode"]}
VS Code

Add Kibi to .vscode/mcp.json:

json
{  "servers": {    "kibi": {      "type": "stdio",      "command": "npx",      "args": ["--no-install", "kibi-mcp"]    }  }}
ZCode and other MCP clients

Any stdio MCP client works with command: npx, args: --no-install kibi-mcp. ZCode also has an optional plugin, installed from a local checkout, whose edit hook shows the same requirement context as the Claude Code plugin; see the ZCode plugin guide. Agents without MCP can use the same operations through the CLI's JSON routes.

What your agent gets

Kibi's skill subsystem gives the agent seven bundled skills that teach it how to work with Kibi (including kibi-provable-code, on writing code whose rules Kibi can prove), so you do not paste a long system prompt, and a small set of MCP tools does the rest:

  • Plain-language answers. Ask "what governs checkout rounding?" and kb_search returns the current requirements, the tests and decisions behind them, and what Kibi's checks say about each.
  • A review of every change. kb_check on the files the agent touched quotes the requirements that code implements and flags new code no requirement covers.
  • Safe writes. Every write can be previewed first, and a plan you approve lands in full or not at all.

The MCP reference lists every tool. Generic agents can start from agent onboarding.

See how strong each guarantee is

bash
npm exec -- kibi report --open

kibi report writes a self-contained kibi-report/index.html and kibi-report/badge.svg from one coverage snapshot. % tested is the share of current requirements with fresh end-to-end evidence on the current code; the report lists what is tested, what is missing evidence, what contradicts, and what has gone stale.

Every requirement also carries an evidence level, so no guarantee reads stronger than what backs it: proved (every claim of the requirement holds for every case, backed by fresh certificates from an exhaustive, typecheck, arithmetic, smt, rule, state_machine, regex or source proof contract that names the claim, which a separate checker re-checks; claims need not be numbers: permission rules, every-member properties, state transitions, states that can never be reached, required fields and string formats are decided exactly against the code, and a source proof checks routes, database schemas, configuration, validators and code references that Kibi reads from the project itself), tested (fresh end-to-end receipts cover every linked scenario), asserted (a person stands behind it, but nothing current checks it) and unverified (an agent wrote it and no person approved it). kibi coverage returns evidenceLevel per requirement and summary.evidenceLevels counts; the report and kibi signoff show it next to firmness. See the proof ladder, proving requirements for the certificate proof kinds, and reading the report.

The knowledge base itself is checked the same way. kibi check (and kb_check for agents) proves that the facts your requirements state are consistent (one value satisfies every fact on a property, every decision has one outcome) and that stored rules are stratified, and leaves a certificate for each answer that a small separate checker re-checks. It also catches facts that contradict only together, which pairwise checks miss. A contradiction comes back as the smallest set of facts that cannot hold at once; anything it cannot compare is reported as unresolved, never as consistent.

Before you sign off on a change, kibi signoff shows the requirements it adds, rewrites or affects, each quoted with its firmness, proof state and evidence level, and kibi signoff --questions numbers the decisions waiting for you next to the rule each one would change. Agents put the view in their reply as plain Markdown, so it renders wherever the agent writes, including chat apps and cloud sessions where replies go through a messaging tool; the same view is a self-contained page in .kb/briefs/signoff/latest.html. Claude Code, Cursor, ZCode and OpenCode add a /kibi-signoff command, OpenCode draws the view as a card, VS Code opens it in a panel, and the agent hooks ask for it once a session has written requirements.

To publish the report and a clickable badge on GitHub Pages, run npm exec -- kibi init --github, then enable Settings → Pages → Source → GitHub Actions. The GitHub integration guide covers the report workflow, badge-only publishing, and a CI step that keeps pull requests mergeable when only Kibi's own files conflict. Symbol line positions are never committed: every kibi sync derives them into a gitignored cache, so two branches that edit the same source file do not conflict over them.

For day-to-day inspection, kibi status, kibi search, kibi gaps, kibi coverage, and kibi check are in the CLI reference.

How it works

Kibi combines probabilistic interpretation with deterministic verification:

text
Human prompt    |    vAgent updates code and product knowledge    |    vRequirements + semantic facts/rules + scenarios + tests + symbol links    |    vProlog coherence checks + traceability gates + fresh E2E evidence    |    vTested result or explicit, repairable gaps

The agent never writes arbitrary Prolog as trusted truth. It works through typed facts, predicate schemas, and safe logic representations; Kibi validates those encodings before the Prolog layer uses them for inference.

What Kibi enforces

Kibi maintains a canonical traceability and proof chain:

text
Requirement -> Scenario -> Test     ^                       ^     |                       | Production symbol     Executable test symbol

For a requirement to be tested end to end rather than merely documented:

  • Every production symbol must trace to the requirement it implements.
  • Every normative requirement clause must be modeled as typed facts or stay explicitly unresolved.
  • Requirements must be specified by scenarios, and tests must verify those scenarios. A success scenario that assumes something a current requirement forbids blocks proof.
  • Executable test symbols must identify the code that actually performs the verification.
  • Proof-bearing production symbols must be covered by qualifying tests, and the pre-commit hook applies the same rule as the full check.
  • End-to-end evidence must be fresh and bound to the current code snapshot, so CI and a local checkout of the same commit agree.

That makes questions answerable in both directions: which requirement owns this symbol, what this E2E test actually verifies, which requirements lack a scenario or current evidence, and whether two current requirements contradict each other. Code coverage alone cannot answer them: it shows that a test touched a line, not which product behavior was exercised.

Prolog as the safety layer

Suppose the product defines exactly three user roles. Once that constraint is encoded as a strict property or predicate, an agent cannot quietly invent a fourth role and treat it as established intent: Kibi can surface the contradiction or missing authorization deterministically.

Kibi does not report "no conflict" when it could not tell. Numeric constraints are compared exactly ("greater than 0" conflicts with "equals 0"), an allow and a deny for the same action contradict, and anything Kibi cannot model is reported as unresolved for the agent to review, never as a clean pass.

Prolog does not decide whether the original human intent was correct. It verifies the knowledge that was encoded, while Kibi keeps ambiguity, missing ontology, incomplete grounding, and stale evidence explicit instead of calling them proof.

Why this is possible now

Traditional knowledge bases required specialists to design ontologies, write formal logic, and maintain every mapping by hand. LLMs change the economics of that authoring step, and Kibi and Prolog supply the discipline:

ParticipantStrength and responsibility
HumanStates product intent and resolves real ambiguity or policy choices
AI agentMaps intent to the codebase and maintains requirements, scenarios, tests, facts, and symbol links
Kibi + PrologValidates schemas, checks coherence and contradictions, enforces traceability, and evaluates proof evidence

The result uses LLM strengths to address LLM weaknesses: limited memory, hallucination, context drift, and the loss of the product-to-code mapping traditionally spread across product owners, ticket systems, and planning boards.

What Kibi models

Eight entity types: req, scenario, test, fact, adr, flag, event, and symbol. The entity schema has the complete model.

Every entity records who authored it, a person or an agent, and advisory checks list agent-written requirements no person has approved.

Requirements and ADRs also say how firmly they were decided. A firm rule is one a person stated: it points at their words, the agent asks before changing it, and Kibi refuses to rewrite it quietly. A default choice can be revisited on evidence, and exploratory marks a guess. Every supersede has to say why it changed. How Kibi works has the details.

Packages

Install kibi-core, kibi-cli, and kibi-mcp in the project. Everything else is optional.

PackageRole
kibi-coreProlog-backed knowledge graph, inference, and validation
kibi-cliHuman, agent, automation, and Git-hook interface
kibi-mcpMCP surface exposing the public Kibi operation contracts
kibi-claudeClaude Code skills, MCP, requirement context before reads/edits, and advisory hooks (plugin marketplace)
kibi-cursorCursor rules, skills, MCP, requirement context before reads/edits, and advisory hooks
kibi-codexCodex skills, MCP, requirement context before edits, and lifecycle hooks
kibi-opencodeOpenCode guidance (including requirement context for edits) and background maintenance
kibi-zcodeZCode skills, command, MCP, requirement context before edits, and advisory hooks (local checkout)
kibi-vscodeVS Code knowledge explorer and traceability view
kibi-plugin-sdkProtocol types and validators for capability plugins
kibi-plugin-builtinDefault semantic, ontology, and TypeScript symbol capabilities
kibi-plugin-jevOptional TypeSafe Jev semantic classifier
kibi-plugin-treesitterOptional offline multi-language symbol extraction (tree-sitter queries; each grammar is a kibi-lang-* pack)
kibi-lang-*Data-only grammar packs for kibi-plugin-treesitter: python, go, rust, java, csharp, php, c, cpp, bash, ruby, hcl, prolog
kibi-plugin-uiExperimental check policy keeping UI components on their agreed design patterns
kibi-plugin-search-hintsOptional offline meaning-based hints for weak kb_search answers
kibi-swiplBundled SWI-Prolog runtime; the matching platform build installs automatically

Documentation

The guide and reference are published at https://looted.github.io/kibi/. Language models can start from the documentation index.

Beta status

Kibi is in beta and ready for use in real projects. Public interfaces may still evolve before 1.0, so pin exact package versions when reproducibility matters.

Kibi sends anonymous usage statistics (operation names, durations, error categories and versions, never code, paths, queries or KB content) to help prioritize fixes. Turn them off with kibi telemetry disable, KIBI_TELEMETRY=0 or DO_NOT_TRACK=1; see Usage telemetry.

Kibi is licensed under AGPL-3.0-or-later.

来源:README.md,提交 f10e5e7

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

38
  1. v3.26.0最新Nov 5, 2026
  2. v3.25.0Nov 3, 2026
  3. v3.24.0Nov 3, 2026
  4. v3.23.0Oct 30, 2026
  5. v3.22.0Oct 30, 2026
  6. v3.21.0Oct 29, 2026
  7. v3.18.0Oct 26, 2026
  8. v3.17.0Oct 23, 2026
  9. v3.16.3Oct 23, 2026
  10. v3.16.2Oct 20, 2026
  11. v3.16.1Oct 20, 2026
  12. v3.16.0Oct 16, 2026
  13. v3.15.0Oct 16, 2026
  14. v3.14.3Oct 15, 2026
  15. v3.14.2Oct 14, 2026
  16. v3.14.1Oct 14, 2026
  17. v3.11.0Oct 13, 2026
  18. v3.10.0Oct 13, 2026
  19. v3.9.2Oct 13, 2026
  20. v3.9.1Oct 12, 2026
  21. v3.9.0Oct 12, 2026
  22. v3.7.0Oct 11, 2026
  23. v3.6.3Oct 11, 2026
  24. v3.6.2Oct 10, 2026
  25. v3.6.1Oct 10, 2026
  26. v3.6.0Oct 9, 2026
  27. v3.5.4Oct 9, 2026
  28. v3.5.3Oct 9, 2026
  29. v3.5.2Oct 8, 2026
  30. v3.5.0Oct 8, 2026
  31. v3.4.0Oct 7, 2026
  32. v3.2.0Oct 7, 2026
  33. v3.1.1Oct 6, 2026
  34. v3.0.2Oct 6, 2026
  35. v3.0.0Oct 5, 2026
  36. v2.4.0Oct 3, 2026
  37. v2.3.0Oct 1, 2026
  38. v2.2.0Sep 30, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分