Skip to main content

okf-mcp

MCP server for Open Knowledge Format bundles — 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.

Tools

Tool What the agent gets
okf_list_bundles which bundles this server exposes
okf_search concepts whose title/body match a term
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
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_concept, okf_link, okf_validation)
okf_diff what changed on disk since the server loaded the bundle — an agent's memory-refresh between looks
okf_refresh re-ingest a directory bundle after okf_diff shows changes
okf_doctor health score + per-rule findings before trusting a bundle
okf_computations OKF v0.2 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. Call before computing a number the bundle already defines
okf_trust OKF v0.2 SPEC 5 — trust tier (unverified / machine-confirmed / human-reviewed), lifecycle status, 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.9.0 and mcp >= 2

# one or more bundles: directories and/or okf-ingest .duckdb catalogs,
# optionally named (first one is the default target)
okf-mcp ~/my-bundle
okf-mcp wiki=~/wiki notes=~/vault snapshot=./kb.duckdb

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.
  • 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, same as okf-ingest 0.6.0+.

Apache-2.0. Sibling project: okf-ingest (the R + Python ingestion tool this wraps).

Metadata

Release files for okf-mcp 0.5.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.5.0
File Size Uploaded
okf_mcp-0.5.0.tar.gz 16.7 kB Details

Built distribution (wheel)

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

Total release size: 31.5 kB

Release files / okf_mcp-0.5.0.tar.gz

Download URL okf_mcp-0.5.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
70447cc3f0d499f65fa2667d9d115dfd3ee9f293059ddc3abbf1d3a7ce29e7ec
BLAKE2b-256 checksum
How to use checksums
7b5c458ec778b78210c38a87c2fc9f6b5f2a25b14c7a23d286686dc85696726c
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.5.0-py3-none-any.whl

Download URL okf_mcp-0.5.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab3491da4fc6af9aab8bbebc29197f8909aecd7961285b3925220417658d8aed
BLAKE2b-256 checksum
How to use checksums
aa9f57b386d2d9876afa64517608e22e6003f04a34c41983eb35d44cdf4c945a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

0.5.1

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.1.0

2 release files

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