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

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).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

okf_mcp-0.4.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

okf_mcp-0.4.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file okf_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: okf_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for okf_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 960a7d6becbc538a88ff0306cb6a60eaf5804fdb376ee74e25740039b7ffc965
MD5 6eb0e5c9a13d368a7db2351aaa7c44d9
BLAKE2b-256 f3e2e6b3491b210db6f47cb1569f811e1575d326a0b9d1a2862b2469f4687aef

See more details on using hashes here.

File details

Details for the file okf_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: okf_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for okf_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 701be963b324df2718956a5fada62109f90bd00cc80a293e9395fb3048beb6fc
MD5 b6d111e760f72e3ca0e12e8846a89159
BLAKE2b-256 1c30f81d5321fff8900ba3b5679f900f871cf0327a1ec40894366ca618723f3e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page