Cks
FreeNot checkedGive your LLM a canonical knowledge backbone. 27 tools to validate, evolve, and verify — zero hallucinations.
About
Give your LLM a canonical knowledge backbone. 27 tools to validate, evolve, and verify — zero hallucinations.
README
Model Context Protocol server for Canonical Knowledge Structure.
cks-mcp is a fully asynchronous MCP (Model Context Protocol) server
that gives LLMs a canonical knowledge backbone. It exposes 32
tools (listed under Available Tools below) for validation, evolution,
branching, merging, semantic search, contradiction detection, sandboxing,
and more, backed by the deterministic, immutable semantics of cks-core
and the async operational management of cks-runtime.
Every tool call creates a Runtime Session and Transaction, producing an immutable Version and collecting Diagnostics. This guarantees full auditability and reproducibility.
📚 Full documentation: docs/index.md — start with Getting Started or jump straight to the Tools Reference.
Ecosystem
Other projects build upon it:
| Project | Description | Repository |
|---|---|---|
| cks-core | Canonical semantic engine | Deus-corp/cks-core |
| cks-runtime | Operational environment – sessions, transactions, persistence | Deus-corp/cks-runtime |
| cks-mcp | MCP server – exposes CKS to LLMs (this repository) | Deus-corp/cks-mcp |
Quick Start
- Install and connect to Claude Desktop (see Installation).
- (Optional) Semantic search works out of the box with the built-in
fastembedengine (no API keys required). To use HuggingFace models instead, setCKS_EMBEDDING_PROVIDER=huggingfaceandexport HF_TOKEN=hf_.... See Getting Started. - In the chat, start your message with "Use cks-mcp to…".
- Claude automatically picks the right tool from the 32 available — validation, evolution, branching, merging, source verification, contradiction detection, semantic search, subgraph queries, sandboxing, and more.
- Every operation is logged, versioned, and stored in a persistent SQLite database.
Just type "Use cks-mcp to..." and Claude does the rest. That's it. No programming, no command line — just a conversation!

