kcp-harness
Integrates with GitHub Copilot to enforce compliance policies, budget ceilings, and audit trails on knowledge-related tool calls.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kcp-harnessshow me the audit log for the last 5 requests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kcp-harness
๐งพ See it run โ interactive KCP playground ยท read the reveal
Deterministic knowledge governance for any AI agent.
Your agent can read every file in your project. Can it prove why it read what it read?
KCP Harness is an MCP compliance proxy that sits between an AI coding agent and its tools. It intercepts knowledge-related calls, routes them through the kcp-agent deterministic planner (14-gate cascade, no LLM), and produces compliance artifacts โ decision traces, audit logs, budget ledgers โ as a side effect of normal agent operation.
The agent can't bypass governance because it only talks to the proxy's MCP interface. The proxy decides what knowledge is accessible, tracks spend, and logs every decision. Fail-closed: if the harness can't verify a request, the agent gets nothing.
Agent (Claude Code / Cursor / Copilot / Windsurf / Cline / Crush / OpenClaw / ...)
โ
โ MCP tool call
v
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ kcp-harness โ
โ โ
โ classify โ govern (14 gates) โ execute โ audit โ
โ โ
โ Side outputs: โ
โ ยท Decision traces (per-request, deterministic) โ
โ ยท Audit log (append-only JSONL) โ
โ ยท Budget ledger (itemized, ceiling-enforced) โ
โ ยท Temporal drift (plan validity over time) โ
โ ยท Approval tickets (named-human sign-off, durable) โ
โ ยท Confidence verdicts (post-synthesis gate) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
v
Knowledge manifests (knowledge.yaml)Why
Enterprises need agents that are defensible โ auditable, reproducible, budget-controlled, temporally pinned. Today's agents can't prove why they read what they read. The harness adds a compliance layer without replacing the agent.
What you keep | What the harness adds |
Your agent (Claude Code, Cursor, Copilot, ...) | Deterministic knowledge selection |
Your workflow (coding, reviewing, shipping) | Decision traces (14 gates per unit) |
Your tools (MCP servers, shell, browser) | Budget enforcement (ceiling, per-currency) |
Temporal governance (drift detection) | |
Append-only audit log | |
Replay / cross-examination | |
Human-approval gates (named reviewer + policy citation) | |
Confidence gating (post-synthesis, route-to-human) |
You sell the compliance layer. The agents are pluggable.
Related MCP server: gov-mcp
Install
npm install -g kcp-harnessOr use without installing:
npx kcp-harness --helpNative executables
Pre-built binaries (no Node/Deno required) for Linux x64/arm64, macOS x64/arm64, and Windows x64 โ grab them from a release. To build one yourself:
npm ci && npm run build
deno compile --allow-read --allow-env --allow-net --allow-run \
--node-modules-dir=auto --output kcp-harness dist/cli.jsQuick start
1. Initialize
kcp-harness init # creates harness.yaml2. Generate agent integration
kcp-harness integrate claude-code # or: pi, cursor, copilot, windsurf, cline, continue, crush, openclaw3. Start coding
Your agent now routes knowledge access through the harness. Every decision is logged.
Supported agents
Agent | Config | Integration |
Claude Code |
|
|
Cursor |
|
|
GitHub Copilot |
|
|
Windsurf | global config + |
|
Cline | MCP settings + |
|
Continue |
|
|
Crush |
|
|
OpenClaw |
|
|
Pi |
|
|
Each agent has its own MCP config format, rules file, and quirks. The integrate command handles
them all โ one governance layer, any agent.
How it works
Every tool call flows through a five-stage pipeline:
1. RECEIVE MCP JSON-RPC request from agent
2. CLASSIFY Knowledge-navigation or pass-through?
3. GOVERN 14-gate cascade (audience โ temporal โ budget โ ...)
4. EXECUTE Call downstream tool / return content
5. AUDIT Log decision to append-only audit logClassifier
The classifier examines each tool call and determines whether it targets governed knowledge.
Read("docs/api.md") where docs/ is governed? Route through the planner. Read("package.json")
where package.json isn't governed? Pass through. KCP tools (kcp_plan, kcp_load) are always
governed.
Governor
Two automated modes, plus a human gate that outranks both:
Plan-first (fast path) โ the agent calls
kcp_planfirst. The harness caches the approved plan. Subsequent reads are checked against the cached plan โ no re-planning.Auto-plan (fallback) โ the agent reads a governed path without planning. The harness runs the planner automatically. Slower, but governance is enforced even for agents that don't know about
kcp_plan.Human approval โ calls matching a
governance.approvalsrule are held for a named reviewer (pending), no matter what the automated paths would decide. Tickets survive restarts and resolve via thekcp-harness approvalsCLI (or any customApprovalProviderchannel). Resolutions require a named reviewer and a policy citation.
The 14-gate cascade
Every knowledge unit is evaluated through 14 deterministic gates, in order:
audience โ not_for โ temporal โ deprecated โ supersession โ relevance โ
skill_eligibility โ attestation โ payment โ access โ strict โ max_units โ
money_budget โ context_budgetA unit must pass all gates. The gate that blocks it is recorded in the decision trace. Same inputs โ same plan. No model involved.
For the skill_eligibility gate's subject matter โ governed kind: skill units โ the
authoring conventions, linter, and conformance vectors live in
Cantara/kcp-skill.
MCP tools
Once connected, agents can use these governance tools:
Tool | Description |
| Deterministic load plan โ which units, in what order, which skipped and why |
| Plan + load eligible unit content |
| Full 14-gate decision trace |
| Lint a |
| Current governance state |
| Approved plans + known units for this session |
| Itemized spend tracking |
| Plan drift detection |
| Human-approval tickets (pending / approved / dismissed / expired) |
| Confidence-gate a synthesized answer before acting on it |
Compliance artifacts
Audit log
Append-only JSONL. Every decision โ governed or pass-through โ is logged with sequence number, timestamp, tool, targets, and governance decision:
cat .kcp-harness/audit.jsonl | jq 'select(.governed == true)'Budget ledger
Append-only itemized spend tracking. Per-currency running totals. Ceiling enforcement โ a load that would exceed the budget is rejected atomically (no partial loads).
Temporal governance
Plans are registered with a temporal watcher. On subsequent calls, the watcher re-evaluates against the current time. If units have drifted (expired, newly valid), the harness emits a drift event. Long-running sessions stay honest.
Approval tickets
Calls matching an approval rule open a durable ticket
(pending_review โ approved | dismissed | expired). The ticket store survives restarts โ
sessions are ephemeral, human review is not. Every resolution records who approved,
when, and which policy it satisfies โ evidence generated at approval time, never
reconstructed from logs.
Confidence verdicts
harness_assess runs kcp-agent's post-synthesis
assess() over a synthesized answer before it may be acted on. The planner gates loading,
grounding gates asserting, this gates acting. Below-threshold verdicts on routed configs
open an approval ticket with the full verdict embedded as evidence.
Configuration
# harness.yaml
version: "1.0"
governance:
domains:
- manifest: "./knowledge.yaml"
paths: ["docs/", "src/"]
policy:
fail_closed: true
audit_all: true
max_units: 5
budget:
amount: 1.00
currency: USDC
confidence: # optional post-synthesis gate (harness_assess)
threshold: 0.7
severity: critical
route_to_role: account-owner
approvals: # optional human-approval gates
provider: file
rules:
- match: { tools: [Write, Edit], paths: [records/] }
required_role: account-owner
expires_after: 72h
policy_ref: POL-7.2
audit:
path: ".kcp-harness/audit.jsonl"CLI
kcp-harness serve [--config harness.yaml] Start the MCP proxy
kcp-harness init Create a harness.yaml template
kcp-harness check [--config harness.yaml] Validate configuration
kcp-harness integrate <agent> [options] Generate agent integration files
kcp-harness integrate --list List supported agents
kcp-harness export [options] Export compliance evidence (SOC 2 / ISO 27001)
kcp-harness dashboard [options] Launch the live compliance dashboard
kcp-harness approvals list [--state s] List human-approval tickets
kcp-harness approvals approve <id> --reviewer <name> --policy-ref <ref>
kcp-harness approvals dismiss <id> --reviewer <name> --policy-ref <ref>Library
import { classify, govern, BudgetLedger, TemporalWatch } from "kcp-harness";
import { generate, listAgents } from "kcp-harness";
// Classify a tool call
const result = classify("Read", { file_path: "docs/api.md" }, governedDomains);
// Generate integration files
const output = generate("claude-code", { manifest: "./knowledge.yaml", paths: ["docs/"] });Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 3: Integration Packages โ
โ Agent-specific configs + rules files โ
โ (claude-code, cursor, copilot, ...) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Layer 2: KCP Compliance Harness โ โ THIS
โ MCP proxy โ deterministic governance โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Layer 1: kcp-agent (planner core) โ
โ 14-gate cascade, decision traces โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโForking agents puts you in competition. A harness puts you in composition.
Tests
npm test # 314 tests across 20 test filesCovers the classifier, governor (incl. approval precedence), approval state machine + providers, confidence-gate wiring, proxy, audit, budget ledger, temporal watch, evidence export, dashboard, and all agent integrations.
License
Apache-2.0 ยท By eXOReaction AS, hosted under Cantara.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceA transparent proxy and execution firewall that intercepts and audits AI agent tool calls against configurable security policies before forwarding them to downstream MCP servers. It provides safe execution environments with features like data redaction, anti-loop protection, and unified alert dispatching.Last updated
- Alicense-qualityCmaintenanceAn MCP server that enforces runtime governance on AI agent actions โ file access, command execution, delegation chains, and permission escalation.Last updatedMIT
- Alicense-qualityBmaintenanceA gateway that enforces permissions, sanitization, approval, and audit for AI agent MCP tool calls, with a policy engine and local proxy CLI.Last updated1821MIT
- AlicenseBqualityAmaintenanceA governance proxy for AI tools โ every MCP/agent tool call is policy-gated, secret-redacted, and written to a hash-chained, offline-verifiable audit trail.Last updated13MIT
Related MCP Connectors
Runtime permission, approval, and audit layer for AI agent tool execution.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Security firewall for AI agents โ scans MCP calls for injection, secrets, and risks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cantara/kcp-harness'
If you have feedback or need assistance with the MCP directory API, please join our Discord server