A new architectural layer for AI-generated knowledge governance.
KCP proposes "Layer 8" above the OSI Application Layer — a standard for publishing, discovering, verifying, and tracking the lineage of knowledge artifacts produced by AI agents.
AI agents generate valuable knowledge every day — analyses, reports, decisions, code reviews. But this knowledge:
- Dies in chat sessions — no persistence, no discovery
- Has no provenance — who created it? from what data? is it trustworthy?
- Can't be shared — locked in proprietary formats and platforms
- Has no lineage — when knowledge builds on other knowledge, there's no trail
KCP defines a protocol for knowledge artifacts — signed, content-addressed, discoverable units of AI-generated knowledge with full lineage tracking.
┌────────────────────────────────────────────────────────┐
│ Layer 8: Knowledge & Context (KCP) │
│ Governance · Persistence · Discovery · Lineage │
├────────────────────────────────────────────────────────┤
│ Layer 7: Application (HTTP, DNS, FTP) │
├────────────────────────────────────────────────────────┤
│ Layers 1-6: Transport, Network, etc. │
└────────────────────────────────────────────────────────┘
- Signed artifacts — Every knowledge artifact is signed with Ed25519 for authenticity
- Content-addressed — SHA-256 hashing ensures integrity
- Lineage tracking —
derivedFromchains show how knowledge evolves - Three operating modes — Local (SQLite), Corporate Hub, Federated (P2P)
- Zero infrastructure — Works locally with no server, no config, no accounts
- Transparent to users — AI assistant skills abstract all complexity
| SDK | Language | Tests | Status |
|---|---|---|---|
| Python | Python 3.13 · pytest | ✅ 96 tests | Production-ready |
| TypeScript | Node.js 25 · Jest | ✅ 37 tests | Production-ready |
| Go | Go 1.22 · go test | ✅ 64 tests | Production-ready |
| MCP Bridge | Python · pytest-asyncio | ✅ 23 tests | Production-ready |
| Total | ✅ 220 tests | All passing |
pip install kcp # Core
pip install kcp[server] # + HTTP server for P2Pgit clone https://github.com/kcp-protocol/kcp
cd kcp
make setup-python # create venv + install deps
# Demo 1 — cross-session: publish in one process, read in another
make demo # Session 1: publish 3 artifacts
make demo-read # Session 2: NEW process reads, searches, verifies signatures
# Demo 2 — MCP tools: all 6 MCP tools working standalone (no editor needed)
make demo-mcp
# Demo 3 — peer sync: two nodes exchange knowledge over HTTP
make peer-demo
# Demo 4 — connect to your editor (Claude Desktop, Cursor, Windsurf)
make setup-mcp-claude # auto-configures Claude Desktop
make setup-mcp-cursor # auto-configures Cursor
make setup-mcp-windsurf # auto-configures Windsurffrom kcp import KCPNode
node = KCPNode(user_id="alice@example.com")
# Publish knowledge
artifact = node.publish(
title="Rate Limiting Strategies",
content="## Token Bucket\n\nThe most common approach...",
format="markdown",
tags=["architecture", "rate-limiting"],
)
# Search
results = node.search("rate limiting")
# Track lineage
derived = node.publish(
title="Rate Limiting in gRPC",
content="Building on general strategies...",
derived_from=artifact.id,
)kcp init
kcp publish --title "My Analysis" report.md
kcp search "authentication"
kcp serve --port 8800 # Web UI + P2P
kcp peer add https://peer.trycloudflare.com
kcp sync https://peer.trycloudflare.comStart the server and open http://localhost:8800/ui:
kcp serve| Mode | For | Storage | Config |
|---|---|---|---|
| 🏠 Local | Individual users | SQLite (~/.kcp/kcp.db) |
None (zero config) |
| 🏢 Hub | Organizations | PostgreSQL + S3 | KCP_HUB=url |
| 🌐 Federation | Cross-org sharing | Hub-to-hub sync | Hub config |
All modes use the same API. The backend is transparent to the user.
| Document | Description |
|---|---|
| SPEC.md | Full protocol specification |
| ARCHITECTURE.md | Architecture, storage, P2P, security |
| AI_AGENT_GUIDE.md | Integration guide for AI agents (LLMs, Copilot, Claude) |
| llms.txt | LLM indexing manifest (llmstxt.org convention) |
| RFC-001-CORE.md | Formal RFC (root) |
| RFC KCP-001 | Formal RFC (detailed) |
| RFC KCP-002 | KCP ↔ MCP Bridge — persistent artifacts as MCP context |
| MCP Server | KCP MCP Server — Claude Desktop / Cursor / Windsurf integration |
| Whitepaper | Academic paper |
| Comparison | vs Semantic Web, MCP, etc. |
| Use Cases | 10 real-world use cases |
| Roadmap | 6-phase development plan |
| Presentation | Executive presentation (PT-BR) |
| Python SDK | Python SDK documentation |
| Go SDK | Go SDK documentation |
| TypeScript SDK | TypeScript SDK documentation |
| Testing Guide | Running & writing tests for all SDKs |
| Contributing | Contribution guidelines |
kcp/
├── SPEC.md # Protocol specification
├── ARCHITECTURE.md # Architecture & design
├── demo.py # Cross-session demo (make demo + make demo-read)
├── demo_mcp.py # MCP tools demo — 6 tools standalone (make demo-mcp)
├── Makefile # All tasks: test, demo, setup-mcp-*
├── sdk/
│ ├── python/ # Python SDK (reference implementation)
│ ├── go/ # Go SDK (Go 1.22, 64 tests ✅)
│ └── typescript/ # TypeScript SDK (37 tests ✅)
├── mcp-server/ # MCP Bridge (23 tests ✅)
│ ├── kcp_mcp_server/
│ │ └── server.py # 6 MCP tools: publish, search, get, lineage, list, stats
│ ├── setup_mcp.py # Auto-configure Claude Desktop / Cursor / Windsurf
│ └── tests/ # 23 async tests
├── rfcs/ # Formal RFCs (KCP-001, KCP-002)
├── docs/ # Documentation + landing page
│ ├── index.html # Landing page (kcp-protocol.org)
│ ├── assets/ # Logo SVGs + social card
│ └── *.md # Whitepaper, comparison, use-cases, roadmap
└── examples/ # Example payloads
See CONTRIBUTING.md. All contributions welcome — code, docs, use cases, translations.
Author: Thiago Silva
Status: Alpha — protocol and SDK under active development
Feedback: Open an issue