Skip to content

MCP tools

knomit is MCP-native. A peer connects over the Model Context Protocol and gets a small, sharp tool set whose descriptions carry all the behavioral guidance the model needs — no prompt scaffolding required.

ToolWhat it does
knomit_learnWrite one or more facts to the knowledge base in a single commit. Deduplicates within a category automatically.
knomit_querySearch by free text, entity, domain, path, or confidence threshold. sort=recent browses by recency; results are paginated.
knomit_explainTraverse a fact’s versioned provenance graph via its refs (paginated BFS), anchored at a commit or at HEAD.
knomit_updateRevise an existing fact’s fields.
knomit_retractRemove a fact. Git history retains the provenance.
knomit_reviewInteractive session to review and maintain the knowledge base (prune, distill, reflect).
knomit_hypothesizeGenerate falsifiable hypotheses from synthesis facts.

The MCP endpoint is branch-scoped — each agent reads and writes its own branch:

POST /api/v1/repos/{repo}/branches/{branch}/mcp?profile={code|chat|generic}

The agent branch is logged on startup (branch=agent/hostname-abc123) and is also available via GET /api/v1/repos/{repo} (the agent_branch field). Branch names use : in place of / in URL path segments (e.g. agent:hostname-abc123).

There are exactly three MCP server instances, one per profile, shared across all repos; each tool handler resolves the target repo/branch from the request context. The profile changes only the instructions sent to the calling model — the same seven tools are registered in every profile:

ProfileDefault forInstruction emphasis
codesoftware development (the bridge default)structured technical knowledge: architecture, API contracts, debugging, conventions; reference source in refs
chatconversational useinsights, preferences, decisions; natural-language bodies; conservative confidence
genericgeneral knowledgeany domain; descriptive tags; self-contained bodies

Per-session instructions are computed from the repo’s ontology via an AfterInitialize hook, so the model is told the exact topics and categories that repo accepts.

stdio-only MCP clients (Claude Code, Claude Desktop, Claude Cowork, VS Code, Cursor, …) use knomit-bridge, the stdio↔HTTP adapter built by make build. It auto-discovers the agent branch from the running server, so you never look it up by hand:

{
"mcpServers": {
"knomit": {
"command": "dist/knomit-bridge",
"args": ["--repo", "trunk", "--source", "trunk", "--profile", "code"]
}
}
}

See the Quick start for the full connection walkthrough and the streamable-HTTP alternative, and the CLI reference for every bridge flag.

Write one or more facts in a single git commit.

ParamTypeReqDefaultNotes
moment_namestringShort label for this learning moment (becomes part of the commit)
factsarrayOne or more fact objects (below)

Each fact object:

FieldTypeReqDefaultNotes
topicstringTop-level ontology topic
categorystringCategory path within the topic (e.g. languages/go/concurrency)
titlestringShort descriptive title
bodystringFact body, natural language
kindstringepistemicepistemic (descriptive) or pragmatic (prescriptive)
typestringobservationLeaf type — depends on kind (see below)
domainstring[]Cross-cutting domain tags
entitiesstring[]Entities the fact mentions
confidencenumber0.70.0–1.0
sourcesinteger1Independent sources
refsstring[]External URLs or source refs

Types — epistemic: observation, concept, process, principle, pattern, reference, synthesis, insight, hypothesis, methodology. Pragmatic: policy, heuristic. A single batch may not mix observed types with inferred types (hypothesis / methodology).

Returns lightweight rows (title, type, domain, score, ~400-char snippet) — not full bodies. Paginated via an opaque cursor. At least one of text, entities, domain, applies_to, path, type, origin, or min_confidence is required (unless paging with cursor, or using sort=recent).

ParamTypeNotes
textstringFull-text / semantic query
entitiesstring[]All must be present (AND)
domainstring[]Domain tags
applies_tostring[]Ancestor-or-equal domain match (scope includes these)
domain_exactboolExact canonical tag match only (default false)
pathstringPath prefix
typestring[]Filter to epistemic types
originstring[]authored · distilled · discovered
min_confidencenumber0–1
min_similaritynumberCosine floor for text search; 0 = model’s calibrated recall floor
sortstringrelevance (default) or recent (browse, needs no other filter)
limitnumberDefault 20, max 100 (snippet mode); 3/5 with include_body
include_bodyboolFull bodies (small pages only)
cursorstringPage token; freezes filters

Explains a fact by walking its versioned provenance graph, anchored at a commit. The root fact is returned in full (with revision history); every referenced fact is returned as a lean summary read at the exact version the referrer pointed to. Summaries may be flagged deleted (retracted since) or superseded (newer at HEAD).

ParamTypeReqNotes
filestringFact path (e.g. kb/technology/go/abc123.md)
commitstringAnchor commit; omit for HEAD. Drill into a summary by re-calling with its path + commit
cursorstringSession id to page the walk
ParamTypeReqNotes
filestringFact path
moment_namestringLabel for the update
updatesobjectOnly the fields to change

updates fields: title, body, kind, type, confidence, sources, domain (replaces), entities (replaces), refs (appended, not replaced).

ParamTypeReqNotes
filestringFact path to retract
moment_namestringLabel for the retraction

Retraction is a commit, not a hard delete — the fact remains in history and resolves under commit-anchored reads (e.g. ?fallback=before).

Prune redundant facts, distill clusters into synthesis facts, and reflect on hypothesis transitions to record methodology. Does not generate new hypotheses. A session loop: call with no args to start, then with session_id + response (your JSON decisions for the previous work item) to continue. See Synthesis & hypotheses and Emergent discovery.

ParamTypeNotes
session_idstringOmit to start a new session
responsestringJSON decisions for the previous work item
effortstringnormal (default) · medium · high — medium/high engage the bridge discovery engine
domainstring[]Scope filter on the seed pool (empty = whole corpus)
entitiesstring[]Scope filter on the seed pool

knomit_hypothesize — generate predictions

Section titled “knomit_hypothesize — generate predictions”

Generate new hypothesis facts from synthesis facts on the agent branch. Distinct from review and only to be invoked on explicit user request (never as an auto-follow-up). Per work item the model decides whether to write a hypothesis; skipping is the expected outcome for most.

ParamTypeNotes
session_idstringOmit to start
responsestringAcknowledgement for the previous work item
effortstringnormal (default) · medium · high — medium/high engage the backward (keystone) bridge engine
domainstring[]Scope filter (empty = whole corpus)
entitiesstring[]Scope filter