okft
Lint and serve Open Knowledge Format (OKF) bundles.
OKF is Google's open spec for representing organizational knowledge as a
directory of markdown files with YAML frontmatter — a knowledge graph that
both humans and AI agents can read natively. okft covers the two
sides of keeping a bundle healthy and useful:
okft lint— validate a bundle against the OKF v0.1 spec, plus hygiene checks (broken links, orphaned concepts, malformed timestamps). Wire it into CI so your knowledge bundle can't rot silently.okft serve— expose a bundle to any MCP-capable AI agent (Claude, Gemini CLI, Cursor, …) as a set of navigation tools: overview, read, search, list. Deterministic graph traversal, no embeddings, no database.
Install
pip install okft # lint only
pip install 'okft[serve]' # lint + MCP server
Lint
okft lint path/to/bundle
analytics/tables/orders.md:1 error E003 frontmatter must include a non-empty `type` field
analytics/metrics/churn.md:24 warning W001 link target does not resolve in bundle: /analytics/tables/order
engineering/runbook.md:1 warning W004 concept is never linked from any other document
12 concepts checked: 1 error(s), 2 warning(s)
Exit code is 1 on errors (or on warnings with --strict), so it drops
straight into CI. --format json emits machine-readable findings.
Rules
| Code | Severity | Check |
|---|---|---|
| E001 | error | concept file has no YAML frontmatter block |
| E002 | error | frontmatter is not parseable YAML |
| E003 | error | missing or empty type field |
| E004 | error | reserved file (index.md / log.md) has frontmatter |
| W001 | warning | link target does not resolve inside the bundle¹ |
| W002 | warning | timestamp is not ISO 8601 |
| W003 | warning | tags is not a list of strings |
| W004 | warning | orphan concept — nothing links to it (--no-orphans to skip) |
| W005 | warning | bundle root has no index.md |
| W006 | warning | log.md headings are not ISO 8601 dates |
| W007 | warning | concept has no title |
¹ The spec requires consumers to tolerate broken links, so they are warnings, never conformance errors.
Both standard markdown links (/analytics/tables/customers.md, relative
paths) and [[wiki-style]] links are resolved.
Serve to an AI agent
okft serve path/to/bundle
Runs an MCP server (stdio) with four tools:
| Tool | Purpose |
|---|---|
okf_overview |
root index + every concept grouped by type |
okf_read |
one concept: frontmatter, body, outbound & inbound links |
okf_search |
ranked full-text search with snippets |
okf_list |
filter concepts by type and/or tag |
Register it with Claude Code:
claude mcp add acme-brain -- okft serve /path/to/bundle
or in any MCP client config:
{
"mcpServers": {
"acme-brain": { "command": "okft", "args": ["serve", "/path/to/bundle"] }
}
}
Try it
A small example bundle ships in examples/acme_brain:
okft lint examples/acme_brain
okft serve examples/acme_brain
CI example (GitHub Actions)
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: pip install okft
- run: okft lint knowledge/ --strict
Status
Tracks OKF v0.1. The spec is young and so is this tool — issues and PRs welcome, especially reports of real-world bundles that lint incorrectly.
License
Apache-2.0
Metadata
Release files for okft 0.1.0
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 | |
|---|---|---|---|---|
| okft-0.1.0.tar.gz | 16.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| okft-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.6 kB
Release files / okft-0.1.0.tar.gz
| Download URL | okft-0.1.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4270e67570738c96453d36457158da63966440e9f0477d1c6c4dc711d8ad8c4
|
|
BLAKE2b-256 checksum How to use checksums |
e52dc3386e1ffd587e183c516df84fecc6cf07ebe10fdd8dd91814f79d9ddda8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / okft-0.1.0-py3-none-any.whl
| Download URL | okft-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e311132a12de5fdfb594175d50e4e602c3ce0a7686b582723171bb2ae18c4ff
|
|
BLAKE2b-256 checksum How to use checksums |
0095499a0ba2bdaf7bb9f76f07755a87b140c1851348e74b391537f22b30205b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for okft 0.1.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.