Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.6.1 instead.

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.0 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; .duckdb sources open read-only; okf_sql accepts 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_only is 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_impact accept a path or a wikilink-style name — id, alias, title, or filename stem, compared on alphanumerics ('agent memory architecture' finds ops/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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for okf-mcp 0.6.0
File Size Uploaded Provenance Actions
okf_mcp-0.6.0.tar.gz 24.6 kB Without provenance Details for okf_mcp-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for okf-mcp 0.6.0
File Interpreter ABI Platform Actions
okf_mcp-0.6.0-py3-none-any.whl Python 3 none any Details for okf_mcp-0.6.0-py3-none-any.whl

Total release size: 44.3 kB

Release files / okf_mcp-0.6.0.tar.gz

Download URL okf_mcp-0.6.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b454704c323a241569e6f277ce57734abcddd292383b778a8118683b9c3ad924
BLAKE2b-256 checksum
How to use checksums
0cf86e1d426f7de1e9a18256c704403940f08ca148239e3002c345e376bfaf92
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.0-py3-none-any.whl

Download URL okf_mcp-0.6.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f903ca1d1902c5d0fd248229c22c4ac353c1811cc53a98906cd93e99c478f8a7
BLAKE2b-256 checksum
How to use checksums
73bd4fd6133d332a1655d08d44520a66db1e208fdca9654ffd6d1ae8da306869
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.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page