docs

  meerkat · knows

meerkat — CLI & integrations

The full mk command surface, plus how to expose the knowledge base to agents over MCP and to web tools over HTTP.

The CLI

Every subcommand works under both meerkat and mk. Page IDs are slash-paths from the wiki root without the .md extension (e.g. concepts/Rate-Limiting).

CommandDescriptionExample
searchFull-text BM25 search over the served wiki.mk search "rate limiting" --limit 20
showPrint a single wiki page (raw markdown).mk show concepts/Rate-Limiting
listList pages, filtered by prefix/category/status/owner/type.mk list --prefix systems/backend/
mcp serveRun the MCP server over stdio.mk mcp serve
http serveRun the HTTP/OpenAPI server with bearer auth.mk http serve --port 4004
ingestPlan (and with --execute, run) ingestion.mk ingest --source policies --execute
ingest sourcesPrint the ingestion source registry.mk ingest sources --json
updateCheck for / install meerkat updates.mk update --check
versionPrint version info and content provenance.mk version --json

Global flags

These apply to every subcommand and select which knowledge base is served. They are resolved once, before the subcommand runs.

FlagEffect
--kb-dir stringServe content from a directory in the content-repo layout. Wins over everything else.
--content-source stringPath to a content-source.yaml. A nonexistent path is a hard error.

Search flags

FlagEffect
--limit intMax hits (default 10, server-clamped to 100).
--bodyPrint the full body of each hit.
--jsonMachine-readable output.
terminalbash
mk search "exact phrase"     # phrase match
mk search +cache -queue      # must / must-not
mk search title:eviction     # field-targeted

List filters

Filters compose with AND, and are applied to frontmatter after loading — they are not query terms.

FlagEffect
--prefix stringPage IDs starting with this prefix.
--category stringFrontmatter category.
--status stringFrontmatter status. Free string — meerkat and OKF vocabularies both pass through untranslated.
--owner stringFrontmatter owner.
--type stringFrontmatter type — OKF's concept-kind field, e.g. "BigQuery Table".

show --json carries trust metadata

mk show <id> --json returns trust_tier and stale as top-level siblings of front — not fields inside it. Both are computed on read, never stored. See OKF bundles.

OpenCode (MCP over stdio)

Register meerkat as a local MCP server and your agent gains three tools on every prompt — mk_search, mk_show, and mk_list.

~/.config/opencode/opencode.jsonjson
{
  "mcp": {
    "meerkat": {
      "type": "local",
      "command": ["mk", "mcp", "serve"],
      "enabled": true
    }
  }
}

Search, then show

The recommended agent pattern is mk_search first (the snippet triages which page), then mk_show on the winner — it keeps the context window lean.

ToolParametersReturns
mk_searchquery (required), limitid, title, category, status, score, snippet
mk_showid (required)id, path, title, body, front, trust_tier, stale
mk_listprefix, category, status, owner, typeid, title, category, status, owner, type, source

All three are annotated read-only, idempotent, and closed-world, so a harness can call them without a confirmation prompt.

OpenWebUI (HTTP / OpenAPI)

Serve the knowledge base over HTTP with a bearer token, then point OpenWebUI at the OpenAPI schema. The default bind is loopback.

terminalbash
export MEERKAT_API_KEY=$(openssl rand -hex 32)
mk http serve --port 4004               # binds 127.0.0.1 by default
curl -sS http://127.0.0.1:4004/healthz
MethodPathAuth
POST/searchBearer
POST/showBearer
POST/listBearer
GET/openapi.jsonnone
GET/healthznone
GET/none

Auth is deny-by-default: anything not explicitly public requires the bearer token, so an unmatched path returns 401 rather than 404. The server refuses to start without a key (no anonymous mode); the key is compared in constant time. /healthz and /openapi.json are exempt so probes and tool registration work without it.

Put a reverse proxy in front of it

meerkat serves plain HTTP and terminates no TLS of its own. To reach it from another host, front it with a reverse proxy that terminates TLS rather than binding it to 0.0.0.0 directly.

POST /list accepts the same type filter as the CLI, and POST /show returns trust_tier and stale alongside the page. POST /search is unchanged.

Environment variables

VariableEffect
MEERKAT_KB_DIRContent directory to serve (the --kb-dir flag wins over it).
MEERKAT_CONTENT_SOURCEPath to a content-source.yaml (the --content-source flag wins over it).
MEERKAT_API_KEYBearer token for mk http serve (env wins over --api-key).
MEERKAT_NO_UPDATE_CHECK=1Silence the post-run "newer release available" check.

Authoritative reference, generated from the component repos. Spot something stale? Tell us.