In the video above, Claude creates a validated knowledge graph about the water cycle from a single sentence, using validate_knowledge and explain_knowledge. All 32 tools are ready for you: branching, merging, versioning, source verification, contradiction detection, subgraph queries, sandboxing, gossip conflict resolution, and more — all triggered by plain English.
Why cks-mcp?
LLMs generate plausible but unverified statements. cks-mcp gives them
a canonical knowledge backbone: every piece of information must be
explicitly structured, validated against formal constraints, and
traceable to its origin.
- Eliminate citation hallucinations — optional extensions like
embedding_projectionmechanically detect references to non-existent sources. - Ensure verification integrity — the
verify_sourcetool performs a real HTTP check and cryptographically signs the result. AnyVerificationRecordwithout a valid signature is automatically rejected, even if the model fails to request the check. - Semantic search with real embeddings — the
search_semantictool uses HuggingFace models to find relevant nodes by meaning, not just keywords. A query for "how to train AI models" returns "Gradient Descent" and "Neural Network", not "Banana". - Graph-based RAG — combine semantic search with
query_subgraphto retrieve a full neighbourhood around the found concepts, giving the LLM the context it needs without hallucinating connections. - Full audit trail — every operation is captured in an immutable version history, providing complete accountability for AI-generated knowledge.
- Time-travel debugging —
list_versions,revert_version, andcompare_versionsgive LLMs a full version-control system for knowledge, enabling safe rollbacks and change inspection. - Contradiction detection —
detect_contradictionsflags mutual exclusions (e.g., bothsupportsandcontradictsbetween the same pair) and functional relation violations (e.g., a planet orbiting two different stars). - Hypothesis sandboxing —
fork_sandboxcreates an isolated branch, optionally applies a hypothesis, and reports the diff from the fork point — all without touching the parent session. Safe to discard or promote. - Content ingestion —
ingest_documentfetches a public URL, extracts structured content (sections, tables, lists, JSON‑LD/OpenGraph metadata) and builds a Knowledge Structure with Document, Section, Table, List, Metadata, and Topic objects. An optionaluse_llmparameter sends the extracted data to an LLM (same provider auto‑selection asconstruct_knowledge) for a richer, model‑generated graph. - LLM-assisted knowledge construction —
construct_knowledgeconverts free-form text into a validated Knowledge Structure using a local Ollama model (no API key needed) or the Anthropic API, auto-selected viaCKS_LLM_PROVIDER. - Session portability —
export_sessionpackages a full session bundle (structure + version history) for migration or archival. - Telemetry dashboard —
get_metricsnow returns per‑tool latency percentiles (p50/p95/p99), success rates, and top error types since server start.
Installation
pip install cks-mcp
The server requires cks-runtime (which includes cks-core) as a dependency.
See Getting Started
for the full list of environment variables and how to set them via a
~/.cks-mcp/.env file.
Connect to Claude Desktop
Install all three packages into a single virtual environment:
python3 -m venv cks-env source cks-env/bin/activate pip install cks-core cks-runtime cks-mcpOpen Claude Desktop, go to Settings → Developer → Edit Config. The configuration file (
claude_desktop_config.json) will open. Add the following block (adjust the path to yourcks-mcpexecutable):{ "mcpServers": { "cks-mcp": { "command": "/absolute/path/to/cks-env/bin/cks-mcp" } } }Save the file and fully restart Claude Desktop (Cmd+Q, then reopen). After restart, a connector icon will appear –
cks-mcpwith 32 tools is ready to use.
See Getting Started for a walkthrough of your first session once the server is connected.
Available Tools
32 tools, grouped by function. Full reference with parameters and real request/response examples: docs/tools/.
| Group | Tools |
|---|---|
| Knowledge Lifecycle | validate_knowledge, serialize_knowledge, explain_knowledge, evolve_knowledge |
| Version Control | list_versions, revert_version, compare_versions, explain_diff |
| Branching & Merging | create_branch, merge_branch, merge_knowledge, close_session, fork_sandbox |
| Graph Exploration | query_subgraph, search_semantic, visualize_graph |
| Verification & Integrity | verify_source, detect_contradictions |
| AI-Assisted & Ingestion | construct_knowledge, suggest_evolution, ingest_document |
| Export & Observability | export_knowledge, export_session, get_metrics |
| Gossip & Conflict Resolution | list_gossip_conflicts, list_inference_conflicts, arbitrate_inference_conflict, claim_conflict_task, complete_conflict_task, fail_conflict_task, dead_letter_conflict_task, list_dead_lettered_conflicts |
Critic Agent (unattended conflict resolution)
Alongside the interactive tools above, cks-critic-agent is a separate console
script that runs autonomously: it polls the persistent outbox (SQLite/Postgres
only — not the default in-memory backend) for gossip_conflict and
inference_conflict tasks, resolves each via merge_branch /
arbitrate_inference_conflict(auto_resolve=True), and dead-letters whatever it
can't confidently resolve for a human to review via
list_dead_lettered_conflicts.
# Point it at the same database cks-mcp itself uses (defaults to
# ~/.cks-mcp/cks_mcp.db if CKS_MCP_DB_PATH is unset).
CKS_MCP_DB_PATH=~/.cks-mcp/cks_mcp.db cks-critic-agent
Env vars: CKS_MCP_DB_PATH (shared storage path), CKS_CRITIC_POLL_INTERVAL
(seconds between polls, default 5), CKS_CRITIC_MAX_RETRIES (attempts before
dead-lettering, default 5). See cks_mcp/critic_agent.py for the resolution
policy in full.
Usage Examples
A couple of representative calls — the full set, with real response shapes for every tool, is in docs/tools/.
Validate a structure
{
"method": "tools/call",
"params": {
"name": "validate_knowledge",
"arguments": {
"json_data": "{\"objects\":[{\"identity\":{\"id\":\"obj-1\",\"type\":\"Definition\",\"name\":\"Test\"},\"structure\":{}}]}"
}
}
}
The response includes valid, session_id, version_id, and
diagnostics — keep session_id for every following call on this
structure. See Knowledge Lifecycle for the
other three tools in this group.
Semantic search (no seed IDs required)
{
"method": "tools/call",
"params": {
"name": "search_semantic",
"arguments": {"session_id": "...", "query": "virtual machines in the cloud"}
}
}
Returns matched objects by meaning (e.g. EC2, not S3), expanded into a
subgraph. See Graph Exploration.
Branch, evolve independently, and merge back
{"method": "tools/call", "params": {"name": "create_branch", "arguments": {"session_id": "trunk-session-id"}}}
{"method": "tools/call", "params": {"name": "evolve_knowledge", "arguments": {"session_id": "branch-session-id", "operations": [...]}}}
{"method": "tools/call", "params": {"name": "merge_branch", "arguments": {"target_session_id": "trunk-session-id", "source_session_id": "branch-session-id"}}}
A successful merge commits a new version and returns the merged
structure; a conflicting merge returns "merged": false with a
conflicts list to resolve. See
Branching & Merging for the full
conflict-resolution flow.
Detect contradictions
{
"method": "tools/call",
"params": {
"name": "detect_contradictions",
"arguments": {"session_id": "..."}
}
}
Requires MutualExclusionRule and/or FunctionalRelationRule objects in
the structure declaring which relation types to check. See
Verification & Integrity for the rule shapes
and how this interacts with verify_source's provenance signing.
Security and Provenance
verify_source includes built-in protections:
- SSRF prevention: URLs are validated against a strict allowlist; private, loopback, and cloud metadata IPs are blocked. DNS rebinding attacks are neutralised by pinning the connection to the IP address resolved during the safety check.
- Cryptographic signing: every verification record is signed with a
process-local HMAC.
validate_knowledgeunconditionally verifies this signature, so a hand‑writtenVerificationRecordcan never pass as genuine.
Testing
python -m pytest -v
345+ tests, all passing.
License
MIT
Installing Cks
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/Deus-corp/cks-mcpFAQ
Is Cks MCP free?
Yes, Cks MCP is free — one-click install via Unyly at no cost.
Does Cks need an API key?
No, Cks runs without API keys or environment variables.
Is Cks hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Cks in Claude Desktop, Claude Code or Cursor?
Open Cks on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzCompare Cks with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
