Historical document from source revision 61e75e9. This implementation plan is archived for reference and is not current implementation guidance. Original source.

Technical specification: OKF v0.2 in okf-mcp

1. Goal

Make MCP a schema-first v0.2 adapter with rich structured outputs and safe preview/apply edits while preserving the legacy five-tool text contract.

Dependencies: task09.md–task18.md.

2. Checked-in schemas

Add internal/mcpserver/contracts/*.schema.json for:

JSON Schema is the source of truth:

The stable error envelope contains code, message, retryable, and diagnostics.

3. Existing tools compatibility

list_concepts

Add input as_of. The structured result includes:

read_concept

Preserve raw Markdown text. The structured result contains:

Do not convert unknown YAML into a lossy closed JSON model.

validate_bundle

Inputs:

Output:

get_semantic_graph

The text fallback remains graph package output; structured content is a parsed document according to the task12 profile. MCP does not build its own graph model.

write_concept

Preserve the whole-document escape hatch, but make validation version-aware. Canonical request identity includes domain/version policy. Do not add a caller-controlled idempotency key.

4. Safe edit tools

Add:

Operations map only to task14 domain operations. Preview returns:

Apply requires expected_revision and expected_plan_digest, rebuilds the plan, and publishes through store CAS/journal. Raw filesystem writes are prohibited.

5. Migration tools

Add:

They are adapters for the task15 planner:

6. Security

7. Files

8. Tests

All tests follow AAA.

9. Acceptance criteria

10. Out of scope

Execute/attest tools, receipt/verdict protocol, attester ABI/sandbox/cache.