CKS MCP Server
Model Context Protocol server for Canonical Knowledge Structure.
cks-mcp is an MCP (Model Context Protocol) server that provides LLMs
with structured, verifiable knowledge operations through the CKS
ecosystem. It exposes four tools—validate_knowledge, serialize_knowledge,
explain_knowledge, and evolve_knowledge—each backed by the deterministic,
immutable semantics of cks-core and the operational management of cks-runtime.
Every tool call now creates a Runtime Session and Transaction, producing an immutable Version and collecting Diagnostics. This guarantees full auditability and reproducibility.
Ecosystem
CKS Core is the semantic foundation of the CKS 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 |
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. This minimises hallucinations and makes AI‑
generated knowledge auditable.
In addition to the built‑in validation rules, validate_knowledge
supports opt‑in extensions — extra, non‑default constraints that
can be activated per call without affecting global state. The first
available extension, embedding_projection, mechanically detects
citation hallucinations: it verifies that every EmbeddingProjection
points to a real source object that actually exists in the structure.
This turns the abstract goal of "reducing hallucinations" into a
concrete, machine‑checkable property of the knowledge graph.
Installation
pip install cks-mcp
The server requires cks-runtime (which includes cks-core) as a dependency.
Quick Start
Launch the MCP server
cks-mcp
An MCP client (Claude Desktop, any MCP-compatible LLM) can then connect and call tools.
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-mcp
-
Open 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 four tools is ready to use.
Interactive LLM client (Groq / DeepSeek / local)
export GROQ_API_KEY=your_key_here
python llm_client/cks_llm_client.py --provider groq
You can then type natural language requests; the LLM will automatically call the appropriate CKS tool.
Available Tools
| Tool | Description |
|---|---|
validate_knowledge |
Validate a Knowledge Structure and return diagnostics. Supports opt‑in extensions (e.g. embedding_projection). |
serialize_knowledge |
Serialize a Knowledge Structure into canonical JSON. |
explain_knowledge |
Produce a semantic explanation of a Knowledge Structure. |
evolve_knowledge |
Apply Genesis/Decay operators to evolve a structure. |
Usage Example
{
"method": "tools/call",
"params": {
"name": "validate_knowledge",
"arguments": {
"json_data": "{\"objects\":[{\"identity\":{\"id\":\"obj-1\",\"type\":\"Definition\",\"name\":\"Test\"},\"structure\":{}}]}"
}
}
}
Response (with version and session information):
{
"result": {
"content": [
{
"type": "text",
"text": "{\"valid\": true, \"version_id\": \"...\", \"session_id\": \"...\", \"diagnostics\": [], ...}"
}
]
}
}
Catching citation hallucinations
Pass "extensions": ["embedding_projection"] to validate_knowledge.
This activates an extra constraint that checks every EmbeddingProjection
object for a valid represents relation to an existing source object.
A projection that references a non‑existent source (a fabricated citation)
is mechanically flagged, giving you a clear, machine‑readable diagnostic
instead of an undetected hallucination.
Testing
python -m pytest -v
19+ tests, all passing.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cks_mcp-0.5.1.tar.gz.
File metadata
- Download URL: cks_mcp-0.5.1.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dafc8fb0890db1d80abaea736abe0c02af27b6d54c04fe8e5c8ad9d34efdff1
|
|
| MD5 |
ea788f179f7e8a244a2f4239d9f9ca6d
|
|
| BLAKE2b-256 |
7467d27b798fe2a17db5703a40fbac5110d9014301441e56ac2fcbe95778b881
|
File details
Details for the file cks_mcp-0.5.1-py3-none-any.whl.
File metadata
- Download URL: cks_mcp-0.5.1-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8bf1e7ad95a1b8c6af4bb9d69fe71ed349bc6fbee23d8f191ee3f00a8ec2e05
|
|
| MD5 |
1f7ac27f46990baa603f8c15c4c94982
|
|
| BLAKE2b-256 |
5469039538174834d2c9cd99c8a5f9e5d7a45dcdd952b41695936ad5c7204569
|