okf-tools
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-tools find concepts about exponential backoff"
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
Semantic search and CRUD tooling for OKF knowledge bundles. Runs locally, entirely offline.
OKF is a vendor-neutral format (published by Google Cloud Platform) for persisting team knowledge as markdown with YAML frontmatter. okf-mcp indexes those files and makes them searchable via hybrid BM25 + vector cosine similarity. It exposes the same functionality through both a CLI and an MCP server, so humans and AI agents can query the same bundle.
Quick Start
# requires Python 3.10+
git clone https://github.com/hdean-ssp/okf-mcp.git
cd okf-mcp
source activate.sh
# create a bundle
mkdir ~/my-knowledge && cd ~/my-knowledge
git init && okf init
# add a concept
okf commit --check-duplicates --json '{
"title": "Retry Pattern",
"type": "Pattern",
"content": "Use exponential backoff with jitter for transient failures.",
"tags": ["reliability", "networking"]
}'
# build search index (downloads ~30MB embedding model on first run)
okf reindex
# search
okf fetch "how to handle network failures"After that:
okf fetch "your question"searches with natural languageokf listbrowses all conceptsokf show <concept-id>prints full contentokf statsreports bundle healthUse Cases & Examples has real-world workflows
Getting Started is the full walkthrough
Related MCP server: RAG In A Box MCP Server
Commands
Command | Purpose |
| Initialise a new bundle |
| Create a concept |
| Hybrid search (BM25 + semantic) |
| Display a concept |
| Browse concepts (filterable) |
| Modify a concept |
| Move or rename a concept |
| Remove a concept |
| Rebuild the vector index |
| Bundle statistics |
All commands accept --format json|text|brief. Piped output defaults to JSON; interactive defaults to text.
How It Works
The markdown files in your bundle are the source of truth. The vector index is a derived sidecar (gitignored, rebuildable from scratch with okf reindex --full).
Search combines BM25 keyword matching and vector cosine similarity at a 60/40 weighting. Embeddings come from fastembed using BAAI/bge-small-en-v1.5 (384 dimensions), stored in SQLite via sqlite-vec. Everything runs locally.
Reindexing is incremental by default (mtime-based change detection). Embedding is chunked in small batches to keep memory usage under 500MB even on a 2GB VPS.
MCP Server
The MCP server lets any MCP-compatible client (Kiro, Claude Desktop, etc.) interact with your bundle over stdio JSON-RPC.
# from within your bundle directory
okf-mcp
# or point to a specific bundle
okf-mcp --bundle-path ~/my-knowledgeYou typically don't run it by hand. Instead, configure your MCP client to launch it:
Client Configuration
Team/shared deployment (recommended, see Team Setup Guide):
Create ~/.kiro/settings/mcp.json on the server:
{
"mcpServers": {
"okf-mcp": {
"command": "/path/to/okf-mcp/.venv/bin/okf-mcp",
"args": [
"--bundle-path",
"/path/to/your/team-bundle"
],
"autoApprove": [
"commit_concept", "delete_concept", "fetch_concepts",
"get_stats", "init_bundle", "list_concepts",
"move_concept", "reindex", "show_concept", "update_concept"
]
}
}
}Kiro via Remote-SSH (Kiro connects to server, MCP runs on server):
{
"mcpServers": {
"okf-mcp": {
"command": "/path/to/okf-mcp/.venv/bin/okf-mcp",
"args": ["--bundle-path", "/path/to/your/bundle"],
"autoApprove": [
"fetch_concepts", "list_concepts", "show_concept",
"get_stats", "reindex"
]
}
}
}Local setup (Kiro and bundle on the same machine):
{
"mcpServers": {
"okf-mcp": {
"command": "okf-mcp",
"args": ["--bundle-path", "/path/to/your/bundle"],
"autoApprove": [
"fetch_concepts", "list_concepts", "show_concept",
"get_stats", "reindex"
]
}
}
}See MCP Setup Guide for individual installation or Team Setup Guide for shared deployments.
Available Tools
Tool | Description |
| Create a new bundle at a given path |
| Add a new concept (title, type, content, tags) |
| Modify fields on an existing concept |
| Move or rename a concept |
| Remove a concept |
| Semantic/hybrid search with natural language |
| Browse concepts with filters (type, tags, date, path) |
| Get full content of a concept |
| Rebuild the vector search index |
| Bundle health statistics |
The server can start without a bundle configured. Pass --bundle-path or call init_bundle from the client. All tools except init_bundle require a configured bundle. Errors come back as structured MCP tool errors. Logging goes to stderr (stdout is the JSON-RPC channel).
Agent Integration
Agents interact through the MCP tools directly (fetch_concepts, commit_concept, etc.). See agent/AGENT.md for the usage guide: when to query, when to commit, workflow patterns.
Documentation
Team Setup Guide - shared deployment onboarding
MCP Setup Guide - individual installation and troubleshooting
Getting Started - CLI walkthrough
Development
git clone https://github.com/hdean-ssp/okf-mcp.git
cd okf-mcp
source activate.sh
pip install -e ".[dev]"
pytest190 tests across CLI, MCP server, bundle operations, search, sync, and move/rename. Dev dependencies: pytest, hypothesis, pytest-asyncio.
Roadmap
See ROADMAP.md for the production readiness plan — input hardening, data integrity, deployment tooling, and the path to a stable 1.0 release.
License
Apache 2.0
Available Tools
10 toolscommit_conceptC
Commit a new concept to the knowledge bundle.
Creates a concept file with the given title, type, and content. Optionally checks for duplicate concepts before committing.
Inputs: type (required), title (required), content (required), path, +2 more. Returns: result
delete_conceptA
Delete a concept from the bundle by its concept_id.
Inputs: concept_id (required). Returns: result
fetch_conceptsA
Search the knowledge bundle using natural language queries.
Returns a ranked list of matching concepts with scores and snippets. Supports hybrid (semantic + keyword), keyword-only, or semantic-only modes.
Inputs: query (required), mode, tags, type, +2 more. Returns: result
get_statsA
Return bundle health statistics.
Returns concept count, type/tag distributions, last reindex timestamp, and the number of concepts pending re-embedding.
Inputs: no named parameters. Returns: result
init_bundleA
Initialize a new OKF knowledge bundle at the specified path.
Creates .okf/config.json, a root index.md, and updates .gitignore if in a git repo. This is the only tool that does not require a pre-configured bundle.
Inputs: path. Returns: result
list_conceptsB
List concepts in the knowledge bundle with optional filters.
Returns a filtered, sorted list of concepts. Supports filtering by type, tags, modification date, and path prefix.
Inputs: path, tags, type, limit, +1 more. Returns: result
move_conceptA
Move or rename a concept within the bundle.
Changes the concept's location (and therefore its concept_id) without losing content, metadata, or vector-index history. Optionally updates the title in frontmatter at the same time.
Examples:
Rename: concept_id="notes/old-name", new_concept_id="notes/new-name"
Move: concept_id="drafts/idea", new_concept_id="published/idea"
Both: concept_id="tmp/scratch", new_concept_id="guides/setup-guide", new_title="Setup Guide"
Inputs: concept_id (required), new_concept_id (required), new_title. Returns: result
reindexA
Rebuild the vector index for the knowledge bundle.
Performs an incremental reindex by default (only processes changed files). Set full=True to discard the existing index and rebuild from scratch.
Returns a JSON summary with counts of added, updated, removed, skipped concepts and the total number of indexed concepts.
Inputs: full. Returns: result
show_conceptA
Show the full details of a concept by its concept_id.
Returns all frontmatter fields and the complete markdown body.
Inputs: concept_id (required). Returns: result
update_conceptA
Update an existing concept in the bundle.
Applies only the provided fields to the concept, leaving unspecified fields unchanged. Re-embeds the content and updates the vector index.
Inputs: concept_id (required), tags, type, title, +1 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
All ten tools have distinct purposes: create, delete, search, stats, init, list, move, reindex, show, update. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., commit_concept, delete_concept). Even reindex fits the pattern as a clear single action.
10 tools is ideal for a knowledge bundle manager. Each tool serves a clear purpose without being overwhelming or insufficient.
The tool surface covers the full lifecycle: init, CRUD (commit, show, list, update, delete), move, reindex, search, and stats. No obvious gaps.
Maintenance
Related MCP Connectors
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceHybrid semantic search (dense vector + BM25) over local knowledge bases and codebases, exposed as MCP tools for AI agents to search and list knowledge bases.-
- FlicenseNot gradedqualityBmaintenanceEnables any MCP-compatible AI assistant to search, filter, and retrieve information from a local document collection using a hybrid search pipeline with vector, BM25, reranking, and LLM enrichment.4-
- 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 gradedqualityCmaintenanceProvides MCP tools for semantic search over personal knowledge sources using pluggable embeddings and local vector indexing.1MIT