Que fait OKFy ?
Overview
Use OKFy to turn documentation websites or local Markdown folders into local Open Knowledge Format bundles, then expose them to agents through a read-only MCP server. Prefer npx -y okfy-ai in generated commands so clients can launch the published package without a global install.
Quick Reference
| Goal | Command or action |
|---|---|
| Register a docs site and print setup | npx -y okfy-ai init <name> <url> --client codex --max-pages 100 --max-depth 4 |
| Import local Markdown | npx -y okfy-ai import ./docs --out ./docs-okf --source-name "Project docs" |
| Prove a source for a task | npx -y okfy-ai activate <name-or-bundle> --client codex --task "<task>" --out okfy-activation |
| Preview readiness and graph | npx -y okfy-ai map <name-or-bundle> --out okfy-inspector.html |
| Diagnose setup | npx -y okfy-ai doctor <name> --client codex |
| Serve to MCP | npx -y okfy-ai serve <name-or-bundle> --mcp --auto-refresh |
Setup Workflow
- Choose a short source name such as
stripe,clerk, orproject-docs. - For a docs website, run
npx -y okfy-ai init <name> <url> --client codex --max-pages 100 --max-depth 4. - For local Markdown, run
import, thenvalidate, then serve the generated bundle path. Only add--forceafter the user explicitly approves overwriting the output directory. - When the user wants proof before config changes, run
activatewith--taskmatching their real question. The packet includesokfy-inspector.html,okfy-setup.md, andokfy-proof.json. - If setup fails or the MCP client cannot see tools, run
doctorbefore editing client config by hand.
MCP Use
When an OKFy MCP server is available, use the tools in this order:
bundle_summaryto inspect validation status, freshness, available sources, and tool expectations.search_conceptswith the user's task terms. Usesourcefilters in multi-source workspaces when the relevant docs source is known.read_conceptfor the most relevant concepts, keeping reads small before expanding.get_neighborswhen the answer depends on linked concepts, backlinks, prerequisites, or nearby API/reference pages.- Cite the source URLs or resource fields surfaced by the concept results.
Start with narrow searches, then broaden only when results are thin. In workspaces, pass both source and id to read_concept when concept ids are ambiguous.
Workspaces
Serve multiple registered sources through one MCP server when a task spans a stack:
npx -y okfy-ai serve stripe clerk --mcp --auto-refresh
Then filter searches:
{ "query": "checkout sessions", "source": "stripe", "limit": 5 }
Use source filters whenever the user names the product, API, framework, or docs source. If the user asks across the stack, search the workspace without a filter first, then use per-source reads for precision.
Safety Rules
- MCP tools are read-only. Auto-refresh is server-side maintenance for registered sources, not an agent-callable write tool.
- Do not use
npx okfy; usenpx -y okfy-aifor no-install commands. - Do not run
serve --mcpas a normal chatty terminal session. MCP clients launch it as a stdio subprocess. - Do not bypass crawler safety defaults, private-network protections, or unsafe
--forceguards unless the user explicitly accepts the risk. - Do not hand-edit client config first when
init,activate, ordoctorcan produce or verify the exact command/config.
Common Mistakes
| Mistake | Fix |
|---|---|
| Treating OKFy like a hosted index | Keep the workflow local: bundle files, MCP stdio, and source URLs remain inspectable. |
| Reading every concept after search | Read the top matches first, then use neighbors to expand only where needed. |
| Ignoring workspace source names | Use source filters and source-qualified reads for multi-source bundles. |
| Skipping proof | Use activate --task when the user needs confidence before wiring MCP. |
| Debugging config blindly | Run doctor <name> --client codex and follow its next repair command. |