KairosChain MCP Server

Gem Version Ruby License: MIT

A self-referential Model Context Protocol (MCP) server for auditable skill self-management. KairosChain enables AI agents to define, evolve, and audit their own capabilities through a three-layer knowledge system backed by a private blockchain.

Features

  • Three-Layer Knowledge System — L0 Skills (Ruby DSL/AST), L1 Knowledge (accumulated insights), L2 Context (session-specific)
  • Blockchain-Backed History — Immutable change records for all skill definitions, promotions, and evolution events
  • Cognitive Agent Framework — OODA loop with autonomous mode, safety gates, and human checkpoints
  • SkillSet Plugin Architecture — Install, upgrade, evolve, and promote modular capability packages
  • HestiaChain Meeting Place — P2P skill and knowledge exchange between agent instances
  • SkillSet Exchange — Deposit, browse, acquire, and withdraw knowledge packs via Meeting Places
  • MMP (Model Meeting Protocol) — PlaceClient for structured peer communication
  • Multi-User Support — PostgreSQL backend with role-based access control
  • Service Grant Tokenomics — Token-based service grants with budget tracking
  • Attestation System (Synoptis) — Cryptographic attestation and trust scoring
  • Dream Mode — Speculative knowledge proposals with community review
  • Claude Code Plugin Projection — Auto-project SkillSets as Claude Code plugins (hooks, agents, slash commands)
  • Instruction Mode Projection — Project the active instruction mode body to project-root CLAUDE.md via a managed @-import region; reaches Agent tool sub-agents (which do not receive MCP instructions) and bypasses the harness truncation cap
  • Multi-LLM Review — Parallel dispatch to heterogeneous LLMs (Claude, Codex, Cursor) via CLI subprocesses; consensus verdict with aggregated findings

Installation

gem install kairos-chain
kairos-chain init

Usage

As MCP Server (stdio — default)

Add to your Claude Code MCP configuration (.mcp.json):

{
  "mcpServers": {
    "kairos-chain": {
      "command": "kairos-chain",
      "args": []
    }
  }
}

As HTTP Server

kairos-chain --http --port 8080

CLI Commands

kairos-chain init [DIR]            # Initialize data directory
kairos-chain upgrade [--apply]     # Check/apply template migrations
kairos-chain skillset list         # List installed SkillSets
kairos-chain skillset install PATH # Install a SkillSet from path
kairos-chain skillset enable NAME  # Enable a SkillSet
kairos-chain skillset info NAME    # Show SkillSet details
kairos-chain mode project          # Project active instruction mode to CLAUDE.md
kairos-chain mode status           # Show instruction mode projection state
kairos-chain mode remove           # Remove instruction mode projection
kairos-chain -v                    # Show version

Directory Structure

.kairos/
├── skills/              # L0 — Skill definitions (DSL/AST)
├── knowledge/           # L1 — Accumulated knowledge
├── contexts/            # L2 — Session contexts
├── skillsets/            # Installed SkillSet plugins
├── storage/
│   └── blockchain.json  # Immutable change history
└── config/
    └── safety.yml       # Safety policies

SkillSets

SkillSet Description
agent Cognitive agent with OODA loop and autonomous mode
autoexec Automated task execution with scheduling
autonomos Autonomous multi-cycle agent operations
document_authoring LLM-powered document generation
dream Speculative knowledge proposals
hestia HestiaChain Meeting Place server
introspection System health and safety checks
knowledge_creator Knowledge scaffolding tools
llm_client Multi-provider LLM integration
mcp_client Remote MCP server connection
mmp Model Meeting Protocol client
multiuser PostgreSQL multi-user backend
plugin_projector Claude Code plugin projection
service_grant Token-based service grants
skillset_creator SkillSet scaffolding
skillset_exchange P2P SkillSet deposit/browse/acquire
synoptis Attestation and trust system

Philosophy

KairosChain's architecture flows from one principle: meta-level operations are expressed in the same structure as base-level operations. This structural self-referentiality enables agents to reason about, modify, and evolve their own capabilities using the same tools they use for base-level tasks.

Why "Pure" Skills

The name is borrowed from pure functions — functions whose output depends only on their declared arguments, and which change nothing outside their return value. A capability written in prose is impure in two ways. Its behaviour depends on things the definition does not declare: the rest of the context window, the model version, whatever else happens to be loaded. And what it actually did cannot be checked from the definition, either before the run or after it.

Purity here does not mean the absence of effects. Agents do write files and reach out to the world. It means that where the impurity lives is declared in the definition itself. Inside a definition block, constraint and check carry the machine-decidable part, while the fifth constructor, node, marks the part a machine cannot decide. The evaluation engine returns those nodes as non-evaluable and leaves satisfaction as :unknown rather than true or false:

# SemanticReasoning — explicitly non-evaluable (requires human judgment)
satisfied: :unknown,
evaluable: false

Like a type system that surfaces effects instead of removing them, the undecidable part is recorded as undecidable rather than hidden. How much of a capability has been formalised therefore becomes machine-readable — which is what dsl_ast/drift_detector.rb measures.

See CLAUDE.md for the full philosophical framework including the Nine Propositions, and the kairoschain_design L1 knowledge entry for the Pure Skills directory structure.

Author

Masaomi Hatakeyama University of Zurich / Functional Genomics Center Zurich genomicschain.ch

License

MIT