okf-mcp
MCP server for Open Knowledge Format bundles (OKF v0.3) — expose okf-ingest's deterministic consume verbs as tools any MCP client (Claude Code, Cursor, custom agents) can call.
Existing OKF MCP servers hand agents the markdown files. This one hands them the queryable catalog and concept graph: index-first context assembly, impact/backlink analysis, SQL over frontmatter, drift diffs, and health checks — all deterministic okf-ingest code, no model calls in the server.
There is another package named okf-mcp (Node, on npm, by a different author).
This is the Python one on PyPI.
Tools
| Tool | What the agent gets |
|---|---|
okf_list_bundles |
which bundles this server exposes, with each bundle's own title, description and license (OKF SPEC 8.1). The description says what a bundle covers and when to use it, which is how an agent holding several bundles picks one |
okf_search |
concepts whose title/body match a term; current_only leaves out what is deprecated or has a status outside draft/stable |
okf_get_concept |
one concept's frontmatter + full body |
okf_context |
the flagship — index.md + a concept's most relevant neighborhood as one curated markdown blob, ranked by exact Personalized PageRank over the author's link graph (pass rank='bfs' for plain depth) — or pass query (a free-text question) instead of start for lexical-seeded multi-PPR retrieval. Each concept that is deprecated, draft, stale or unverified carries a one-line note; current_only leaves out what is not current and swaps a deprecated concept for the replacement its superseded_by names, listing what it replaced and excluded |
okf_related |
the k concepts most relevant to a topic — exact PPR, no embeddings |
okf_impact |
inbound / outbound / transitive links — "what breaks if X changes" |
okf_sql |
read-only SELECT over the DuckDB catalog (okf_bundle, okf_concept, okf_link, okf_validation, okf_source, okf_computation) |
okf_diff |
what changed since the server loaded the bundle — on disk for a directory, upstream for a remote bundle — an agent's memory-refresh between looks |
okf_refresh |
reload a bundle after okf_diff shows changes: re-read a directory, or re-fetch a remote bundle into the cache |
okf_doctor |
health score + per-rule findings before trusting a bundle |
okf_computations |
OKF SPEC 10 — the bundle's Attested Computations: the sanctioned way to compute each value, its runtime, its typed parameters, the executor, the receipt fields a run must return, and the attester that checks it. attestable is false when there is no runtime, no attester that resolves, or no computation to be found. Call before computing a number the bundle already defines |
okf_trust |
OKF SPEC 5 — trust tier (unverified / machine-confirmed / human-reviewed, counting only sign-offs made at or after the content last changed), lifecycle status, is_current, superseded_by and stale_after per concept: how much weight to give a concept, and what has gone stale |
Install & run
Built on the official MCP Python SDK v2 (MCP spec 2026-07-28); v2 servers
still answer the legacy initialize handshake, so pre-2026 clients keep
working. For environments pinned to SDK v1, install okf-mcp==0.3.1.
pip install okf-mcp # depends on okf-ingest >= 0.14.1 and mcp >= 2
# one or more bundles: directories, okf-ingest .duckdb catalogs and/or remote
# bundles, optionally named (first one is the default target)
okf-mcp ~/my-bundle
okf-mcp wiki=~/wiki notes=~/vault snapshot=./kb.duckdb
Remote bundles
A bundle can be a git URL or an http(s) tar/zip. After #, say where the
bundle is inside it:
okf-mcp crossplane=https://github.com/jkroepke/okf-crossplane-v2.git#subdir=catalog
okf-mcp kb=https://github.com/org/repo.git#subdir=docs/okf&branch=main
okf-mcp https://example.com/bundle.tar.gz
The bundle is fetched once into a local cache (~/.cache/okf-mcp, or
$OKF_MCP_CACHE, or --cache-dir <dir>) and read from there, so later starts
need no network. okf_diff fetches the source again and reports what changed
upstream without replacing the loaded copy; okf_refresh fetches it again and
loads it; --refresh re-fetches every remote bundle at startup. A fetch that
fails leaves the previous copy in place. Only the sources named on the command
line are ever fetched: no tool lets an agent add one.
A notes vault
Under OKF v0.3 a .md file with no type in its frontmatter is not a concept,
so a vault that was never written as OKF shows nothing. Start the server with
--untyped keep to read those files as concepts anyway:
okf-mcp --untyped keep notes=~/vault
Register with Claude Code:
claude mcp add okf -- okf-mcp ~/my-bundle
Or in any MCP client config:
{ "mcpServers": { "okf": { "command": "okf-mcp", "args": ["wiki=/path/to/bundle"] } } }
Design notes
- Read-only. Directory bundles are ingested into disposable in-memory
DuckDB catalogs at startup;
.duckdbsources open read-only;okf_sqlaccepts SELECT/WITH only. The server never writes to your bundle. The only thing it writes is its own cache of remote bundles. - Lifecycle is annotated by default, filtered on request. A deprecated
concept is still a real link target, and a bundle whose producer writes its
own status words would lose every page to a filter, so
current_onlyis off unless the agent asks for it. - Deterministic. Every tool is plain okf-ingest code — same input, same answer; the only nondeterminism an agent sees is its own.
- Concepts resolve by name.
okf_get_concept/okf_context/okf_impactaccept a path or a wikilink-style name — id, alias, title, or filename stem, compared on alphanumerics ('agent memory architecture' findsops/agent_memory_architecture.md). Ambiguous names return the candidate list instead of guessing. [[wikilinks]]work. Vault-style bundles (Obsidian/Logseq/Foam) resolve by id / alias / title / stem. This is an okf-ingest extension: the OKF spec says wikilinks are not links.
Apache-2.0. Sibling project: okf-ingest (the R + Python ingestion tool this wraps).
Metadata
Release files for okf-mcp 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| okf_mcp-0.6.1.tar.gz | 24.8 kB | Without provenance | Details for okf_mcp-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| okf_mcp-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for okf_mcp-0.6.1-py3-none-any.whl |
Total release size: 44.5 kB
Release files / okf_mcp-0.6.1.tar.gz
| Download URL | okf_mcp-0.6.1.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bc59d6374dde9e6b88a64b4312c5e73c354f917f64a2e47ed5daf50147534c7
|
|
BLAKE2b-256 checksum How to use checksums |
97a7b1f94700952d64ac9cdd7de422efae63fd0d422927f6395e78001782c454
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / okf_mcp-0.6.1-py3-none-any.whl
| Download URL | okf_mcp-0.6.1-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96e6d442454b105e5c5944357b37b852f1c811d98d14b1d57b520ae331501afb
|
|
BLAKE2b-256 checksum How to use checksums |
7758fc6e4920b0396807ca85d0f7cc4bd662cb7bd8cb9edad2eb23601976a710
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for okf-mcp 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.