okf-mcp
This server lets agents discover, search, validate, and explore OKF knowledge bundles and their graphs over MCP (stdio or Streamable HTTP).
Discover and search knowledge: list bundles/concepts/types/tags/relation types, search concepts with rich filters (text, type, tags, status, freshness, provenance), and retrieve full concept content.
Explore the knowledge graph: get graph summaries, neighbors, subgraphs, paths between concepts, and export graphs as JSON, DOT, or Mermaid.
Validate OKF data: validate individual bundles, the full project, or check v0.2 migration readiness without writing changes.
Trace provenance and assets: read indexed bundle assets with digest checks, read pinned Git sources, and trace normalized source provenance.
Inspect attested computations: statically inspect computation contracts, prepare non-executing digests, and check receipts without executing or persisting anything.
Support authoring workflows: validate proposed concepts, suggest safe concept paths, and list/read stored proposals (on local modes with write tools enabled).
Serve as an NL2SQL knowledge layer: combined with built-in skills and dbexplain, it supports generating traceable SQL from business and physical knowledge.
Enables read-only remote loading of public OKF bundles and their referenced inert assets from GitHub repositories.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@okf-mcp Validate the OKF bundle at ./knowledge and summarize all conformance errors."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
okf-mcp
Local runtime for Open Knowledge Format v0.2: validate bundles, search concepts, expose knowledge over MCP, and build database Bundles from dbexplain for agent NL2SQL.
Fork of mfdaves/okf-mcp (MIT). Enterprise rollout extensions: hosted Streamable HTTP MCP, immutable knowledge generations,
okf dbexplain, and bundled Agent Skills.
What you get
Piece | Role |
| Validate, search, sync database Bundles, publish knowledge |
MCP server | Agents retrieve OKF concepts (schemas, business semantics, saved SQL) |
Built-in Skills | Guided workflows for sync, business overlays, and publishing |
No database server, vector DB, or embeddings required for the runtime itself.
Related MCP server: 50 First Tapes MCP Server
Prerequisites
Dependency | Required for | Install |
Node.js ≥ 22 |
| |
| Newer compatible releases are accepted; put | |
| dbexplain connectivity | User-maintained; Skills never read or edit it |
Git | Source install | Optional for tarball deploy |
Check:
node --version # v22+
command -v dbexplain && dbexplain --versionQuick start (database knowledge and querying)
The CLI and Skills are independent capabilities. Install the ones needed for a task:
okf CLI / MCP → validate, index, and serve knowledge
okf-dbexplain → generate or refresh physical facts
okf-bundle-business → add or correct Business knowledge
okf-nl2sql → query real data and return traceable results1. Install okf-mcp
git clone https://github.com/doctormacky/okf-mcp.git
cd okf-mcp
npm ci
npm link # optional: register `okf` on PATH
okf --versionExtended install, update, and rollback guide (Chinese): docs/OKF_CLI_SOURCE_INSTALL_UPDATE_ZH.md.
2. Sync physical layer (Skill or CLI)
Prepare dbexplain (releases), then:
$okf-dbexplain
Inspect prod-main and sync to /data/okf/my-databaseOr manually:
okf dbexplain check --include prod-main
okf dbexplain sync \
--include prod-main \
--bundle-root /data/okf/my-database \
--generated-at 2026-08-26T09:00:00Z \
--dry-run
# review plan → apply with --expect-plan <digest>
okf dbexplain validate --bundle-root /data/okf/my-database3. Add business semantics
$okf-bundle-business
Bundle: /data/okf/my-database
Task: add buyer aliases to Customers and project explicit order-state codes
from the column comment. Inventory and propose before writing.After writes:
okf dbexplain overlay-index --bundle-root /data/okf/my-database
okf dbexplain validate --bundle-root /data/okf/my-databaseSkill details: docs/SKILLS.md.
4. Connect an MCP client
See MCP modes below. Restart or reload after Bundle changes.
Built-in Agent Skills
Skills live under .agents/skills/. Register them in your agent host (Cursor, Codex, etc.).
Skill | When to use | You say (example) |
First-time or refresh physical Bundle from dbexplain |
| |
Add or correct Business knowledge in a query-ready Bundle |
| |
Execute read-only SQL from MCP knowledge and return real data |
| |
Publish/update central OKF knowledge via |
|
Also shipped: okf-v02-migration — only when migrating legacy v0.1 catalogs to v0.2.
Each Skill may be installed alone or in any combination and does not assume the others exist. Composition is a user or Agent Host decision.
Full reference: docs/SKILLS.md · docs/SKILLS_ZH.md
MCP modes
stdio and Streamable HTTP expose the same tools when started with the same flags. For database NL2SQL, the default read-only profile is enough.
Full tool catalog: docs/MCP_TOOLS.md · docs/MCP_TOOLS_ZH.md
Mode | Command | Best for |
stdio MCP |
| Cursor, Claude Desktop, local IDE agents |
Streamable HTTP (dev) |
| Local HTTP client testing (loopback) |
Streamable HTTP (hosted) |
| Team server; bearer auth + immutable generations |
Tools (read-only — all three modes above)
Category | Tools |
Discovery |
|
Graph |
|
Validation |
|
Assets / computation |
|
Resources: okf-documents template — read any indexed Markdown concept by okf:// URI.
NL2SQL workflow: $okf-nl2sql calls search_concepts → get_concept →
get_neighbors, then assembles SQL from business knowledge, physical bindings,
and Saved Queries. It falls back to bounded dbexplain discovery only when needed.
Optional write/authoring tools (okf_propose_*, okf_apply_changes, load_remote_bundle) are available on local stdio/HTTP only with extra flags; hosted omits them. Knowledge publishing uses okf knowledge CLI, not MCP writes.
stdio (local agent)
{
"mcpServers": {
"okf": {
"command": "node",
"args": [
"/absolute/path/to/okf-mcp/bin/okf-mcp.js",
"--root",
"/absolute/path/to/your/bundle",
"mcp"
]
}
}
}Or after npm link:
{
"mcpServers": {
"okf": {
"command": "okf",
"args": ["--root", "/absolute/path/to/your/bundle", "mcp"]
}
}
}Default with no subcommand also starts stdio MCP when a bundle root is configured.
hosted (Streamable HTTP + rollout)
Authenticated enterprise profile: MCP at /mcp, rollout API at /v1/rollout/*.
export OKF_READ_TOKEN="<read-token>"
export OKF_ROLLOUT_TOKEN="<rollout-token>"
okf hosted --root /path/to/catalog --host 127.0.0.1 --port 8765
# → http://127.0.0.1:8765/mcpUse okf-knowledge-publisher Skill to download → dry-run → submit snapshots. Other agents consume published knowledge through this MCP URL with Authorization: Bearer $OKF_READ_TOKEN.
Standalone unauthenticated HTTP (dev only):
okf --root /path/to/bundle mcp --http --host 127.0.0.1 --port 8765Prefer hosted for anything beyond localhost.
Common CLI checks
okf --root /path/to/bundle validate
okf --root /path/to/bundle search "order state"
okf --root /path/to/bundle concept business/datasets/my-dataset
okf dbexplain inspect --include prod-main
okf dbexplain validate --bundle-root /path/to/database-bundleDocumentation
Doc | Content |
MCP tools — stdio vs HTTP parity, full catalog | |
Built-in Skills — when & how | |
Install, | |
Full user manual (hosted, knowledge, MCP tools) | |
Self-describing OKF product bundle |
Development
npm ci
npm test
npm run self:validateLicense
MIT — see LICENSE. Upstream mfdaves/okf-mcp contributors remain credited.
Available Tools
28 toolscheck_computation_receiptARead-onlyIdempotent
Check receipt field presence only; never attest, echo values, or persist the receipt.
Inputs: uri (required), receipt (required).
check_v02_migrationARead-onlyIdempotent
Analyze a local or remote bundle for safe staged OKF v0.2 migration without creating proposals or writes.
Inputs: bundle, actorMappings, generatedPaths.
export_graphARead-onlyIdempotent
Render the current OKF graph as JSON, Graphviz DOT, or Mermaid text.
Inputs: format, maxEdges, maxNodes, edgeKinds, +2 more.
find_pathsARead-onlyIdempotent
Find bounded relationship paths between two OKF concepts.
Inputs: source (required), target (required), maxPaths, edgeKinds.
get_conceptARead-onlyIdempotent
Read one valid OKF concept, including its frontmatter, Markdown body, and links.
Inputs: id, uri, path, bundle.
get_graphBRead-onlyIdempotent
Return a bounded set of OKF graph nodes and edges with optional concept filters.
Inputs: tag, type, bundle, maxEdges, +5 more.
get_neighborsBRead-onlyIdempotent
Return the incoming and outgoing graph relationships for one OKF concept.
Inputs: uri (required), edgeKinds, includeAssets, includeExternal.
get_provenanceARead-onlyIdempotent
Trace normalized source provenance through internal concepts without fetching external resources.
Inputs: uri (required), maxDepth, maxNodes, includeExternal.
get_subgraphBRead-onlyIdempotent
Traverse a bounded OKF subgraph outward from one or more seed concepts.
Inputs: uri, depth, seeds, maxNodes, +1 more.
graph_summaryARead-onlyIdempotent
Summarize bundle, concept, edge, type, tag, and graph health counts.
Inputs: no named parameters.
inspect_attested_computationARead-onlyIdempotent
Statically inspect an Attested Computation contract and indexed inert artifacts; never execute it.
Inputs: uri (required), asOf, maxContentBytes, includeComputation.
list_bundlesARead-onlyIdempotent
List the local and remote OKF bundles currently loaded by the server.
Inputs: no named parameters.
list_conceptsARead-onlyIdempotent
List compact OKF concept summaries with optional bundle, type, tag, and text filters.
Inputs: tag, type, limit, query, +3 more.
list_edge_kindsBRead-onlyIdempotent
Count standard semantic and extension edge kinds in the current graph.
Inputs: no named parameters.
list_relation_typesBRead-onlyIdempotent
Count the typed relations present in the current OKF graph.
Inputs: no named parameters.
list_remote_bundlesARead-onlyIdempotent
List metadata for remote bundles currently loaded into the server.
Inputs: no named parameters.
list_tagsARead-onlyIdempotent
Count the tags present on concepts in the current OKF index.
Inputs: no named parameters.
list_typesARead-onlyIdempotent
Count the concept types present in the current OKF index.
Inputs: no named parameters.
okf_get_proposalARead-onlyIdempotent
Read one authoring proposal, including its candidate content and validation result.
Inputs: proposalId (required).
okf_list_proposalsBRead-onlyIdempotent
List compact metadata for stored authoring proposals.
Inputs: bundle, status.
okf_suggest_concept_pathARead-onlyIdempotent
Suggest a safe bundle relative Markdown path from a concept type and title.
Inputs: type (required), title (required), bundle, prefix.
okf_validate_conceptARead-onlyIdempotent
Validate a proposed new OKF concept without writing a proposal or concept file.
Inputs: path (required), frontmatter (required), body, bundle.
prepare_attested_computationARead-onlyIdempotent
Check declared parameters and produce non-executing digests without echoing parameter values.
Inputs: uri (required), parameters (required), asOf.
read_bundle_assetARead-onlyIdempotent
Read one explicitly referenced, already indexed bundle asset with digest verification and byte bounds.
Inputs: uri, path, bundle, maxContentBytes.
read_git_sourceARead-onlyIdempotent
Read one pinned sources[].git entry from an explicitly mapped checkout or bare repository without fetching.
Inputs: concept (required), sourceId (required), maxContentBytes.
search_conceptsARead-onlyIdempotent
Search OKF concepts and return ranked summaries using text and structured filters.
Inputs: asOf, limit, query, types, +19 more.
validate_bundleARead-onlyIdempotent
Report OKF conformance separately from project validity for one bundle or the full current index.
Inputs: bundle.
validate_projectBRead-onlyIdempotent
Report OKF conformance, project validity, and structured diagnostics for the complete configured project.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 28 tools
Most tools have distinct purposes: list_types, list_tags, and list_relation_types each target different entities, while graph traversal tools (get_neighbors, find_paths, get_graph, get_subgraph) are clearly differentiated by scope. A few pairs like list_bundles and list_remote_bundles could cause minor confusion but descriptions clarify local vs remote.
Naming is inconsistent: some tools use a verb_noun pattern (list_types, get_concept) while others have a nonstandard 'okf_' prefix (okf_validate_concept, okf_list_proposals). Also, 'graph_summary' breaks the verb-first convention, and 'check_v02_migration' mixes letters and numbers. The mixed styles reduce predictability.
With 28 tools, the surface is quite large for what appears to be a read-only graph and validation server. While not extreme (≤50), it exceeds the typical comfortable range and many tools feel like minor variations on similar read/validate operations, suggesting the set could be consolidated.
The toolset covers reading, searching, validating, and exporting graph data, plus proposal listing/reading, but lacks any creation or update tools for concepts or bundles. Given the emphasis on validation and proposals, there is no direct 'create_concept' or 'submit_proposal' tool, leaving a notable gap in the complete authoring lifecycle.
Maintenance
Related MCP Connectors
Open federated knowledge network for humans and AI agents with provenance and visible disagreement.
Shared memory for teams and their AI agents: Markdown concepts with typed links in shared bundles.
Your organization's knowledge as OKF trees in Git, for AI assistants to search, read, and cite
Create, validate, edit, export (markdown/svg/png/mermaid), and search JSON Canvas files.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA local OKF-compatible knowledge engine for AI agents. Enables capturing agent conversations, hybrid semantic+keyword search, MCP serving to agents, interactive graph visualization, and OKF bundle export.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and write a local-first knowledge base of plain markdown files in git, with governance gates for safe, hash-anchored edits.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to persist, search, and evolve knowledge through a Markdown vault with a typed knowledge graph and MCP interface.15Apache 2.0
- AlicenseBqualityBmaintenanceEnables AI agents to securely read, search, and write to a local Markdown knowledge base with hybrid RAG retrieval, privacy zones, hash-locked writes, audit logging, and rollback-safe archiving.13MIT